发布日期: 2025-02-17
版本号: v0.144.0

Hugo 1.24版本升级包含多项性能优化及功能改进:新增:contentbasename:slugorcontentbasename永久链接令牌用于灵活管理内容路径;为数学公式转换功能transform.ToMath启用KaTeX的mhchem扩展以支持化学公式;新增js.Builddrop选项用于控制脚本输出,增加模块配置的auth选项以支持私有仓库认证。同时支持定义术语的自动ID生成(autoID)和引入configurationTypes配置选项。修复了自动生成标题ID可能包含超链接、Goldmark解析器异常崩溃、短代码错误提示不准确等问题,并全面更新了依赖包。弃用了部分旧功能如:filename永久链接令牌及Front Matter中的kindlangpath参数。此版本还对代码结构、模板处理及服务器配置进行了优化。

更新内容 (中文)

详见原始内容

更新内容 (原始)

Go 1.24 upgrade, several performance improvements, new :contentbasename and :slugorcontentbasename permalink tokens, enable KaTeX mhchem extension for transform.ToMath, full dependency refresh, new drop option for js.Build, new auth module option useful for private module repositories, autoID support for definition terms, new configurationTypes configuration option, and more. For more details, see this topic.

Note

  • Fix auto generated header ids so they don’t contain e.g. hyperlink destinations (note) 24cc25552 @bep #13405 #13410

Bug fixes

  • markup/goldmark: Fix panic on stray attribute nodes 85c172774 @bep
  • Fix Position for passthrough hooks 641403f7d @bep #13406
  • config: Fix server.redirects.fromRe being ignored unless server.redirects.from is also set c1f4228d6 @p-weston
  • Fix shortcode name in error message on self-closing shortcodes with no .Inner e865d5984 @bep #13344

Improvements

  • config/allconfig: Deprecate :filename and :slugorfilename tokens 5de3913ed @jmooring
  • resources/page: Revise the new contentbasename permalinks tokens 7b7a0f362 @bep #11722
  • resources/page: Add :contentbasename and :contentbasenameorslug permalink tokens cb7a4339b @hacdias #11722
  • Add autoID for definition terms 157d3703c @bep #13403 #11566
  • internal/warpc: Enable KaTeX mhchem extension 503dcf625 @jmooring
  • modules: Add GOAUTH to module config 2c77719cd @bep #13385
  • Support menus as maps in content adapters fd38aee69 @bep #13384
  • js/esbuild: Add drop option d25f7ec17 @bep #13362
  • config: Remove unused code 34dcac53b @jmooring
  • commands: Use punctuation consistently in short description ee438606d @jmooring
  • Upgrade to Go 1.24 fd8b0fbf8 @bep #13381
  • Deprecate kind, lang, and path from front matter 9b5f786df @bep #12484
  • commands: Move the CHMOD event filter up e6feb9e0b @bep #13373
  • parser: Handle org-mode filetags as slice f02da7fbc @theSuess
  • Add ContentTypes to config c2fb22120 @bep #12274
  • commands: Validate style argument passed to gen chromastyles a352e69b0 @jmooring #13357
  • Update CONTRIBUTING.md 1dd27be81 @bep
  • Move “print unused templates” after renderDeferred eb7a5aaba @bep #13355
  • Add some more server options/improvements 029d1e0ce @bep

Dependency Updates

  • build(deps): bump github.com/spf13/cobra from 1.8.1 to 1.9.1 a2ca95629 @dependabot[bot]
  • build(deps): bump github.com/sanity-io/litter from 1.5.7 to 1.5.8 367fe526e @dependabot[bot]
  • build(deps): bump github.com/sanity-io/litter from 1.5.5 to 1.5.7 9c2f8ec61 @dependabot[bot]
  • build(deps): bump github.com/gohugoio/hugo-goldmark-extensions/extras bd77944ba @dependabot[bot]
  • build(deps): bump golang.org/x/tools from 0.29.0 to 0.30.0 2e835d084 @dependabot[bot]
  • build(deps): bump github.com/aws/aws-sdk-go-v2/service/cloudfront d89b9d891 @dependabot[bot]
  • build(deps): bump google.golang.org/api from 0.206.0 to 0.221.0 8721a3520 @dependabot[bot]
  • build(deps): bump github.com/bep/imagemeta from 0.8.3 to 0.8.4 c054e1882 @dependabot[bot]
  • build(deps): bump golang.org/x/image from 0.22.0 to 0.24.0 5e4ffa0e8 @dependabot[bot]
  • build(deps): bump golang.org/x/mod from 0.22.0 to 0.23.0 0cdcc2b58 @dependabot[bot]
  • build(deps): bump github.com/gohugoio/hashstructure from 0.3.0 to 0.5.0 a591c4406 @dependabot[bot]
  • build(deps): bump github.com/bep/simplecobra from 0.4.0 to 0.5.0 2d86a0512 @dependabot[bot]
  • build(deps): bump github.com/aws/aws-sdk-go-v2/service/cloudfront 22ee0918f @dependabot[bot]
  • build(deps): bump github.com/aws/aws-sdk-go-v2 from 1.32.4 to 1.36.1 b50ab0403 @dependabot[bot]
  • build(deps): bump github.com/getkin/kin-openapi from 0.123.0 to 0.129.0 b772f0e3d @dependabot[bot]
  • build(deps): bump github.com/spf13/pflag from 1.0.5 to 1.0.6 d58c0198d @dependabot[bot]

Documentation

  • Update README.md 5dd0ba00f @jmooring
  • helpers: Add Chroma styles to docs.yaml f0c185297 @jmooring #13360

下载链接