hugo v0.163.0 版本更新介绍
发布日期: 2026-06-08
版本号: v0.163.0
本次发布主要改进了 AVIF 图像处理功能。AVIF 的默认质量已从 75 调整为 60,因为这与 JPEG/WebP 在质量 75 时的效果相当。同时,现在可以按图像格式(甚至按单张处理后的图像)设置质量。此外,为 AVIF 添加了与 WebP 类似的提示功能,可根据内容类型(如照片或文字)自动选择色度子采样方案,有效降低了编码内存占用。其他改进包括:弃用了一些旧设置(如全局图像质量设置、
baseUrl),新增了按格式设置 AVIF 提示、强制 AVIF 缓存失效、为 AVIF 损失质量设置上限(99)等功能;修复了页面切换时 WebSocket 断开连接、WASM 图像处理器内存错误恢复等问题;更新了部分依赖库。
更新内容 (中文)
本版本的主要内容是对我们在 v0.162.0 中引入的 AVIF 图像处理功能的改进。详见文档,但需注意:
- 我们已将 AVIF 的默认
质量降至 60。事实证明,质量为 75 的 JPEG/WebP 与质量为 60 的 AVIF 效果相当。您现在还可以在项目配置中为每种图像格式设置质量(如果需要,也可以为每张处理过的图像单独设置)。 - 我们为 AVIF 添加了
hint,其值与WEBP相同。对于有损压缩,照片/图片提示(以及默认设置)将使用 YUV420 色度子采样进行编码,而非 YUV444,同时为文本/图标/绘图保留 444。这大大减少了编码这些图像所需的内存。
改进
- resources/jsconfig:移除已弃用的 baseUrl 设置 ff2903a9 @bep #14991 #14996
- all:针对已弃用的 link 和 image 渲染钩子设置调整测试 ca68936d @jmooring
- all:运行 go fix ./… 781fabf4 @bep
- pagesfromdata:为内容适配器模板指标使用相对路径 1d018ef8 @anupamojha-eng #14999
- ci:将 macos-latest 重新添加到测试矩阵 121bc6ce @bep
- images:弃用 Imaging.Compression 并将其移至 webp 和 avif 配置中 cf18b827 @bep #14998
- 仅支持最新版本的 Go 98ad9b3c @bep #14997
- page:添加 IsBranch 并弃用 IsNode b89e7fe6 @bep #11574
- images:强制 AVIF 目标的缓存失效 e8fefc83 @bep #14990
- images:添加每格式 AVIF hint 设置 a043d3ec @bep #14992
- images:使 AVIF 色度子采样根据提示具备内容感知能力 341f575d @bep #14987
- 将 AVIF 有损质量上限设为 99 248241b6 @bep #14981
- config:弃用全局 imaging quality 设置 4e47d95d @bep #14979
- images:将 AVIF 的默认质量设为 60 03b4b542 @bep #14979
- livereload:在 pageswap 时断开与 websocket 服务器的连接 79be0532 @bep #14983
- tpl/tplimpl/embedded:防止 sitemap 模板中的前导换行符 0f440460 @bep #14977
- images:从 WASM 图像处理器的内存分配错误中恢复 4e17421e @bep #14985
- images:添加每图像格式的质量设置 b01ecd4c @bep #14957
- misc:删除注释中重复的单词 45c00b7c @jmooring #14936 #14950 #14965
- 添加一些从 PNG 到 AVIF 的黄金测试用例 28d882ab @bep
依赖更新
- build(deps): bump github.com/bits-and-blooms/bitset 0d29fc81 @dependabot[bot]
- build(deps): bump github.com/tetratelabs/wazero bb57404f @dependabot[bot]
- build(deps): bump github.com/rogpeppe/go-internal from 1.14.1 to 1.15.0 7d1b1fb3 @dependabot[bot]
- build(deps): bump github.com/getkin/kin-openapi from 0.138.0 to 0.139.0 77a11470 @dependabot[bot]
更新内容 (原始)
The main topic in this release is improvements to the AVIF image handling that we introduced in v0.162.0. See the docs for details, but:
- We have turned down the default
qualityfor AVIF to 60. Turns out, JPEG/WebP with quality 75 is comparable to AVIF with quality 60. You can now also set quality per image format in your project config (and also per image processed if needed). - We have added a
hintto the AVIF with the same values as forWEBP. Forlossycompression, the photo/picture hints (and the default) encodes with YUV420 chroma subsampling instead of YUV444, keeping 444 for text/icon/drawing. This greatly reduces the memory needed to encode these images.
Improvements
- resources/jsconfig: Remove deprecated baseUrl setting ff2903a9 @bep #14991 #14996
- all: Adjust tests for deprecated link and image render hook settings ca68936d @jmooring
- all: Run go fix ./… 781fabf4 @bep
- pagesfromdata: Use relative path for content adapter template metrics 1d018ef8 @anupamojha-eng #14999
- ci: Re-add macos-latest to the test matrix 121bc6ce @bep
- images: Deprecate Imaging.Compression and move it down to webp and avif configs cf18b827 @bep #14998
- Only support the latest Go version 98ad9b3c @bep #14997
- page: Add IsBranch and deprecate IsNode b89e7fe6 @bep #11574
- images: Force cache invalidation for AVIF target e8fefc83 @bep #14990
- images: Add a per-format AVIF hint setting a043d3ec @bep #14992
- images: Make AVIF chroma subsampling content-aware via the hint 341f575d @bep #14987
- Cap AVIF lossy quality at 99 248241b6 @bep #14981
- config: Deprecate the glogal imaging quality setting 4e47d95d @bep #14979
- images: Make 60 the default quality for AVIF 03b4b542 @bep #14979
- livereload: Disconnect from websocket server on pageswap 79be0532 @bep #14983
- tpl/tplimpl/embedded: Prevent leading newline in sitemap template 0f440460 @bep #14977
- images: Recover from memory alloc errors in WASM image processors 4e17421e @bep #14985
- images: Add quality setting per image format b01ecd4c @bep #14957
- misc: Remove duplicate words in comments 45c00b7c @jmooring #14936 #14950 #14965
- Add some PNG to AVIF golden test cases 28d882ab @bep
Dependency Updates
- build(deps): bump github.com/bits-and-blooms/bitset 0d29fc81 @dependabot[bot]
- build(deps): bump github.com/tetratelabs/wazero bb57404f @dependabot[bot]
- build(deps): bump github.com/rogpeppe/go-internal from 1.14.1 to 1.15.0 7d1b1fb3 @dependabot[bot]
- build(deps): bump github.com/getkin/kin-openapi from 0.138.0 to 0.139.0 77a11470 @dependabot[bot]
下载链接
- hugo_0.163.0_checksums.txt
- hugo_0.163.0_darwin-universal.pkg
- hugo_0.163.0_dragonfly-amd64.tar.gz
- hugo_0.163.0_freebsd-amd64.tar.gz
- hugo_0.163.0_Linux-64bit.tar.gz
- hugo_0.163.0_linux-amd64.deb
- hugo_0.163.0_linux-amd64.tar.gz
- hugo_0.163.0_linux-arm.tar.gz
- hugo_0.163.0_linux-arm64.deb
- hugo_0.163.0_linux-arm64.tar.gz
- hugo_0.163.0_netbsd-amd64.tar.gz
- hugo_0.163.0_openbsd-amd64.tar.gz
- hugo_0.163.0_solaris-amd64.tar.gz
- hugo_0.163.0_windows-amd64.zip
- hugo_0.163.0_windows-arm64.zip
- hugo_extended_0.163.0_darwin-universal.pkg
- hugo_extended_0.163.0_Linux-64bit.tar.gz
- hugo_extended_0.163.0_linux-amd64.deb
- hugo_extended_0.163.0_linux-amd64.tar.gz
- hugo_extended_0.163.0_linux-arm64.deb
- hugo_extended_0.163.0_linux-arm64.tar.gz
- hugo_extended_0.163.0_windows-amd64.zip
- hugo_extended_withdeploy_0.163.0_darwin-universal.pkg
- hugo_extended_withdeploy_0.163.0_Linux-64bit.tar.gz
- hugo_extended_withdeploy_0.163.0_linux-amd64.deb
- hugo_extended_withdeploy_0.163.0_linux-amd64.tar.gz
- hugo_extended_withdeploy_0.163.0_linux-arm64.deb
- hugo_extended_withdeploy_0.163.0_linux-arm64.tar.gz
- hugo_extended_withdeploy_0.163.0_windows-amd64.zip
- hugo_withdeploy_0.163.0_darwin-universal.pkg
- hugo_withdeploy_0.163.0_Linux-64bit.tar.gz
- hugo_withdeploy_0.163.0_linux-amd64.deb
- hugo_withdeploy_0.163.0_linux-amd64.tar.gz
- hugo_withdeploy_0.163.0_linux-arm64.deb
- hugo_withdeploy_0.163.0_linux-arm64.tar.gz
- hugo_withdeploy_0.163.0_windows-amd64.zip