Commit graph

448 commits

Author SHA1 Message Date
Bjørn Erik Pedersen
2c3efc8106 Alias Page.Scratch to Page.Store (note)
Fixes #13016
2024-11-06 09:49:23 +01:00
Bjørn Erik Pedersen
1f23b4949c Fix some RenderShortcodes error cases
This issue fixes two cases where `{{__hugo_ctx` artifacts were left in the rendered output:

1. Inclusion when `.RenderShortcodes` is wrapped in HTML.
2. Inclusion of Markdown file without a trailing newline in some cases.

Closes #12854
Updates #12998
2024-11-03 13:33:31 +01:00
Joe Mooring
889308dd85 resources: Address Dart Sass deprecation of global built-in functions
See https://github.com/sass/dart-sass/releases/tag/1.80.0

Fixes #12961
2024-11-01 14:05:27 +01:00
Bjørn Erik Pedersen
e4ad0c5271 Never sanitize when url set in front matter
Fixes #12954
2024-10-16 18:01:11 +02:00
Bjørn Erik Pedersen
a2f666b586 Remove erroneously permalink validation
Fixes #12948
2024-10-16 10:14:48 +02:00
Bjørn Erik Pedersen
6e1c5b61b3 resources/page: Adjust the permalinks colon implementation a little
Mostly to get back to an attribute regexp that's reasonably simle to read/understand.

Updates #12918
2024-10-15 10:28:00 +02:00
n1xx1
e7d0757f95 resources/page: Allow colons in permalinks to be escaped
Updates #12918
2024-10-15 10:28:00 +02:00
Joe Mooring
5b0b663ec3 tailwind: Pin Tailwind 4 test to alpha 26 or later 2024-10-06 22:15:17 +02:00
Joe Mooring
3f68309148 resources/page: Treat null dates as zero dates
Closes #12906
2024-10-06 20:35:25 +02:00
Joe Mooring
ab03588db9 resources/page: Improve front matter date validation
Improve the error message and treat empty strings as zero dates.

Closes #12898
2024-10-05 15:29:57 +02:00
Joe Mooring
d1ba52f3c3 tests: Address deprecation warnings and errors 2024-09-29 10:49:26 +02:00
Joe Mooring
4c02a52f7c resources/page: Validate predefined front matter dates
Closes #10717
2024-09-27 11:19:27 +02:00
Bjørn Erik Pedersen
da72ac2db9
tailwind: Pin Tailwind 4 test to alpha 24
See #12880
2024-09-27 10:36:25 +02:00
Joe Mooring
5b442b3cce libsass: Resolve directory paths to directory index files
Closes #12851
2024-09-16 09:34:14 +02:00
Joe Mooring
2bc27657d8 dartsass: Resolve directory paths to directory index files
Closes #12849
2024-09-15 20:32:11 +02:00
Bjørn Erik Pedersen
3d6baedaec Don't count HTML markup in auto summaries
This commit also fixes a bug where a `</picture>` end tag was wrongly used to detect a end paragraph. This should be very rare, though.

Closes #12837
2024-09-10 11:03:47 +02:00
Bjørn Erik Pedersen
8f2eac0195 Make ContentWithoutSummary return Content when summary is fetched from front matter
Fixes #12822
2024-09-05 12:12:24 +02:00
Bjørn Erik Pedersen
37609262dc Add Page.Contents with scope support
Note that this also adds a new `.ContentWithoutSummary` method, and to do that we had to unify the different summary types:

Both `auto` and `manual` now returns HTML. Before this commit, `auto` would return plain text. This could be considered to be a slightly breaking change, but for the better: Now you can treat the `.Summary` the same without thinking about where it comes from, and if you want plain text, pipe it into `{{ .Summary | plainify }}`.

Fixes #8680
Fixes #12761
Fixes #12778
Fixes #716
2024-08-29 16:45:21 +02:00
Bjørn Erik Pedersen
5f667f8796 Fix missing method NameNormalized panic
Closes #12795
2024-08-25 23:17:26 +02:00
Bjørn Erik Pedersen
01008ba512 Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrder
See #12776
2024-08-17 16:47:50 +02:00
b10c
5220d371ea
resources: Add URI GetRemote error
Previouly, only "ERROR failed to fetch remote resource: Forbidden"
would be shown when a resource failed to load. In my case, a tweet's
author I was embedding using the twitter shortcode switched his profile
to private which resulted in my blog failing to build. To figure out
where the originates, I added the log to the error message.
2024-08-14 13:24:58 +02:00
Bjørn Erik Pedersen
fbfccb394b Fix compare of uints and ints in eq, gt etc.
Fixes #12733
2024-08-10 14:00:21 +02:00
Bjørn Erik Pedersen
944fcc216f Fix images.AutoOrient regression
Broken in v0.130.0. Added a integration test to avoid future breakage.

Fixes #12712
2024-08-02 10:36:06 +02:00
n1xx1
914fa13efd revamp pagegroup tests with quicktest 2024-08-02 10:03:20 +02:00
n1xx1
51f09b17fd allow nested params when using Pages.GroupByParam and Pages.GroupByParamDate 2024-08-02 10:03:20 +02:00
n1xx1
566fe7ba12
resources/page: Expand parmalinks tokens in url
This change allows to use permalink tokens in url front matter fields. This should be useful to target more specific pages instead of using a global permalink configuration. It's expected to be used with cascade.

Fixes #9714
2024-08-01 12:14:29 +02:00
Bjørn Erik Pedersen
216a69a1ef Shorten processed image filenames
Fixes #12688
Fixes #12656
2024-07-31 16:44:06 +02:00
Bjørn Erik Pedersen
e67886c038 Consolidate all hashing to the common/hashing package
And remove now unsued hashing funcs.
2024-07-31 16:44:06 +02:00
Bjørn Erik Pedersen
d5eda13cb2 Replace the MD5 hashing of images with xxHash
Note that we only use this for change detection.

The previous implementation invoked `MD5FromReaderFast` that created a MD5 has from 8 64 bytes chunks in the file, which is obviously very fast. The new implementation creates the hash from the entire file and ... seems to be even more effective:

```
name          old time/op    new time/op    delta
HashImage-10    9.45µs ±21%   10.89µs ± 1%     ~     (p=0.343 n=4+4)

name          old alloc/op   new alloc/op   delta
HashImage-10      144B ± 0%        8B ± 0%  -94.44%  (p=0.029 n=4+4)

name          old allocs/op  new allocs/op  delta
HashImage-10      4.00 ± 0%      1.00 ± 0%  -75.00%  (p=0.029 n=4+4)
```
2024-07-31 16:44:06 +02:00
Bjørn Erik Pedersen
8b5d796989 resources: Add BenchmarkHashImage 2024-07-31 16:44:06 +02:00
Bjørn Erik Pedersen
2babd6404e identity: Use xxHash in hashstructure (note)
```
name                 old time/op    new time/op    delta
HashString/n28-10       133ns ± 9%     107ns ±10%  -19.58%  (p=0.029 n=4+4)
HashString/n112-10      243ns ± 5%     121ns ± 4%  -50.08%  (p=0.029 n=4+4)
HashString/n448-10      698ns ± 3%     174ns ± 5%  -75.02%  (p=0.029 n=4+4)
HashString/n1792-10    2.58µs ± 4%    0.38µs ± 4%  -85.11%  (p=0.029 n=4+4)
HashString/n7168-10    10.0µs ± 3%     1.3µs ± 4%  -86.91%  (p=0.029 n=4+4)

name                 old alloc/op   new alloc/op   delta
HashString/n28-10       80.0B ± 0%     72.0B ± 0%  -10.00%  (p=0.029 n=4+4)
HashString/n112-10       160B ± 0%      152B ± 0%   -5.00%  (p=0.029 n=4+4)
HashString/n448-10       496B ± 0%      488B ± 0%   -1.61%  (p=0.029 n=4+4)
HashString/n1792-10    1.84kB ± 0%    1.83kB ± 0%   -0.43%  (p=0.029 n=4+4)
HashString/n7168-10    8.24kB ± 0%    8.23kB ± 0%   -0.06%  (p=0.029 n=4+4)

name                 old allocs/op  new allocs/op  delta
HashString/n28-10        4.00 ± 0%      3.00 ± 0%  -25.00%  (p=0.029 n=4+4)
HashString/n112-10       4.00 ± 0%      3.00 ± 0%  -25.00%  (p=0.029 n=4+4)
HashString/n448-10       4.00 ± 0%      3.00 ± 0%  -25.00%  (p=0.029 n=4+4)
HashString/n1792-10      4.00 ± 0%      3.00 ± 0%  -25.00%  (p=0.029 n=4+4)
HashString/n7168-10      4.00 ± 0%      3.00 ± 0%  -25.00%  (p=0.029 n=4+4)
```
2024-07-31 16:44:06 +02:00
Bjørn Erik Pedersen
78db8aebca identity: Upgrade to github.com/mitchellh/hashstructure/v2 v2.0.2
```
name                 old time/op    new time/op    delta
HashString/n28-10       131ns ± 7%     133ns ±19%   ~     (p=0.343 n=4+4)
HashString/n112-10      237ns ± 5%     241ns ± 3%   ~     (p=0.229 n=4+4)
HashString/n448-10      688ns ± 3%     687ns ± 1%   ~     (p=0.886 n=4+4)
HashString/n1792-10    2.51µs ± 3%    2.56µs ± 3%   ~     (p=0.200 n=4+4)
HashString/n7168-10    10.1µs ± 2%    10.0µs ± 4%   ~     (p=0.686 n=4+4)

name                 old alloc/op   new alloc/op   delta
HashString/n28-10       80.0B ± 0%     80.0B ± 0%   ~     (all equal)
HashString/n112-10       160B ± 0%      160B ± 0%   ~     (all equal)
HashString/n448-10       496B ± 0%      496B ± 0%   ~     (all equal)
HashString/n1792-10    1.84kB ± 0%    1.84kB ± 0%   ~     (all equal)
HashString/n7168-10    8.24kB ± 0%    8.24kB ± 0%   ~     (all equal)

name                 old allocs/op  new allocs/op  delta
HashString/n28-10        4.00 ± 0%      4.00 ± 0%   ~     (all equal)
HashString/n112-10       4.00 ± 0%      4.00 ± 0%   ~     (all equal)
HashString/n448-10       4.00 ± 0%      4.00 ± 0%   ~     (all equal)
HashString/n1792-10      4.00 ± 0%      4.00 ± 0%   ~     (all equal)
HashString/n7168-10      4.00 ± 0%      4.00 ± 0%   ~     (all equal)
```

Closes #11644
2024-07-31 16:44:06 +02:00
Bjørn Erik Pedersen
72ff937e11 Switch EXIF library
Closes #10855
Closes #8586
Closes #8996
2024-07-20 15:56:10 +02:00
Bjørn Erik Pedersen
7b6dafc53a Fix it so publishDate rolls up to section, taxonomy, or term pages
Fixes #12438
2024-07-01 21:48:12 +02:00
Bjørn Erik Pedersen
e1317dd322 Add css.TailwindCSS
Closes #12618
Closes #12620
2024-06-25 15:48:02 +02:00
Bjørn Erik Pedersen
6cd0784e44 Implement defer
Closes #8086
Closes #12589
2024-06-23 11:25:47 +02:00
Joe Mooring
57165d44ed resources: Update Dart Sass error message 2024-06-13 16:25:50 +02:00
Bjørn Erik Pedersen
9c3143c45a resources/page: Deprecate PageSize in favor of PagerSize
See #12572
2024-06-09 12:28:24 +02:00
Bjørn Erik Pedersen
9f22bc4414 Rename DefaultPageSize => PagerSize
This was recently introduced. so no breaking change.

The thing is:

* We do not commonly use the prefix Default* even if it can be overridden in the templates.
* PagerSize makes more sense and is also the term used in the code.
2024-06-09 12:28:24 +02:00
Joe Mooring
cba2de6ec9 resources/page: Let GroupByParam return nil instead of error
Closes #12578
2024-06-08 18:35:14 +02:00
Bjørn Erik Pedersen
9c4e14eb4f Add option to not generate aliases for first page of pagination pages
Also consolidate the pagination configuration into a struct.

Closes #12572
2024-06-08 15:42:01 +02:00
Bjørn Erik Pedersen
1cdd3d0a9e js: Support more recent targets with js.Build / esbuild
Closes #12575
2024-06-08 11:40:19 +02:00
Bjørn Erik Pedersen
bc05d854b2
resources: Fix spelling 2024-06-04 18:48:39 +02:00
Bjørn Erik Pedersen
447108fed2
Add a HTTP cache for remote resources.
Fixes #12502
Closes #11891
2024-06-04 16:07:39 +02:00
Joe Mooring
c8dac67def resources/page: Deprecate .Sites.First in favor of .Sites.Default
Closes #12513
2024-06-01 18:02:19 +02:00
Bjørn Erik Pedersen
245928a1ff content adapter: Add support for menus in AddPage
Fixes #12507
2024-05-30 11:29:21 +02:00
Bjørn Erik Pedersen
39cf906bc0 Fix mixed case Page params handling in content adapters
Fixes #12497
2024-05-15 12:39:33 +02:00
Bjørn Erik Pedersen
1aacfced39 Fix paths with dots issue with content adapters
Fixes #12493
2024-05-15 12:39:33 +02:00
Joe Mooring
6dbbe6dd3a resources/images: Handle NaN EXIF latitude and longitude
Fixes #12490
2024-05-14 14:16:58 +02:00
Bjørn Erik Pedersen
e2d66e3218
Create pages from _content.gotmpl
Closes #12427
Closes #12485
Closes #6310
Closes #5074
2024-05-14 13:12:08 +02:00