Commit Graph

9777 Commits

Author SHA1 Message Date
Bjørn Erik Pedersen 341f575d2d images: Make AVIF chroma subsampling content-aware via the hint
Encode photo/picture hints (and the default) as YUV420 instead of YUV444,
keeping 444 for text/icon/drawing. Lossless stays 444.

This roughly halves the encoder's peak memory (42 -> 27 MiB/MP) and the
output size, while 444 remains available for sharp-edged content. A
3000x3000 image now needs ~239 MiB to encode, down from ~381 MiB (which
sat right at the 384 MiB WASM cap).

Closes #14987

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 18:54:56 +02:00
Bjørn Erik Pedersen 248241b6e1 Cap AVIF lossy quality at 99
Before this commit, lossy compression with 100 quality meant lossless compression, leading to a big gap between 99 and 100.

This commit caps the lossy quality at 99, ensuring that lossy compression is always lossy.

Fixes #14981
2026-06-04 14:42:08 +02:00
Bjørn Erik Pedersen 4e47d95db9 config: Deprecate the glogal imaging quality setting
In favour of the new per-image quality setting.

See #14979
2026-06-04 11:07:34 +02:00
Bjørn Erik Pedersen 03b4b54220 images: Make 60 the default quality for AVIF
AVIF's quality scale is not perceptually comparable to JPEG/WebP:
libavif anchors its "good" default at 60, where Hugo's universal 75
produced visibly higher quality and larger files. AVIF now defaults to
60 while JPEG and WebP keep 75. An explicit imaging.quality,
imaging.avif.quality or a per-image qNN still wins.

Fixes #14979

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 11:07:34 +02:00
Bjørn Erik Pedersen 79be0532f1 livereload: Disconnect from websocket server on pageswap
Fixes #14983
2026-06-04 11:04:39 +02:00
Bjørn Erik Pedersen 0f440460c8 tpl/tplimpl/embedded: Prevent leading newline in sitemap template
Fixes #14977
2026-06-04 11:03:03 +02:00
Bjørn Erik Pedersen 4e17421ec2 images: Recover from memory alloc errors in WASM image processors
Fixes #14985
2026-06-04 11:01:49 +02:00
Bjørn Erik Pedersen b01ecd4cd4 images: Add quality setting per image format
Allow setting quality per output format via imaging.jpeg.quality,
imaging.webp.quality and imaging.avif.quality. Each falls back to the
global imaging.quality when unset, and a per-image qNN still wins.

Fixes #14957

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 20:43:55 +02:00
Joe Mooring ca68936d61 all: Adjust tests for deprecated link and image render hook settings 2026-06-01 15:52:34 +02:00
Joe Mooring 45c00b7c16 misc: Remove duplicate words in comments
Closes #14936
Closes #14950
Closes #14965
2026-05-29 17:54:14 +02:00
Bjørn Erik Pedersen 28d882ab70 Add some PNG to AVIF golden test cases
Both 8 and 24 bit PNG to AVIF with vivid colors.

The output looks good to me ...

https://discourse.gohugo.io/t/v0-162-0-avif-image-processing-strips-washes-out-colors-on-vector-graphics/57210
2026-05-29 11:28:27 +02:00
hugoreleaser b0fd7ee2e1 releaser: Prepare repository for 0.163.0-DEV
[ci skip]
2026-05-28 18:03:30 +00:00
hugoreleaser bba860e3ed releaser: Bump versions for release of 0.162.1
[ci skip]
v0.162.1
2026-05-28 17:40:44 +00:00
Joe Mooring 59f35cd985 modules/npm: Fix false stale warning after npm pack
Closes #14959

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 18:57:41 +02:00
Joe Mooring 21e9868fe2 tpl/tplimpl: Fix X shortcode test 2026-05-28 09:26:45 +02:00
Bjørn Erik Pedersen 2760288c6d tpl: Skip broken x shortcode test 2026-05-27 21:21:35 +02:00
Bjørn Erik Pedersen c270975049 Revert "tpl/collections: Make dict return nil when no values are provided"
This reverts commit 17a86ef5ed.

Closes #14958
2026-05-27 20:02:55 +02:00
Joe Mooring ea8b48af64 tpl/time: Fix locale-specific month abbreviations
Closes #14948
2026-05-27 12:38:21 +02:00
hugoreleaser 076dfe13d0 releaser: Bump versions for release of 0.162.0
[ci skip]
v0.162.0
2026-05-26 13:53:44 +00:00
Bjørn Erik Pedersen e41a06447d Disallow HTML content by default
For security reasons. Enable in security config, e.g.:

```toml
[security]
allowContent = ['.*']
```
2026-05-26 13:57:12 +02:00
Bjørn Erik Pedersen 90d9f812b2 Add image processing support for AVIF
The encode/decode is implemented in a WebAssembly module built from a
small C wrapper around libavif. Bundled libraries (statically linked,
compiled with the WASI SDK):

* libavif v1.4.1 (container + codec glue)
* libaom v3.14.1 (AV1 encoder + decoder)
* dav1d 1.5.3 (AV1 decoder)
* libyuv (Chromium pin) for color conversion
* parson for JSON message passing across the wasm boundary

HDR handling on the encoder:

* SDR images are written as BT.709 / sRGB / BT.601 (8-bit).
* 10-bit and up are written as BT.2020 primaries with PQ (SMPTE
  ST 2084) transfer and BT.2020-NCL matrix coefficients, signalled
  via CICP.
* Adobe-style SDR+gainmap inputs (e.g. Lightroom HDR exports) are
  baked into a single true-HDR image in BT.2020/PQ at 10-bit, with
  the CLLI (Content Light Level Information) box carried through so
  HDR-capable clients can tone-map correctly.

Limitations:

* Animated input (animated WebP/GIF) is collapsed to its first frame
  when re-encoded as AVIF; animated AVIF output is not yet supported.

Fixes #7837
2026-05-26 12:13:53 +02:00
Joe Mooring 80e60847fb config: Preserve intentionally empty maps
Closes #14944
2026-05-26 11:50:04 +02:00
Bjørn Erik Pedersen df5421918a hugolib: Fix Page.GitInfo for modules with go.mod in a repo subdirectory
Map content files using their path relative to the git repo root by
prepending the module's Origin.Subdir to the lookup key.

Fixes #14942
2026-05-26 00:28:22 +02:00
Bjørn Erik Pedersen aeb9a5cc02 hugolib: Merge existing hugo_stats.json when renderSegments is set
With renderSegments only a subset of pages is rendered, so the resulting
hugo_stats.json would no longer contain elements from the excluded pages,
causing tools like Tailwind to strip classes that are actually in use.

Fixes #14939
2026-05-25 17:00:52 +02:00
Bjørn Erik Pedersen c4bbc2805c all: Replace RWMutex struct caches with ConcurrentMap 2026-05-24 15:29:47 +02:00
Joe Mooring d8c70218b7 tpl/tplimpl: Consolidate and improve embedded template integration tests
Closes #14932
2026-05-24 15:29:33 +02:00
Bjørn Erik Pedersen ee4f1acd93 parser: Drop empty sub maps from hugo config output
Fixes #14855
2026-05-24 11:52:43 +02:00
Bjørn Erik Pedersen b6133657e0 markup/highlight: Allow overriding type and code via options
Treat type and code as highlighting options in both transform.Highlight
and transform.HighlightCodeBlock. The type option overrides the language
and code overrides the code, so the two functions now share the same
options handling.

transform.Highlight's LANG argument is now optional:

	transform.Highlight CODE [LANG] [OPTIONS]

Fixes #11872
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 13:12:07 +02:00
Bjørn Erik Pedersen 4bc7caea14 Fix typo in CONTRIBUTING.md 2026-05-23 12:47:00 +02:00
Bjørn Erik Pedersen 7711ba4d0c Remove note on refactoring contributions
Removed note about holding off on big refactoring.
2026-05-23 11:55:27 +02:00
Bjørn Erik Pedersen d2c821b5c7 Update AI assistance disclosure requirements
Clarify expectations for AI contributions and manual verification in pull requests.
2026-05-23 11:54:57 +02:00
dependabot[bot] 4f444c810c build(deps): bump golang.org/x/net from 0.54.0 to 0.55.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.54.0 to 0.55.0.
- [Commits](https://github.com/golang/net/compare/v0.54.0...v0.55.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-23 11:43:45 +02:00
dependabot[bot] fe6c72652f build(deps): bump golang.org/x/image from 0.40.0 to 0.41.0
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.40.0 to 0.41.0.
- [Commits](https://github.com/golang/image/compare/v0.40.0...v0.41.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-23 11:43:06 +02:00
Bjørn Erik Pedersen 4ed7600fd6 hugolib: Use AllTranslated in IsTranslated
Which makes it faster:

```
                           │ benchcmp.bench │   feat-speedupistranslated.bench    │
                           │     sec/op     │    sec/op     vs base               │
IsTranslatedOneLanguage-10     996.2n ± ∞ ¹   685.6n ± ∞ ¹  -31.18% (p=0.029 n=4)
¹ need >= 6 samples for confidence interval at level 0.95

                           │ benchcmp.bench │   feat-speedupistranslated.bench   │
                           │      B/op      │    B/op      vs base               │
IsTranslatedOneLanguage-10      832.0 ± ∞ ¹   536.0 ± ∞ ¹  -35.58% (p=0.029 n=4)
¹ need >= 6 samples for confidence interval at level 0.95

                           │ benchcmp.bench │   feat-speedupistranslated.bench   │
                           │   allocs/op    │  allocs/op   vs base               │
IsTranslatedOneLanguage-10      18.00 ± ∞ ¹   13.00 ± ∞ ¹  -27.78% (p=0.029 n=4)
¹ need >= 6 samples for confidence interval at level 0.95
````
2026-05-22 14:11:50 +02:00
Bjørn Erik Pedersen cbe4339a5f tpl: Simplify sitemap template
The benefit of my performance motivated construct in 6475d308ec was most likely minimal and not worth the loss of clarity.

See #14912
2026-05-21 21:36:43 +02:00
Bjørn Erik Pedersen 6475d308ec tpl: Use AllTranslations in sitemap template
Closes #14912
Closes #14917
2026-05-21 19:44:23 +02:00
Bjørn Erik Pedersen 67aede4364 tpl/collections: Make dict return nil when no values are provided 2026-05-21 16:03:02 +02:00
Bjørn Erik Pedersen 87f194b249 Sync Go template package to 1.26.3
See #14897
2026-05-21 14:28:31 +02:00
Bjørn Erik Pedersen 5f01b0603d Merge commit 'c23d97904fd31ef745bece57133aa1b9275ec20c' 2026-05-21 12:22:49 +02:00
Bjørn Erik Pedersen c23d97904f Squashed 'docs/' changes from 0755fb534d..1f8ddb8a52
1f8ddb8a52 content: clarify resources front matter key descriptions
e064ab8528 content: Add deprecation badges to module config page
727ca5563a github: Add push trigger to lint workflow
64dd5c9886 content: Fix typo
c5bc6b6515 github: Fix lint workflow
faec0c3a0a github: Combine linting actions into a single workflow
06112aeaf2 theme: Miscellaneous template edits
75d4902270 theme: Format templates with gotmplfmt
fec2e2a67e content: Document that the language code in a file name must be lowercase
9dbd841ba6 content: Document the src attribute in the Page Resources metadata reference
fd3ffef985 content: Fix "build from source" instructions for Windows
af4c9cd4d7 content: Miscellaneous edits
408d8b2f0a content: Miscellaneous edits
e8804afe6e content: Fix typo
d98276be30 content: Updates for v0.161.0
01b1f8fa12 content: Note merge limitation for slice configuration values
d2b18f0c8d content: Document page matcher usage for cascading values
45e5bd9ab3 content: Update Cloudflare Worker host/deploy guide
b83726b89a content: Document fallback rendering for fenced code blocks
8f1eeb42bc content: Update reference for source code shortcode
e8da56303b content: Add gotmplfmt to list of VS Code extensions
950fabbfd6 content: Update FAQ on feature availability error
6411146d24 content: Update quick start guide
38cc39fd51 content: Add Hugo Shortcodes to list of VS Code extensions
72d98b107b content: Misc updates to get validators to pass
9fb0e1ca35 Add a paragraph about sec boundaries
e6abf5644f content: Improve syntax highlighting documentation
c06193bd1a content: Update go-i18n package reference
ce58fef945 Hugo 0.161.1
c7e0f63385 content: Fix package references
7f15fb3bf9 data: Regen docshelper
7483d53b55 Update HUGO_VERSION to 0.161.0
c4abcdb45f security: Add a bullet point about "pragmatic defaults"
3cd7492862 content: Improve explanation of mount removal in module configurations
4099f07bb9 content: Update GitHub Pages workflow example
a6c9853a58 content: Fix typo
e6f79a938b Update netlify.toml
abda3d6659 content: Update Action versions in GitHub Pages workflow example
55dd288fa9 content: Add GitCMS to front-ends tools list
21081f6d49 content: Remove outdated new-in badges
b2ec263884 content: Update version references
825e0b8ea9 One more CSS var adjustment
85f95a899b Adjust css.Build var docs a little
df48288002 content: Updates for v0.160.0
a82a9b9797 Update HUGO_VERSION to 0.160.0
1155747dc4 content: Improve CSS processing feature description
f6ce893974 content: Add css.Build to features
67b8ed1198 content: Fix typos
0f62a67863 content: Fix typo
dbb42aed4a content: Document the deploy edition
549f30f933 content: De-emphasize references to the extended edition
8f5c9782d4 content: Add Pages CMS to front-ends documentation
b2bfc3af48 Update HUGO_VERSION to 0.159.2
3793156fc5 content: Fix typos
bacd4824ef content: Specify function namespace in example
7f2dc0d40a Regen docs.yml
65a851f731 Update HUGO_VERSION to 0.159.1
ce05fe3fc0 content: Adjust variable references in build script examples
8a04f9fe64 content: Improve hosting build script examples
67962ce05c content: Link to Codeberg Pages 404 handling
fd248f57ed content: Identify esbuild as the foundation for build functions
62f02879fd content: Remove outdated content
553c407f9e content: Miscellaneous corrections
77e2cad088 content: Add new-in badge for usePackageJSON
0746e1e621 Add a page on using npm dependencies in Hugo Modules
8824850f5c Update HUGO_VERSION to 0.159.0

git-subtree-dir: docs
git-subtree-split: 1f8ddb8a5230518f07c50b4b03cba3cae21081c4
2026-05-21 12:22:48 +02:00
Joe Mooring 5d51b82a7e resources: Fix the :counter placeholder
Closes #14921

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:45:11 +02:00
Bjørn Erik Pedersen d81e3c29c0 Upgrade to Go 1.26.3
Fixes #14897
2026-05-20 11:00:30 +02:00
Bjørn Erik Pedersen 7c65a4dbc0 ci: Check embedded template formatting with gotmplfmt 2026-05-19 16:50:25 +02:00
Bjørn Erik Pedersen d31a9275c6 tpl: Run gotmplfmt -w . 2026-05-19 16:15:45 +02:00
dependabot[bot] 6a2a03806d build(deps): bump github.com/getkin/kin-openapi from 0.137.0 to 0.138.0
Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.137.0 to 0.138.0.
- [Release notes](https://github.com/getkin/kin-openapi/releases)
- [Commits](https://github.com/getkin/kin-openapi/compare/v0.137.0...v0.138.0)

---
updated-dependencies:
- dependency-name: github.com/getkin/kin-openapi
  dependency-version: 0.138.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-19 12:34:07 +02:00
dependabot[bot] cf1de598d9 build(deps): bump github.com/JohannesKaufmann/html-to-markdown/v2
Bumps [github.com/JohannesKaufmann/html-to-markdown/v2](https://github.com/JohannesKaufmann/html-to-markdown) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/JohannesKaufmann/html-to-markdown/releases)
- [Commits](https://github.com/JohannesKaufmann/html-to-markdown/compare/v2.5.0...v2.5.1)

---
updated-dependencies:
- dependency-name: github.com/JohannesKaufmann/html-to-markdown/v2
  dependency-version: 2.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-19 12:25:06 +02:00
Joe Mooring c36608c584 markup/goldmark/codeblocks: Always split Chroma options into .Options
Closes #14909
2026-05-19 12:23:42 +02:00
Joe Mooring 1e4037cade docs: Update docs.yaml 2026-05-18 21:24:35 -07:00
Alexandre Vaz 2f361a8e25 hugolib: Allow empty params front matter
Treat an empty front matter params key as an empty params map instead of failing while decoding page metadata.

Fixes #14886
2026-05-17 19:59:44 +02:00
Joe Mooring 81d77620c6 commands: Fix import from Jekyll
- Look for _config.yml, _config.yaml, or _config.toml
- Fix theme submodule URL
- Fix config filename in the instructions
- Add tests

Closes #14795
Closes #14906
2026-05-17 10:46:40 +02:00