Commit graph

613 commits

Author SHA1 Message Date
Bjørn Erik Pedersen
6d97ee711e Make all renderhook Text methods return template.HTML 2024-08-31 21:05:58 +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
2b5c335e93 deps: Upgrade github.com/bep/golibsass v1.1.1 => v1.2.0
Fixes #12649
2024-08-28 17:02:19 +02:00
hugoreleaser
aa0f66b290 releaser: Prepare repository for 0.134.0-DEV
[ci skip]
2024-08-26 14:13:52 +00:00
hugoreleaser
47d00202e7 releaser: Bump versions for release of 0.133.1
[ci skip]
2024-08-26 13:58:46 +00:00
hugoreleaser
c054cba042 releaser: Prepare repository for 0.134.0-DEV
[ci skip]
2024-08-17 20:11:05 +00:00
hugoreleaser
c9777473d1 releaser: Bump versions for release of 0.133.0
[ci skip]
2024-08-17 19:57:41 +00:00
hugoreleaser
b3ad58fa04 releaser: Prepare repository for 0.133.0-DEV
[ci skip]
2024-08-14 16:31:14 +00:00
hugoreleaser
3fd26c70df releaser: Bump versions for release of 0.132.2
[ci skip]
2024-08-14 16:17:21 +00:00
Bjørn Erik Pedersen
b2d4f67a88
loggers: Omit map nil check 2024-08-13 20:10:43 +02:00
hugoreleaser
736e8a4d08 releaser: Prepare repository for 0.133.0-DEV
[ci skip]
2024-08-13 10:24:54 +00:00
hugoreleaser
1bde700dfc releaser: Bump versions for release of 0.132.1
[ci skip]
2024-08-13 10:10:10 +00:00
hugoreleaser
caa90e6a12 releaser: Prepare repository for 0.133.0-DEV
[ci skip]
2024-08-12 15:36:03 +00:00
hugoreleaser
005e895a38 releaser: Bump versions for release of 0.132.0
[ci skip]
2024-08-12 15:21:36 +00:00
Bjørn Erik Pedersen
e1e1baa1bd Improve Katex error handling and fix handling of large expressions
* Make throwOnError=true the new default
* Handle JS errors as part of the RPC request/response flow
* Return a new Result type with .Err on it

This enables constructs on the form:

```handlebars
{{ with transform.ToMath "c = \\foo{a^2 + b^2}" }}
	{{ with .Err }}
	 	{{ warnf "error: %s" . }}
	{{ else }}
		{{ . }}
	{{ end }}
{{ end }}
```

Note that the new `Result` type behaves like `template.HTML` (or a string if needed) when printed, but it will panic if in a error state.

Closes #12748
2024-08-12 13:50:18 +02:00
Bjørn Erik Pedersen
33c0938cd5 Add build time math rendering
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo.

This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc.

See these issues for more context:

* https://github.com/gohugoio/hugo/issues/12736
* https://github.com/gohugoio/hugo/issues/12737

See #11927
2024-08-09 17:18:37 +02:00
hugoreleaser
2fcc53780f releaser: Prepare repository for 0.132.0-DEV
[ci skip]
2024-08-02 09:18:21 +00:00
hugoreleaser
bfbee17932 releaser: Bump versions for release of 0.131.0
[ci skip]
2024-08-02 09:03:48 +00: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
hugoreleaser
e45eae4d67 releaser: Prepare repository for 0.131.0-DEV
[ci skip]
2024-07-29 14:06:20 +00:00
hugoreleaser
9b1b11c8a5 releaser: Bump versions for release of 0.130.0
[ci skip]
2024-07-29 13:51:56 +00:00
hugoreleaser
979423f4d5 releaser: Prepare repository for 0.130.0-DEV
[ci skip]
2024-07-17 13:42:58 +00:00
hugoreleaser
e85be29867 releaser: Bump versions for release of 0.129.0
[ci skip]
2024-07-17 13:29:16 +00:00
hugoreleaser
edeed52fc5 releaser: Prepare repository for 0.129.0-DEV
[ci skip]
2024-07-04 08:27:37 +00:00
hugoreleaser
de36c1a95d releaser: Bump versions for release of 0.128.2
[ci skip]
2024-07-04 08:13:25 +00:00
hugoreleaser
82af94d1f5 releaser: Prepare repository for 0.129.0-DEV
[ci skip]
2024-07-02 07:00:44 +00:00
hugoreleaser
0ff542b4b9 releaser: Bump versions for release of 0.128.1
[ci skip]
2024-07-02 06:46:41 +00:00
hugoreleaser
95479fc2d0 releaser: Prepare repository for 0.129.0-DEV
[ci skip]
2024-06-25 16:30:14 +00:00
hugoreleaser
e6d2712ee0 releaser: Bump versions for release of 0.128.0
[ci skip]
2024-06-25 16:15:48 +00: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
Bjørn Erik Pedersen
8731d88222
Fix Erroridf/Warnidf mixed case issue
Fixes #12617
2024-06-22 19:01:56 +02:00
Bjørn Erik Pedersen
1c85830bc7 common/hexec: Fall back to the binary in PATH if npx fails
Closes #12486
2024-06-22 12:25:02 +02:00
hugoreleaser
1a53a8c2f5 releaser: Prepare repository for 0.128.0-DEV
[ci skip]
2024-06-05 10:41:48 +00:00
hugoreleaser
74e0f3bd63 releaser: Bump versions for release of 0.127.0
[ci skip]
2024-06-05 10:27:59 +00: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
hugoreleaser
c71e24af51 releaser: Prepare repository for 0.127.0-DEV
[ci skip]
2024-06-02 13:15:24 +00:00
hugoreleaser
44f1edcb06 releaser: Bump versions for release of 0.126.3
[ci skip]
2024-06-02 13:02:43 +00:00
Bjørn Erik Pedersen
420f26b6bb
releaser: Prepare repository for 0.127.0-DEV 2024-05-30 18:58:47 +02:00
hugoreleaser
312b71232d releaser: Bump versions for release of 0.126.2
[ci skip]
2024-05-30 16:07:40 +00:00
hugoreleaser
3d40aba512 releaser: Bump versions for release of 0.126.1
[ci skip]
2024-05-15 10:42:34 +00:00
hugoreleaser
32c967551b releaser: Bump versions for release of 0.126.0
[ci skip]
2024-05-14 13:24:11 +00: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
hugoreleaser
b1bf0bff2c releaser: Prepare repository for 0.126.0-DEV
[ci skip]
2024-05-08 15:00:23 +00:00
hugoreleaser
b1d808bc37 releaser: Bump versions for release of 0.125.7
[ci skip]
2024-05-08 14:46:24 +00:00
hugoreleaser
c46d603a02 releaser: Prepare repository for 0.126.0-DEV
[ci skip]
2024-05-05 11:05:28 +00:00
hugoreleaser
69ede10edc releaser: Bump versions for release of 0.125.6
[ci skip]
2024-05-05 10:52:52 +00:00