hugo v0.151.0 版本更新介绍
发布日期: 2025-10-02
版本号: v0.151.0
Hugo v0.151.0版本引入了多项重要更新,包括新增
transform.HTMLToMarkdown模板函数以方便生成适合大模型阅读的内容,构建时可通过OSC 9;4协议向支持该特性的终端(如Ghostty和Windows Terminal)报告构建进度,同时增加了若干针对Markdown脚注的配置选项。此外,本次更新修复了远程资源缓存404响应等问题,增强了Goldmark脚注扩展的功能(如反向链接HTML选项和自动前缀选项),优化了终端进度报告的显示精度,并更新了多项依赖库。
更新内容 (中文)
Hugo v0.151.0 版本的一些值得注意的新功能:
- 新增 transform.HTMLToMarkdown 模板函数。一个可能的使用场景是为 LLM 提供友好内容。
- Hugo 在构建时现在会报告 OSC 9;4 进度;诸如 macOS 和 Linux 上的 Ghostty 以及 Windows 终端等终端支持进度条/指示器。
- 新增了几个用于 Markdown 脚注的 配置选项。
注意
- transform/livereloadinject:如果未找到标签,则跳过 livereload.js 注入(注意)7fd6762c1 @AndrewChubatiuk
改进与错误修复
- 修复
resources.GetRemote中 404 响应的文件缓存问题 03b33ecb5 @bep #14019 - markup/goldmark:为脚注扩展增加 backlinkHTML 选项 b462980ac @jmooring #11434
- markup/goldmark:为脚注扩展增加自动前缀选项 47678d8cb @jmooring #8045
- 稍微调整了终端进度报告器 510d98b77 @bep
- 添加 transform.HTMLToMarkdown c5dca3bde @bep #13946
- 构建时报告 OSC 9;4 进度 ec463c097 @bep
- tpl:解决 s390x 架构上
Atan和Tan的精度问题 105d3bc32 @toddy15 - cache/httpcache:添加 respectCacheControlNoStoreInResponse 和 respectCacheControlNoStoreInRequest 选项 3e46ba5ce @bep #13990
- common/hreflect:加速 IsTrutfulValue 函数 4d1303512 @bep
依赖更新
- build(deps): 升级 google.golang.org/api 从 0.248.0 到 0.251.0 584f052f3 @dependabot[bot]
- build(deps): 升级 github.com/aws/aws-sdk-go-v2/service/cloudfront b76d71761 @dependabot[bot]
- build(deps): 升级 github.com/aws/aws-sdk-go-v2 从 1.38.1 到 1.39.2 4d2743e4c @dependabot[bot]
- build(deps): 升级 golang.org/x/tools 从 0.36.0 到 0.37.0 c20f70d9a @dependabot[bot]
- build(deps): 升级 github.com/spf13/afero 从 1.14.0 到 1.15.0 1b556216a @dependabot[bot]
- build(deps): 升级 github.com/tdewolff/minify/v2 从 2.24.2 到 2.24.3 106c8e6de @dependabot[bot]
- build(deps): 升级 github.com/evanw/esbuild 从 0.25.9 到 0.25.10 9928122eb @dependabot[bot]
- build(deps): 升级 golang.org/x/text 从 0.28.0 到 0.29.0 9943c1bef @dependabot[bot]
- build(deps): 升级 github.com/olekukonko/tablewriter 从 1.0.9 到 1.1.0 766757310 @dependabot[bot]
- build(deps): 升级 github.com/spf13/cast 从 1.9.2 到 1.10.0 d71c07cf3 @dependabot[bot]
更新内容 (原始)
Some notable new features in Hugo v0.151.0 are:
- New transform.HTMLToMarkdown template function. One possible use case would be to provide LLM friendly content.
- Hugo now reports OSC 9;4 progress when building; progress bars/indicators are supported by terminals such as Ghostty on Macos and Linux, Windows terminal.
- Several new config options for Markdown foot notes.
Note
- transform/livereloadinject: Skip livereload.js injection if no tags found (note) 7fd6762c1 @AndrewChubatiuk
Improvements and bug fixes
- Fix file caching for 404 responses in resources.GetRemote 03b33ecb5 @bep #14019
- markup/goldmark: Enhance footnote extension with backlinkHTML option b462980ac @jmooring #11434
- markup/goldmark: Enhance footnote extension with auto-prefixing option 47678d8cb @jmooring #8045
- Adjust the terminal progress reporter a little 510d98b77 @bep
- Add transform.HTMLToMarkdown c5dca3bde @bep #13946
- Report OSC 9;4 progress when building ec463c097 @bep
- tpl: Workaround s390x precision of Atan and Tan 105d3bc32 @toddy15
- cache/httpcache: Add respectCacheControlNoStoreInResponse and respectCacheControlNoStoreInRequest options 3e46ba5ce @bep #13990
- common/hreflect: Speed up IsTrutfulValue 4d1303512 @bep
Dependency Updates
- build(deps): bump google.golang.org/api from 0.248.0 to 0.251.0 584f052f3 @dependabot[bot]
- build(deps): bump github.com/aws/aws-sdk-go-v2/service/cloudfront b76d71761 @dependabot[bot]
- build(deps): bump github.com/aws/aws-sdk-go-v2 from 1.38.1 to 1.39.2 4d2743e4c @dependabot[bot]
- build(deps): bump golang.org/x/tools from 0.36.0 to 0.37.0 c20f70d9a @dependabot[bot]
- build(deps): bump github.com/spf13/afero from 1.14.0 to 1.15.0 1b556216a @dependabot[bot]
- build(deps): bump github.com/tdewolff/minify/v2 from 2.24.2 to 2.24.3 106c8e6de @dependabot[bot]
- build(deps): bump github.com/evanw/esbuild from 0.25.9 to 0.25.10 9928122eb @dependabot[bot]
- build(deps): bump golang.org/x/text from 0.28.0 to 0.29.0 9943c1bef @dependabot[bot]
- build(deps): bump github.com/olekukonko/tablewriter from 1.0.9 to 1.1.0 766757310 @dependabot[bot]
- build(deps): bump github.com/spf13/cast from 1.9.2 to 1.10.0 d71c07cf3 @dependabot[bot]
下载链接
- hugo_0.151.0_checksums.txt
- hugo_0.151.0_darwin-universal.tar.gz
- hugo_0.151.0_dragonfly-amd64.tar.gz
- hugo_0.151.0_freebsd-amd64.tar.gz
- hugo_0.151.0_Linux-64bit.tar.gz
- hugo_0.151.0_linux-amd64.deb
- hugo_0.151.0_linux-amd64.tar.gz
- hugo_0.151.0_linux-arm.tar.gz
- hugo_0.151.0_linux-arm64.deb
- hugo_0.151.0_linux-arm64.tar.gz
- hugo_0.151.0_netbsd-amd64.tar.gz
- hugo_0.151.0_openbsd-amd64.tar.gz
- hugo_0.151.0_solaris-amd64.tar.gz
- hugo_0.151.0_windows-amd64.zip
- hugo_0.151.0_windows-arm64.zip
- hugo_extended_0.151.0_darwin-universal.tar.gz
- hugo_extended_0.151.0_Linux-64bit.tar.gz
- hugo_extended_0.151.0_linux-amd64.deb
- hugo_extended_0.151.0_linux-amd64.tar.gz
- hugo_extended_0.151.0_linux-arm64.deb
- hugo_extended_0.151.0_linux-arm64.tar.gz
- hugo_extended_0.151.0_windows-amd64.zip
- hugo_extended_withdeploy_0.151.0_darwin-universal.tar.gz
- hugo_extended_withdeploy_0.151.0_Linux-64bit.tar.gz
- hugo_extended_withdeploy_0.151.0_linux-amd64.deb
- hugo_extended_withdeploy_0.151.0_linux-amd64.tar.gz
- hugo_extended_withdeploy_0.151.0_linux-arm64.deb
- hugo_extended_withdeploy_0.151.0_linux-arm64.tar.gz
- hugo_extended_withdeploy_0.151.0_windows-amd64.zip