Commit graph

477 commits

Author SHA1 Message Date
Oleksandr Redko
4245a4514d
all: Remove deprecated build tags 2025-02-08 10:29:42 +01:00
Bjørn Erik Pedersen
db28695ff5 Fix some server/watch rebuild issues
Two issues:

1. Fixe potential edit-loop in server/watch mode (see below)
2. Drain the cache eviction stack before we start calculating the change set. This should allow more fine grained rebuilds for bigger sites and/or in low memory situations.

The fix in 6c68142cc1 wasn't really fixing the complete problem.

In Hugo we have some steps that takes more time than others, one example being CSS building with TailwindCSS.

The symptom here is that sometimes when you:

1. Edit content or templates that does not trigger a CSS rebuild => Snappy rebuild.
2. Edit stylesheet or add a CSS class to template that triggers a CSS rebuild => relatively slow rebuild (expected)
3. Then back to content editing or template edits that should not trigger a CSS rebuild => relatively slow rebuild (not expected)

This commit fixes this by pulling the dynacache GC step up and merge it with the cache buster step.

Fixes #13316
2025-02-01 16:29:14 +01:00
Bjørn Erik Pedersen
329b2342f0 Fix "concurrent map iteration and map write" in pages from data
Fixes #13254
2025-01-30 19:57:09 +01:00
Joe Mooring
33b46d8a41 resources: Remove debug statement
Closes #13320
2025-01-30 11:32:57 +01:00
Bjørn Erik Pedersen
a5637831cd
resources: Remove conditional used for debugging 2025-01-23 17:53:38 +01:00
Bjørn Erik Pedersen
68586c891c resources: Add responseHeaders option to resources.GetRemote
* These response headers will be included in `.Data.Headers` if found.
* The header name matching is case insensitive.
* `Data.Headers` is of type `map[string][]string`
* In most cases there will be only one value per header key, but e.g. `Set-Cookie` commonly has multiple values.

Fixes #12521
2025-01-23 15:20:03 +01:00
Bjørn Erik Pedersen
7f0f50b133 Make cascade front matter order deterministic
Fixes #12594
2025-01-23 09:45:47 +01:00
Bjørn Erik Pedersen
1f5a15aba0 resources: Fix 2 image file cache key issues
* Always include the content hash in the cache key for unprocessed images.
* Always include the image config hash in the cache key.

This is also a major cleanup/simplification of the implementation in this area.

Note that this, unfortunately, forces new hashes/filenames for generated images.

Fixes #13273
Fixes #13272
2025-01-18 12:23:18 +01:00
Bjørn Erik Pedersen
2501de7aab resources/images: Refactor golden image tests to locate them closer to the implementation 2025-01-11 18:27:53 +02:00
Bjørn Erik Pedersen
06cc8673fa resources/images: Add some mask tests
Closes #13244
2025-01-11 12:20:11 +02:00
Markus Kienast
71fae99189 resources/images: Add images.Mask
See #13244
2025-01-11 12:20:11 +02:00
Bjørn Erik Pedersen
892b49110e resources/images: Add some golden tests for images.QR 2025-01-09 08:02:43 +01:00
Bjørn Erik Pedersen
d9594a96fc resources/images: Add some golden tests for images.Text 2025-01-08 18:56:26 +01:00
Julius Künzel
4a5cc2dd26 images.Text: Add "alignx" option for horizontal alignment
Add an "alignx" option to the images.Text to control whether the value of the "x" option is the left border of the text (current behaviour), the center of each line or the right border.

Fixes #10849
2025-01-08 17:23:46 +01:00
Bjørn Erik Pedersen
9cad8d38ca images: Rework the golden tests 2025-01-08 17:11:27 +01:00
Bjørn Erik Pedersen
0918e087ec resources: Replace error handling in GetRemote with try (note)
Closes #13216
2025-01-06 12:22:17 +01:00
Bjørn Erik Pedersen
723e3f4342 resources: Add FromOpts for more effective resource creation
E.g. when the targetPath already contains a hash or if the resource content is expensive to create.
2025-01-05 12:43:37 +01:00
Bjørn Erik Pedersen
77824d704c Fix same resource file published more than once
This may still happen, though, in low memory situations or very big sites, but I'm not sure it's worth spending time on fixing that. Writing the same file more than once isn't harmful, the negative effect is the false path warning.
 We may find a way to detect that situation if this becomes a real problem.

Fixes #13164
2024-12-27 18:55:24 +01:00
Bjørn Erik Pedersen
020253904f js/esbuild: Don't try to resolve packages in /assets marked as external
Fixes #13183
2024-12-22 21:29:18 +01:00
Bjørn Erik Pedersen
4a5e94087b Fix union, complement, symdiff, and intersect for transient resources
Fixes #13181
2024-12-22 19:25:03 +01:00
Bjørn Erik Pedersen
565c30eac9 js: Fix js.Batch for multihost setups
Note that this is an unreleased feature.

Fixes #13151
2024-12-16 11:52:18 +01:00
Bjørn Erik Pedersen
e293e7ca6d Add js.Batch
Fixes #12626
Closes #7499
Closes #9978
Closes #12879
Closes #13113
Fixes #13116
2024-12-12 21:43:17 +01:00
Bjørn Erik Pedersen
5ab38de363
Fix Sass imports on the form index.{scss,sass}
Fixes #13123
2024-12-10 13:33:27 +01:00
Bjørn Erik Pedersen
8d017a60fb dartsass: Fix nilpointer on Close when Dart Sass isn't installed
Fixes #13076
2024-11-21 20:00:36 +01:00
Bjørn Erik Pedersen
8d92042ab9
dartsass: Fix error message
Closes #13065
2024-11-18 17:14:56 +01:00
Bjørn Erik Pedersen
3b6eaf9b1f dartsass: Add silenceDeprecations option
Fixes #13045
2024-11-18 13:41:12 +01:00
Bjørn Erik Pedersen
1fd845eee4 dartsass: Remove support for v1 of the protocol/binary (note)
People who stil use a very old binary named `dart-sass-embedded` need to upgrade.

See https://gohugo.io/functions/css/sass/#dart-sass
2024-11-18 12:32:39 +01:00
Bjørn Erik Pedersen
ad43d137d5 Remove deprecations <= v0.122.0 (note)
These have, once we release this, been logging ERROR for 6 minor versions.
2024-11-16 20:32:43 +01:00
Bjørn Erik Pedersen
a7df536a52 Add site.Store and hugo.Store and Shortcode.Store
Closes #13021
2024-11-13 12:41:16 +01:00
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