发布日期: 2024-11-18
版本号: v0.139.0

本次Hugo版本更新主要聚焦于移除长期弃用的代码,这些代码在过去至少6个次要版本中已被标记为构建错误并导致构建失败。同时进行了全面的依赖项更新,并引入多项新功能与优化。主要更新内容包括:新增hugo server -O命令支持启动后自动打开浏览器,移除DartSass v1协议支持,修复了渲染短代码、错误信息显示等多项问题,新增静默弃用警告选项、站点存储功能等改进。依赖项方面升级了AWS SDK、Goldmark、图像处理库等20余项核心组件。此外还涉及文档更新、构建系统优化以及ARM64架构的Linux部署支持。该版本属于破坏性更新,开发者需注意检查已弃用功能的兼容性问题。

更新内容 (中文)

此版本主要移除了长期弃用的代码。这些代码在构建日志中显示为ERROR并导致构建失败至少最近的6个小版本(多数情况时间更长)。

但这也是一次完整的依赖项更新,并包含一些新功能。例如,我们在hugo server中添加了-O标志,用于启动后在浏览器中打开站点。这是我(@bep)当前使用的快捷启动命令:

function h() {
  hugo server  -F -O -N -D
}

注意事项

  • dartsass:移除对协议/二进制文件v1版本的支持 (note) 1fd845eee @bep
  • 移除<=v0.122.0版本的弃用项 (note) ad43d137d @bep

错误修复

  • dartsass:修复错误信息 8d92042ab @bep #13065
  • 修复.RenderShortcodes的额外换行/段落问题 d4de780ed @bep #13051
  • markup/goldmark:修正错误信息中的拼写错误 e79ee0d51 @deining

改进

  • 确保term始终被设置 e917401c7 @bep #13063
  • dartsass:添加silenceDeprecations选项 3b6eaf9b1 @bep #13045
  • 运行go mod tidy 5e3133a7d @bep
  • commands:为server添加-O浏览器自动打开标志 ac6962d28 @bep #13040
  • 保留输入类型 23d21b0d1 @KN4CK3R
  • server:从浏览器错误日志中去除ANSI转义码 ce9cf882a @bep #13037
  • parser/metadecoders:添加基准测试 8aba6dc66 @bep
  • 添加site.Store和hugo.Store及Shortcode.Store a7df536a5 @bep #13021
  • markup/goldmark:优化原始HTML省略警告 2b97a2a8b @jmooring #13023

依赖更新

  • build(deps): bump github.com/aws/aws-sdk-go-v2/service/cloudfront eb298144b @dependabot[bot]
  • build(deps): bump google.golang.org/api from 0.191.0 to 0.206.0 61e2ce2a4 @dependabot[bot]
  • build(deps): bump github.com/aws/aws-sdk-go-v2 from 1.30.3 to 1.32.4 2d503f82a @dependabot[bot]
  • build(deps): bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0 3a6b2e6b1 @dependabot[bot]
  • deps: Upgrade github.com/bep/imagemeta v0.8.1 => v0.8.3 6bde8abaa @bep
  • build(deps): bump golang.org/x/tools from 0.26.0 to 0.27.0 2c54c3298 @dependabot[bot]
  • build(deps): bump github.com/tdewolff/minify/v2 from 2.20.37 to 2.21.1 7a2f04ee8 @dependabot[bot]
  • build(deps): bump github.com/fatih/color from 1.17.0 to 1.18.0 7921777da @dependabot[bot]
  • build(deps): bump golang.org/x/image from 0.21.0 to 0.22.0 33e964d40 @dependabot[bot]
  • deps: Upgrade github.com/yuin/goldmark v1.7.4 => v1.7.8 588c9019c @bep #12958
  • build(deps): bump golang.org/x/sync from 0.8.0 to 0.9.0 46e17053c @dependabot[bot]
  • build(deps): bump github.com/hairyhenderson/go-codeowners cb6580d00 @dependabot[bot]

文档

  • docs:重新生成CLI文档 66dd6ecab @bep
  • docs:更新CLI文档 58a3c91a7 @bep

构建配置

  • release:为Linux arm64添加缺失的withdeploy存档 f7fc6ccd5 @bep #13029

更新内容 (原始)

This release is mostly about removing code that has been deprecated for a long time. This has been shown as an ERROR in the build log and failed the build for at least the last 6 minor Hugo versions, in most cases much longer.

But this is also a full dependency refresh, and there are also some new stuff. For one, we added a -O flag to hugo server to open up the site in your browser after start. This is now my (@bep) shortcut to start the server:

function h() {
  hugo server  -F -O -N -D
}

Note

  • dartsass: Remove support for v1 of the protocol/binary (note) 1fd845eee @bep
  • Remove deprecations <= v0.122.0 (note) ad43d137d @bep

Bug fixes

  • dartsass: Fix error message 8d92042ab @bep #13065
  • Fix extra newline/paragraphs issue with .RenderShortcodes d4de780ed @bep #13051
  • markup/goldmark: Fix typo in error message e79ee0d51 @deining

Improvements

  • Make sure term is always set e917401c7 @bep #13063
  • dartsass: Add silenceDeprecations option 3b6eaf9b1 @bep #13045
  • Run go mod tidy 5e3133a7d @bep
  • commands: Add -O flag to server to open browser ac6962d28 @bep #13040
  • Preserve input type. 23d21b0d1 @KN4CK3R
  • server: Strip ANSI escape codes from browser error log ce9cf882a @bep #13037
  • parser/metadecoders: Add benchmark 8aba6dc66 @bep
  • Add site.Store and hugo.Store and Shortcode.Store a7df536a5 @bep #13021
  • markup/goldmark: Improve the raw HTML omitted warning 2b97a2a8b @jmooring #13023

Dependency Updates

  • build(deps): bump github.com/aws/aws-sdk-go-v2/service/cloudfront eb298144b @dependabot[bot]
  • build(deps): bump google.golang.org/api from 0.191.0 to 0.206.0 61e2ce2a4 @dependabot[bot]
  • build(deps): bump github.com/aws/aws-sdk-go-v2 from 1.30.3 to 1.32.4 2d503f82a @dependabot[bot]
  • build(deps): bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0 3a6b2e6b1 @dependabot[bot]
  • deps: Upgrade github.com/bep/imagemeta v0.8.1 => v0.8.3 6bde8abaa @bep
  • build(deps): bump golang.org/x/tools from 0.26.0 to 0.27.0 2c54c3298 @dependabot[bot]
  • build(deps): bump github.com/tdewolff/minify/v2 from 2.20.37 to 2.21.1 7a2f04ee8 @dependabot[bot]
  • build(deps): bump github.com/fatih/color from 1.17.0 to 1.18.0 7921777da @dependabot[bot]
  • build(deps): bump golang.org/x/image from 0.21.0 to 0.22.0 33e964d40 @dependabot[bot]
  • deps: Upgrade github.com/yuin/goldmark v1.7.4 => v1.7.8 588c9019c @bep #12958
  • build(deps): bump golang.org/x/sync from 0.8.0 to 0.9.0 46e17053c @dependabot[bot]
  • build(deps): bump github.com/hairyhenderson/go-codeowners cb6580d00 @dependabot[bot]

Documentation

  • docs: Regen CLI docs 66dd6ecab @bep
  • docs: Regenerate CLI docs 58a3c91a7 @bep

Build Setup

  • release: Add missing withdeploy archive for arm64 Linux f7fc6ccd5 @bep #13029

下载链接