Commit graph

8809 commits

Author SHA1 Message Date
hugoreleaser
1f746a8724 releaser: Bump versions for release of 0.142.0
[ci skip]
2025-01-22 12:20:52 +00:00
Bjørn Erik Pedersen
6aa72acaf9 Fix render hook's PlainText with typographer extension enabled
Fixes #13286
Fixes #13292
2025-01-22 12:49:25 +01:00
Bjørn Erik Pedersen
9885e7020d Improve assert 2025-01-22 09:44:26 +01:00
Bjørn Erik Pedersen
91101d24f2 Improve assertions 2025-01-22 09:44:26 +01:00
Bjørn Erik Pedersen
637995ba8f Also handle inline HTML comments 2025-01-22 09:44:26 +01:00
Bjørn Erik Pedersen
f1de5d2a04 Do not warn on potentially unsafe HTML comments when unsafe=false
We will still not render these comments, so from a safety perspective this is the same, but HTML comments are very common also inside Markdown and too useful to throw away.

Updates #13278
2025-01-22 09:44:26 +01:00
W. Michael Petullo
4b0c194fb3 Fix build with Go 1.24
Go 1.24 provides stricter checking that forbids passing a variable as
a format string to Printf-family functions with no other arguments. Remove
instances of this. See also:

https://tip.golang.org/doc/go1.24#vet

Signed-off-by: W. Michael Petullo <mike@flyn.org>
2025-01-21 11:10:03 +01:00
Joe Mooring
8de4ffb294 tpl/tplimpl: Fix context in shortcode error messages
Fixes #13279
2025-01-20 16:17:55 +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
Nicolas Friedli
8897113666
tpl: Add loading attribute to qr shortcode 2025-01-17 19:06:54 +01:00
hugoreleaser
e91d3cff98 releaser: Prepare repository for 0.142.0-DEV
[ci skip]
2025-01-16 13:26:52 +00:00
hugoreleaser
e7bd51698e releaser: Bump versions for release of 0.141.0
[ci skip]
2025-01-16 13:11:18 +00:00
Bjørn Erik Pedersen
1fad3832a9 tpl/tplimpl: Simplify some test assertions 2025-01-16 11:29:24 +01:00
Jack Baldry
8b52626915
common/paths: Fix docstring 2025-01-16 10:58:18 +01:00
Bjørn Erik Pedersen
5c5508817f
Merge commit '81a7b6390036138356773c87a886679c81c524e1' 2025-01-16 10:35:07 +01:00
Bjørn Erik Pedersen
81a7b63900 Squashed 'docs/' changes from f0f4bcb24..4429eeeea
4429eeeea Update image render hooks examples to conform with Commonmark
5391dddea Add class attribute to heading render hook examples

git-subtree-dir: docs
git-subtree-split: 4429eeeea84bfa4b9e636deaab5c9620ccf776a6
2025-01-16 10:35:07 +01:00
Bjørn Erik Pedersen
88ecc3b753
docs: Regen CLI docs 2025-01-16 10:34:52 +01:00
Joe Mooring
1191467c05 tpl/tplimpl: Deprecate twitter shortcode in favor of x shortcode
Closes #13214
2025-01-16 10:33:34 +01:00
Bjørn Erik Pedersen
60c24fc5ee
commands: Fix spelling in comment 2025-01-15 22:31:52 +01:00
Bjørn Erik Pedersen
41137077bc
commands: Set up the glboal logger early
Fixes #13265
2025-01-15 22:31:08 +01:00
Bjørn Erik Pedersen
5bb1564575 commands: Add --printZero to the config command
Will include zero config values (e.g. "", 0, false) in the output and will be more verbose, but useful if you cant to discover all available config options.
2025-01-15 22:48:14 +02:00
Bjørn Erik Pedersen
76993369a0 For render hooks, only fallback to HTML (or the defaultOutputFormat) template
Closes #13242
2025-01-15 19:59:58 +02:00
Bjørn Erik Pedersen
de7137cc35 tpl/collections: Use MapRange/SetIterKey/SetIterValue for Where, Sort and Merge
Some relevant benchmarks:

Where with maps:

```
cpu: Apple M1 Pro
            │ master.bench │         fix-mapkeys.bench          │
            │    sec/op    │   sec/op     vs base               │
WhereMap-10    79.26µ ± 1%   26.58µ ± 1%  -66.46% (p=0.002 n=6)

            │ master.bench │         fix-mapkeys.bench         │
            │     B/op     │    B/op     vs base               │
WhereMap-10   56685.0 ± 0%   111.0 ± 1%  -99.80% (p=0.002 n=6)

            │ master.bench  │         fix-mapkeys.bench         │
            │   allocs/op   │ allocs/op   vs base               │
WhereMap-10   2003.000 ± 0%   4.000 ± 0%  -99.80% (p=0.002 n=6)
```

Merge:

```
         │ master.bench │         fix-mapkeys.bench          │
         │    sec/op    │   sec/op     vs base               │
Merge-10    3.285µ ± 0%   2.268µ ± 1%  -30.96% (p=0.002 n=6)

         │ master.bench │          fix-mapkeys.bench          │
         │     B/op     │     B/op      vs base               │
Merge-10   3.079Ki ± 0%   1.891Ki ± 0%  -38.58% (p=0.002 n=6)

         │ master.bench │         fix-mapkeys.bench         │
         │  allocs/op   │ allocs/op   vs base               │
Merge-10     64.00 ± 0%   26.00 ± 0%  -59.38% (p=0.002 n=6)
```
Sort:

```
cpu: Apple M1 Pro
           │ master.bench │         fix-mapkeys.bench         │
           │    sec/op    │   sec/op     vs base              │
SortMap-10   1008.0n ± 1%   915.5n ± 0%  -9.18% (p=0.002 n=6)

           │ master.bench │         fix-mapkeys.bench         │
           │     B/op     │    B/op     vs base               │
SortMap-10     640.0 ± 0%   512.0 ± 0%  -20.00% (p=0.002 n=6)

           │ master.bench │        fix-mapkeys.bench         │
           │  allocs/op   │ allocs/op   vs base              │
SortMap-10     16.00 ± 0%   15.00 ± 0%  -6.25% (p=0.002 n=6)
```
2025-01-13 16:24:48 +02:00
Bjørn Erik Pedersen
a2edf04c27 deps: Upgrade github.com/gohugoio/hashstructure from 0.1.0 to 0.3.0
Faster hashing of maps:

```
           │ stash.bench  │      deps-hashstructv030.bench      │
           │    sec/op    │    sec/op     vs base               │
HashMap-10   198.9µ ± ∞ ¹   142.6µ ± ∞ ¹  -28.31% (p=0.029 n=4)
¹ need >= 6 samples for confidence interval at level 0.95

           │  stash.bench  │      deps-hashstructv030.bench       │
           │     B/op      │     B/op       vs base               │
HashMap-10   92.38Ki ± ∞ ¹   37.14Ki ± ∞ ¹  -59.80% (p=0.029 n=4)
¹ need >= 6 samples for confidence interval at level 0.95

           │ stash.bench  │      deps-hashstructv030.bench      │
           │  allocs/op   │  allocs/op    vs base               │
HashMap-10   6.747k ± ∞ ¹   4.748k ± ∞ ¹  -29.63% (p=0.029 n=4)
```
2025-01-13 16:22:24 +02:00
Bjørn Erik Pedersen
956f915f77
tpl/collections: Add BenchmarkWhereMap 2025-01-13 12:57:48 +02:00
Bjørn Erik Pedersen
a2a4166f6d
tpl/collections: Add BenchmarkSortMap 2025-01-13 10:38:12 +02:00
Bjørn Erik Pedersen
39f582f9f4
tpl/collections: Add Merge benchmark 2025-01-13 10:32:41 +02: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
Joe Mooring
8af04745fb tpl/tplimpl: Use plain text for image render hook alt attribute
Co-authored-by: Heracles <email@heracl.es>
2025-01-10 19:44:39 +02:00
Bjørn Erik Pedersen
dde9d9d544 Adjust error handling in ToMath vs try (note)
Closes #13239
2025-01-09 11:47:19 +01: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
c5a63a3b4f Fix branch resource overlapping bundle path
Fixes #13228
2025-01-09 08:00:30 +01:00
Bjørn Erik Pedersen
61d3d20129 templates: Fix handling of multiple defers in the same template
Fixes #13236
2025-01-09 07:59:25 +01:00
Joe Mooring
b13d0a68e6 tpl/images: Change signature of images.QR to images.QR TEXT OPTIONS
Closes #13230
2025-01-08 19:59:39 +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
cfa0801815 Fix NPX issue with TailwindCSS v4
This allows the `tailwindcss` CLI binary to live in the `PATH` for NPM-less projects.

Fixes #13221
2025-01-07 13:12:08 +01:00
dependabot[bot]
f024a5050e build(deps): bump golang.org/x/tools from 0.28.0 to 0.29.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.28.0 to 0.29.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-07 10:46:27 +01:00
dependabot[bot]
80704bc9a1 build(deps): bump golang.org/x/net from 0.33.0 to 0.34.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.34.0.
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.34.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-07 10:46:04 +01:00
Joe Mooring
3682027a51
snap: Always package latest stable version of Go 2025-01-06 12:50:40 -08:00
Bjørn Erik Pedersen
44628616af
docs: Regen CLI docs 2025-01-06 18:12:20 +01:00
Bjørn Erik Pedersen
0fc86783ee
Merge commit 'e9fbadacc3f09191e2e19f112a49777eeb8df06c' 2025-01-06 18:11:07 +01:00
Bjørn Erik Pedersen
e9fbadacc3 Squashed 'docs/' changes from 8390a4a3a..f0f4bcb24
f0f4bcb24 Update Batch.md
15a8b1de6 Update Batch.md
eb841ce66 Update theme
751097f24 Use CI_PAGES_URL in GitLab Pages workflow
8584a0581 Fix typos
b030a7149 Update configuration.md
f7ec2ee9c Revert "Update shortcode.md"
f8188f1c8 Update shortcode.md
083fc39c6 Update shortcode.md
d4bdfb96b Update Filter.md
ef00649db Document wrapperClass highlighting option
e227dc422 Hugo 0.140.2
b95d28444 Fix description of the the hugo server command
41ca381b0 Fix documentation of Fragments
73a6cd966 Update theme
2573fd120 netlify: Hugo 0.140.1
90b19ec0d Merge branch 'tempv0.140.1'
ad2e9aeec Update gocloud and docs for S3-Compatible Endpoints
34b30bad2 Remove indentation from include shortcode examples
97b4ef544 Update related.md
7234e0189 Update related.md
32cc191f6 Clarify Name and Title menu entry methods
bce733c63 Update theme
2f1843d10 Use .Page.GetPage in examples of an include shortcode
9e1c85bbd Revert "Document PAGE.String"
bb30e7c08 Document PAGE.String
2d151d77f Fix link
fbe2d442f Miscellaneous updates for v0.140.0
4d3195223 Update JS docs vs Hugo v0.140
8c190aabc netlify: Hugo 0.140.0
826005ffe Merge branch 'tempv0.140.0'
107289a2c Update theme (again)
9884425f9 Update theme
ff0a358d3 Update Go tool version in hugo.work
c9b23cf6d tpl/tplimpl: Update details shortcode
f29f19aff tpl/tplimpl: Add details shortcode

git-subtree-dir: docs
git-subtree-split: f0f4bcb243776d0552396d12758bd38cda779b62
2025-01-06 18:09:20 +01:00
Bjørn Erik Pedersen
2a7bb1c7c9 create: Respect --noBuildLock in hugo new 2025-01-06 17:59:24 +01:00
dependabot[bot]
b7b49fb0f8 build(deps): bump github.com/evanw/esbuild from 0.24.0 to 0.24.2
Bumps [github.com/evanw/esbuild](https://github.com/evanw/esbuild) from 0.24.0 to 0.24.2.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.24.0...v0.24.2)

---
updated-dependencies:
- dependency-name: github.com/evanw/esbuild
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-06 15:07:05 +01:00
Bjørn Erik Pedersen
5f2adad2c7 tpl/images: Format the QR hashes as hex
Slightly shorter, and it looks more like a ... hash.
2025-01-06 15:05:03 +01:00
dependabot[bot]
a837976731 build(deps): bump github.com/alecthomas/chroma/v2 from 2.14.0 to 2.15.0
Bumps [github.com/alecthomas/chroma/v2](https://github.com/alecthomas/chroma) from 2.14.0 to 2.15.0.
- [Release notes](https://github.com/alecthomas/chroma/releases)
- [Changelog](https://github.com/alecthomas/chroma/blob/master/.goreleaser.yml)
- [Commits](https://github.com/alecthomas/chroma/compare/v2.14.0...v2.15.0)

---
updated-dependencies:
- dependency-name: github.com/alecthomas/chroma/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-06 13:38:55 +01:00