发布日期: 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/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 架构上 AtanTan 的精度问题 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:

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]

下载链接