发布日期: 2025-10-15
版本号: v0.151.1

此次更新主要基于上游安全修复,包括将Go从1.25.1升级到1.25.3以包含10个安全修复,以及Go的net/html包的一个安全补丁;作者检查后认为这些修复对Hugo无直接影响,但为保持安全报告的完整性进行了更新。此外,修复了字符串截断的CJK处理和页面解析器重复短代码错误处理等bug,进行了模板包裹、Goldmark对齐、内存优化等多项改进,并升级了多个依赖包。

更新内容 (中文)

此版本主要基于一些上游安全修复:

我(@bep)已检查上述问题,它们似乎与 Hugo 无直接关联,但我们理解许多用户希望获得一份清晰的安全报告。

修复

  • 模板:修复 strings/truncate 对 CJK 字符的处理 88aea5668 @oishikazuo #14039
  • 解析器/pageparser:修复短代码重复时的闭合错误处理 a133393ed @bep

改进

  • 升级 Go 至 1.25.3 e2fb0b0e8 @bep
  • create/skeletons:用 section 标签包裹 section 和 home 列表 29cf87444 @imomaliev
  • 标记/goldmark:对齐引用块默认输出与 Goldmark 的行为 1b4dd436d @jmooring #14046
  • 解析器/pageparser:将短代码名称存储为 unique.Handle[string] 以减少内存分配 4414ef73f @bep
  • testscripts:放宽测试断言条件 9197debbf @bep

依赖更新

  • build(deps): bump github.com/gohugoio/hashstructure from 0.5.0 to 0.6.0 f4c11571b @dependabot[bot]
  • build(deps): bump golang.org/x/image from 0.30.0 to 0.32.0 54075acc2 @dependabot[bot]
  • build(deps): bump github.com/evanw/esbuild from 0.25.10 to 0.25.11 8b52303e3 @dependabot[bot]
  • build(deps): bump golang.org/x/tools from 0.37.0 to 0.38.0 3d45d30a4 @dependabot[bot]
  • build(deps): bump golang.org/x/mod from 0.28.0 to 0.29.0 095157cd6 @dependabot[bot]

更新内容 (原始)

This release is mostly motivated by some upstream security fixes:

I, @bep, have inspected the above issues, and none of them seem to be relevant for Hugo, but we understand that many want to have a clean security report.

Bug fixes

  • tpl: Fix strings/truncate CJK handling 88aea5668 @oishikazuo #14039
  • parser/pagerparser: Fix closing shortcode error handling when repeated a133393ed @bep

Improvements

  • Upgrade Go to 1.25.3 e2fb0b0e8 @bep
  • create/skeletons: Wrap section and home lists with section tags 29cf87444 @imomaliev
  • markup/goldmark: Align blockquote default output with Goldmark 1b4dd436d @jmooring #14046
  • parser/pageparser: Store shortcode names as unique.Handle[string] to save memory allocations 4414ef73f @bep
  • testscripts: Make test assertion less specific 9197debbf @bep

Dependency Updates

  • build(deps): bump github.com/gohugoio/hashstructure from 0.5.0 to 0.6.0 f4c11571b @dependabot[bot]
  • build(deps): bump golang.org/x/image from 0.30.0 to 0.32.0 54075acc2 @dependabot[bot]
  • build(deps): bump github.com/evanw/esbuild from 0.25.10 to 0.25.11 8b52303e3 @dependabot[bot]
  • build(deps): bump golang.org/x/tools from 0.37.0 to 0.38.0 3d45d30a4 @dependabot[bot]
  • build(deps): bump golang.org/x/mod from 0.28.0 to 0.29.0 095157cd6 @dependabot[bot]

下载链接