Commit graph

589 commits

Author SHA1 Message Date
hugoreleaser
1007bcdf49 releaser: Prepare repository for 0.124.0-DEV
[ci skip]
2024-02-28 16:01:41 +00:00
hugoreleaser
1904ba40e8 releaser: Bump versions for release of 0.123.5
[ci skip]
2024-02-28 15:47:09 +00:00
hugoreleaser
673c634131 releaser: Prepare repository for 0.124.0-DEV
[ci skip]
2024-02-26 16:46:48 +00:00
hugoreleaser
21a41003c4 releaser: Bump versions for release of 0.123.4
[ci skip]
2024-02-26 16:33:05 +00:00
hugoreleaser
7508a16470 releaser: Prepare repository for 0.124.0-DEV
[ci skip]
2024-02-23 17:22:38 +00:00
hugoreleaser
a75a659f6f releaser: Bump versions for release of 0.123.3
[ci skip]
2024-02-23 17:09:20 +00:00
Bjørn Erik Pedersen
bf14d0cb26 Speed up GetPage
```
name                             old time/op    new time/op    delta
GetPage-10                          413ns ± 0%     287ns ± 1%  -30.47%  (p=0.029 n=4+4)
GetPageRegular/From_root-10         757ns ± 1%     706ns ± 1%   -6.75%  (p=0.029 n=4+4)
GetPageRegular/Page_relative-10     838ns ± 1%     786ns ± 1%   -6.16%  (p=0.029 n=4+4)

name                             old alloc/op   new alloc/op   delta
GetPage-10                           312B ± 0%       24B ± 0%  -92.31%  (p=0.029 n=4+4)
GetPageRegular/From_root-10          328B ± 0%      200B ± 0%  -39.02%  (p=0.029 n=4+4)
GetPageRegular/Page_relative-10      360B ± 0%      232B ± 0%  -35.56%  (p=0.029 n=4+4)

name                             old allocs/op  new allocs/op  delta
GetPage-10                           8.00 ± 0%      2.00 ± 0%  -75.00%  (p=0.029 n=4+4)
GetPageRegular/From_root-10          7.00 ± 0%      5.00 ± 0%  -28.57%  (p=0.029 n=4+4)
GetPageRegular/Page_relative-10      9.00 ± 0%      7.00 ± 0%  -22.22%  (p=0.029 n=4+4)
```
2024-02-23 16:29:21 +01:00
hugoreleaser
ea0ba9751d releaser: Prepare repository for 0.124.0-DEV
[ci skip]
2024-02-22 15:41:43 +00:00
hugoreleaser
929b91fe75 releaser: Bump versions for release of 0.123.2
[ci skip]
2024-02-22 15:27:15 +00:00
hugoreleaser
6da1d8f370 releaser: Prepare repository for 0.124.0-DEV
[ci skip]
2024-02-21 08:30:57 +00:00
hugoreleaser
3f8434a62f releaser: Bump versions for release of 0.123.1
[ci skip]
2024-02-21 08:17:45 +00:00
hugoreleaser
8406a3e9dc releaser: Bump versions for release of 0.123.0
[ci skip]
2024-02-19 17:28:48 +00:00
Bjørn Erik Pedersen
639073e4fe Fix rebuild with resources.Concat
Fixes #12017
2024-02-16 13:17:53 +01:00
Bjørn Erik Pedersen
a65622a13e Fix rebuild of changed bundled content files
Fixes #12000
2024-02-06 21:53:33 +01:00
Bjørn Erik Pedersen
609d798e34 Handle resource changes when the resources is already evicted from cache
Also fix a logical flaw in the cache resizer that made it too aggressive. After this I haven't been able to reproduce #11988, but I need to look closer.

Closes #11973
Updates #11988
2024-02-04 16:55:06 +01:00
Bjørn Erik Pedersen
53f204310e
all: Rename Unmormalized => Unnormalized 2024-02-03 18:10:38 +01:00
Bjørn Erik Pedersen
b72f909725
hugio: Rename strigReadSeeker => stringReadSeeker 2024-02-03 17:25:34 +01:00
Bjørn Erik Pedersen
e33a632551 resources: Optimize reading resource Content when it's already a string 2024-02-03 15:07:59 +01:00
Bjørn Erik Pedersen
8d42a7942a Improve nilpointer error message 2024-02-01 19:53:51 +01:00
Bjørn Erik Pedersen
4174a7866b Fix disabled languages regression
Fixes #11959
2024-02-01 19:42:55 +01:00
Bjørn Erik Pedersen
5b7cb258ec Create default link and image render hooks
Fixes #11933
2024-01-30 20:12:19 +01:00
Bjørn Erik Pedersen
afee781f03 Emit a warning that can be turned off when overwriting built-in .Params values
Fixes #11941
2024-01-30 20:12:03 +01:00
Bjørn Erik Pedersen
4e84f57efb Add warnidf template function
Also rename config `ignoreErrors` => `ignoreLogs`

But the old still works.

Closes #9189
2024-01-30 20:12:03 +01:00
Bjørn Erik Pedersen
a795acbcd8 all: Run gofumpt -l -w . 2024-01-28 23:14:09 +01:00
Bjørn Erik Pedersen
982d9513e7
testing: Simplify some integration tests 2024-01-28 22:17:22 +01:00
Bjørn Erik Pedersen
2a0329423c
testing: Rename integration_test.go to PACKAGE_integration_test.go
Primary motivation making them easier to find in the code editor.
2024-01-28 11:41:59 +01:00
Bjørn Erik Pedersen
7285e74090
all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning
There are some breaking changes in this commit, see #11455.

Closes #11455
Closes #11549

This fixes a set of bugs (see issue list) and it is also paying some technical debt accumulated over the years. We now build with Staticcheck enabled in the CI build.

The performance should be about the same as before for regular sized Hugo sites, but it should perform and scale much better to larger data sets, as objects that uses lots of memory (e.g. rendered Markdown, big JSON files read into maps with transform.Unmarshal etc.) will now get automatically garbage collected if needed. Performance on partial rebuilds when running the server in fast render mode should be the same, but the change detection should be much more accurate.

A list of the notable new features:

* A new dependency tracker that covers (almost) all of Hugo's API and is used to do fine grained partial rebuilds when running the server.
* A new and simpler tree document store which allows fast lookups and prefix-walking in all dimensions (e.g. language) concurrently.
* You can now configure an upper memory limit allowing for much larger data sets and/or running on lower specced PCs.
We have lifted the "no resources in sub folders" restriction for branch bundles (e.g. sections).
Memory Limit
* Hugos will, by default, set aside a quarter of the total system memory, but you can set this via the OS environment variable HUGO_MEMORYLIMIT (in gigabytes). This is backed by a partitioned LRU cache used throughout Hugo. A cache that gets dynamically resized in low memory situations, allowing Go's Garbage Collector to free the memory.

New Dependency Tracker: Hugo has had a rule based coarse grained approach to server rebuilds that has worked mostly pretty well, but there have been some surprises (e.g. stale content). This is now revamped with a new dependency tracker that can quickly calculate the delta given a changed resource (e.g. a content file, template, JS file etc.). This handles transitive relations, e.g. $page -> js.Build -> JS import, or $page1.Content -> render hook -> site.GetPage -> $page2.Title, or $page1.Content -> shortcode -> partial -> site.RegularPages -> $page2.Content -> shortcode ..., and should also handle changes to aggregated values (e.g. site.Lastmod) effectively.

This covers all of Hugo's API with 2 known exceptions (a list that may not be fully exhaustive):

Changes to files loaded with template func os.ReadFile may not be handled correctly. We recommend loading resources with resources.Get
Changes to Hugo objects (e.g. Page) passed in the template context to lang.Translate may not be detected correctly. We recommend having simple i18n templates without too much data context passed in other than simple types such as strings and numbers.
Note that the cachebuster configuration (when A changes then rebuild B) works well with the above, but we recommend that you revise that configuration, as it in most situations should not be needed. One example where it is still needed is with TailwindCSS and using changes to hugo_stats.json to trigger new CSS rebuilds.

Document Store: Previously, a little simplified, we split the document store (where we store pages and resources) in a tree per language. This worked pretty well, but the structure made some operations harder than they needed to be. We have now restructured it into one Radix tree for all languages. Internally the language is considered to be a dimension of that tree, and the tree can be viewed in all dimensions concurrently. This makes some operations re. language simpler (e.g. finding translations is just a slice range), but the idea is that it should also be relatively inexpensive to add more dimensions if needed (e.g. role).

Fixes #10169
Fixes #10364
Fixes #10482
Fixes #10630
Fixes #10656
Fixes #10694
Fixes #10918
Fixes #11262
Fixes #11439
Fixes #11453
Fixes #11457
Fixes #11466
Fixes #11540
Fixes #11551
Fixes #11556
Fixes #11654
Fixes #11661
Fixes #11663
Fixes #11664
Fixes #11669
Fixes #11671
Fixes #11807
Fixes #11808
Fixes #11809
Fixes #11815
Fixes #11840
Fixes #11853
Fixes #11860
Fixes #11883
Fixes #11904
Fixes #7388
Fixes #7425
Fixes #7436
Fixes #7544
Fixes #7882
Fixes #7960
Fixes #8255
Fixes #8307
Fixes #8863
Fixes #8927
Fixes #9192
Fixes #9324
2024-01-27 16:28:14 +01:00
hugoreleaser
1083bf7c08 releaser: Prepare repository for 0.123.0-DEV
[ci skip]
2024-01-26 16:06:12 +00:00
hugoreleaser
b9a03bd59d releaser: Bump versions for release of 0.122.0
[ci skip]
2024-01-26 15:54:24 +00:00
hugoreleaser
5ff6323320 releaser: Prepare repository for 0.122.0-DEV
[ci skip]
2024-01-05 12:34:12 +00:00
hugoreleaser
6d5b44305e releaser: Bump versions for release of 0.121.2
[ci skip]
2024-01-05 12:21:15 +00:00
Bjørn Erik Pedersen
8adba648cc all: Remove unused code
Using x/tools/cmd/deadcode
2023-12-18 19:51:26 +01:00
hugoreleaser
6f13430d4a releaser: Prepare repository for 0.122.0-DEV
[ci skip]
2023-12-08 09:01:24 +00:00
hugoreleaser
00b46fed8e releaser: Bump versions for release of 0.121.1
[ci skip]
2023-12-08 08:47:45 +00:00
hugoreleaser
5186e762ac releaser: Prepare repository for 0.122.0-DEV
[ci skip]
2023-12-05 15:36:07 +00:00
hugoreleaser
e321c3502a releaser: Bump versions for release of 0.121.0
[ci skip]
2023-12-05 15:22:31 +00:00
Joe Mooring
9ea7103db7 tpl/urls: Retain query and fragment with absURL and absLangURL
Closes #11772
2023-12-04 11:41:30 +01:00
Bjørn Erik Pedersen
e2a624dd6c common/para: Skip flaky test on CI 2023-11-28 12:23:38 +01:00
Bjørn Erik Pedersen
4fb40ee873 deps: Upgrade to libwebp 1.3.2
Closes #11746
2023-11-28 12:23:38 +01:00
Bjørn Erik Pedersen
27620daa20
common/para: Skip flaky tests on Windows 2023-11-16 18:24:20 +01:00
hugoreleaser
ac7cffa7e2 releaser: Prepare repository for 0.121.0-DEV
[ci skip]
2023-11-08 11:32:02 +00:00
hugoreleaser
f11bca5fec releaser: Bump versions for release of 0.120.4
[ci skip]
2023-11-08 11:18:07 +00:00
hugoreleaser
da2a8e6402 releaser: Prepare repository for 0.121.0-DEV
[ci skip]
2023-11-01 18:11:30 +00:00
hugoreleaser
a4892a07b4 releaser: Bump versions for release of 0.120.3
[ci skip]
2023-11-01 17:57:00 +00:00
Bjørn Erik Pedersen
4d38f47250 Add a field prefix to the deprecated log statements
To make theme easier to spot, esp. on INFO level.
2023-11-01 16:40:26 +01:00
Bjørn Erik Pedersen
80f793c38d Avoid double printing INFO deprecation messages
Fixes #11645
2023-11-01 16:40:26 +01:00
hugoreleaser
9e06fd3394 releaser: Prepare repository for 0.121.0-DEV
[ci skip]
2023-10-31 16:40:29 +00:00
hugoreleaser
9c2b2414d2 releaser: Bump versions for release of 0.120.2
[ci skip]
2023-10-31 16:27:18 +00:00
Bjørn Erik Pedersen
ab21433689 Fix deprecation printing on info level
Fixes #11638
2023-10-31 10:42:23 +01:00
hugoreleaser
47bf2fcbe2 releaser: Prepare repository for 0.121.0-DEV
[ci skip]
2023-10-30 16:57:41 +00:00
hugoreleaser
16fb2cae88 releaser: Bump versions for release of 0.120.1
[ci skip]
2023-10-30 16:44:31 +00:00
hugoreleaser
935999e2fa releaser: Prepare repository for 0.121.0-DEV
[ci skip]
2023-10-30 14:20:34 +00:00
hugoreleaser
20c3bae2c4 releaser: Bump versions for release of 0.120.0
[ci skip]
2023-10-30 14:06:47 +00:00
Bjørn Erik Pedersen
71fd79a3f4 Revise the deprecation logging
This introduces a more automatic way of increasing the log levels for deprecation log statements based on the version it was deprecated.

The thresholds are a little arbitrary, but

* We log INFO for 6 releases
* We log WARN for another 6 releases
* THen ERROR (failing the build)

This should give theme authors plenty of time to catch up without having the log filled with warnings.
2023-10-26 20:41:19 +02:00
Joe Mooring
d1b4458536 common/hugo: Add hugo.IsServer and hugo.IsDevelopment
And deprecate site.IsServer.

Closes #11510
2023-10-06 16:26:51 +02:00
Oleksandr Redko
274852bcf2 all: Format files with gofmt 2023-10-05 14:45:55 +02:00
hugoreleaser
d234a963eb releaser: Prepare repository for 0.120.0-DEV
[ci skip]
2023-09-24 15:32:33 +00:00
hugoreleaser
b84644c008 releaser: Bump versions for release of 0.119.0
[ci skip]
2023-09-24 15:20:17 +00:00
Oleksandr Redko
6b65b2fae6 common: Remove unused constants 2023-09-24 11:59:49 +02:00
Bjørn Erik Pedersen
ef0e7149d6 Add $image.Process
Which supports all the existing actions: resize, crop, fit, fill.

But it also allows plain format conversions:

```
{{ $img = $img.Process "webp" }}
```

Which will be a simple re-encoding of the source image.

Fixes #11483
2023-09-24 11:54:29 +02:00
hugoreleaser
2ae4786ca1 releaser: Prepare repository for 0.119.0-DEV
[ci skip]
2023-08-31 11:35:48 +00:00
hugoreleaser
da7983ac4b releaser: Bump versions for release of 0.118.2
[ci skip]
2023-08-31 11:23:51 +00:00
hugoreleaser
7362ba2204 releaser: Prepare repository for 0.119.0-DEV
[ci skip]
2023-08-31 09:56:08 +00:00
hugoreleaser
0eb480aa1d releaser: Bump versions for release of 0.118.1
[ci skip]
2023-08-31 09:42:31 +00:00
hugoreleaser
0200eaf58f releaser: Prepare repository for 0.119.0-DEV
[ci skip]
2023-08-31 07:49:58 +00:00
hugoreleaser
28b640a220 releaser: Bump versions for release of 0.118.0
[ci skip]
2023-08-31 07:36:55 +00:00
Oleksandr Redko
65871d5cf4 common/loggers: Fix typo in option name 2023-08-23 22:52:37 +02:00
Bjørn Erik Pedersen
7d74cd0cc8 commands: Handle floats without decimals in hugo config
Updates #11345
2023-08-08 09:13:17 +02:00
hugoreleaser
239f2e2c99 releaser: Prepare repository for 0.117.0-DEV
[ci skip]
2023-08-01 07:36:32 +00:00
hugoreleaser
3e1ea030a5 releaser: Bump versions for release of 0.116.1
[ci skip]
2023-08-01 07:24:54 +00:00
hugoreleaser
92c1594372 releaser: Prepare repository for 0.117.0-DEV
[ci skip]
2023-07-31 10:40:27 +00:00
hugoreleaser
5a7e0da84e releaser: Bump versions for release of 0.116.0
[ci skip]
2023-07-31 10:28:28 +00:00
Bjørn Erik Pedersen
bec9b80d95
Deprecate taxonomyTerm
In favour of 'taxonomy'

Closes #11256
2023-07-28 15:14:24 +02:00
Bjørn Erik Pedersen
4d7af757c9
Add a common regexp cache
```
BenchmarkGetOrCompileRegexp-10    	73959368	        13.71 ns/op	       0 B/op	       0 allocs/op
BenchmarkCompileRegexp-10         	 3143529	       380.1 ns/op	     872 B/op	      10 allocs/op
```
2023-07-27 19:23:12 +02:00
hugoreleaser
0dbe0f1a07 releaser: Prepare repository for 0.116.0-DEV
[ci skip]
2023-07-20 07:02:18 +00:00
hugoreleaser
dc95245212 releaser: Bump versions for release of 0.115.4
[ci skip]
2023-07-20 06:49:57 +00:00
Joe Mooring
2f11e673c5 common/htime: Fix localization of abbreviated month names
Fixes #11267
2023-07-19 19:00:18 +02:00
Bjørn Erik Pedersen
387c5f60f9 Improve error messages for PostCSS etc.
Fixes #9730
2023-07-17 20:42:32 +02:00
hugoreleaser
79f15be5b0 releaser: Prepare repository for 0.116.0-DEV
[ci skip]
2023-07-13 16:23:50 +00:00
hugoreleaser
5c2e014a51 releaser: Bump versions for release of 0.115.3
[ci skip]
2023-07-13 16:11:34 +00:00
hugoreleaser
91b02091a5 releaser: Prepare repository for 0.116.0-DEV
[ci skip]
2023-07-08 17:19:03 +00:00
hugoreleaser
8966424e0e releaser: Bump versions for release of 0.115.2
[ci skip]
2023-07-08 17:06:56 +00:00
Anthony Fok
bf7ee8a91a Bump github.com/bep/clock v0.3.0 to renamed github.com/bep/clocks v0.5.0 2023-07-04 09:14:48 +02:00
hugoreleaser
d912491f2d releaser: Prepare repository for 0.116.0-DEV
[ci skip]
2023-07-03 17:39:56 +00:00
hugoreleaser
857374e693 releaser: Bump versions for release of 0.115.1
[ci skip]
2023-07-03 17:28:25 +00:00
hugoreleaser
87886f40d1 releaser: Prepare repository for 0.116.0-DEV
[ci skip]
2023-06-29 16:09:06 +00:00
hugoreleaser
67caf50698 releaser: Bump versions for release of 0.115.0
[ci skip]
2023-06-29 15:56:39 +00:00
khayyam
b74b8d6478
common/collections: Fix append regression to allow appending nil
Closes #11180
2023-06-28 09:41:36 +02:00
hugoreleaser
5e12bf7dc3 releaser: Prepare repository for 0.115.0-DEV
[ci skip]
2023-06-19 17:12:27 +00:00
hugoreleaser
9df2ec7988 releaser: Bump versions for release of 0.114.0
[ci skip]
2023-06-19 17:01:43 +00:00
Bjørn Erik Pedersen
6dfbd24797
common/loggers: Drop the bold INFO etc. prefixes
That looked a little too much.
2023-06-19 17:35:43 +02:00
Bjørn Erik Pedersen
f59c3c0214
loggers: Avoid using Logf for the LevelLoggerToWriter
To prevent issues with percentage chars.
2023-06-19 15:56:44 +02:00
Oleksandr Redko
9009c8cdca all: Fix typos in function names and comments 2023-06-19 09:26:29 +02:00
Bjørn Erik Pedersen
1b85303ac2
common/loggers: Re-add trailing newline in logger.Printf
Fixes #11130
2023-06-18 18:56:45 +02:00
Bjørn Erik Pedersen
7c9fada778 Replace the old log setup, with structured logging etc.
Fixes #11124
2023-06-18 13:03:04 +02:00
Bjørn Erik Pedersen
f73c567534 common/collections: Always make a copy of the input slice in Append
Fixes #10458.
2023-06-14 20:18:54 +02:00
Bjørn Erik Pedersen
d178fe94fe tpl/collections: Fix append when appending a slice to a slice of slices
Fixes #11093
2023-06-14 20:18:54 +02:00
Bjørn Erik Pedersen
f210188da3 Upgrade to v2 of the Dart Sass Embedded Protocol
Fixes #11059
2023-06-12 13:47:38 +02:00
hugoreleaser
73779707a2 releaser: Prepare repository for 0.114.0-DEV
[ci skip]
2023-06-05 15:16:33 +00:00
hugoreleaser
085c1b3d61 releaser: Bump versions for release of 0.113.0
[ci skip]
2023-06-05 15:04:51 +00:00