发布日期: 2025-02-26
版本号: v0.145.0

Hugo的最新版本主要引入了一项重要新功能——transform.PortableText函数,实现了与Sanity CMS的集成。本次更新包含多项错误修复,涉及拼写错误修正、代码现代化改进、相关文档链接修复、内容适配器问题处理、httpcache配置中的潜在空指针问题以及模板延迟加载时的路径告警功能修复。在功能优化方面,改进了默认排序逻辑(采用页面路径而非文件名)、为Instagram短代码启用HTTPS支持、新增PortableText转换功能,并弃用原有的_build配置项改用build配置。依赖库方面升级了go-internal、goldmark-emoji、go-cmp和wazero等多个组件版本。文档更新涉及Docker镜像构建说明调整,构建配置方面将Node.js升级至22.x版本。

更新内容 (中文)

显著的新特性是新增的transform.PortableText函数,使得Hugo能够与Sanity CMS协同使用。

缺陷修复

  • all: 拼写错误修复 4094a1e12 @coliff
  • all: 运行现代化修复 ./… 521911a57 @bep
  • readme: 修复版本章节的相对链接 ab9e54576 @martey
  • 修复内容适配器的部分相关内容问题 381c0da85 @bep #13443
  • 修复httpcache配置中潜在的nil指针 227e42926 @bep
  • 修复当站点调用templates.Defer时的–printPathWarnings参数 c3d435acf @bep #13420

功能改进

  • 在默认排序中最后采用页面路径而非后备文件名 c498d0fe1 @bep
  • tpl: Instagram短代码JS启用HTTPS 2f4e666d7 @coliff
  • 新增transform.PortableText 04f21b4d8 @bep
  • hugolib: 弃用_build前置参数键,推荐使用build d0ce94219 @jmooring

依赖更新

  • deps: 升级github.com/rogpeppe/go-internal v1.13.1 => v1.14.1 6927e6f04 @bep #13449
  • build(deps): 升级github.com/yuin/goldmark-emoji 1.0.4 => 1.0.5 b7ae24b9c @dependabot[bot]
  • build(deps): 升级github.com/google/go-cmp 0.6.0 => 0.7.0 1a4851f13 @dependabot[bot]
  • build(deps): 升级github.com/tetratelabs/wazero 1.8.2 => 1.9.0 d1f23309b @dependabot[bot]

文档更新

  • github: 构建同时包含extended和withdeploy标签的Docker镜像 e5eecbd9b @margau

构建配置

  • snap: 升级Node.js至22.x版本 4fd7f3233 @jmooring

更新内容 (原始)

The notable new feature is the new transform.PortableText function that makes it possible to use the Sanity CMS with Hugo.

Bug fixes

  • all: Typo fixes 4094a1e12 @coliff
  • all: Run modernize -fix ./… 521911a57 @bep
  • readme: Fix relative links in Editions section ab9e54576 @martey
  • Fix some related content issues with content adapters 381c0da85 @bep #13443
  • Fix potential nilpointer in httpcache config 227e42926 @bep
  • Fix –printPathWarnings when site calls templates.Defer c3d435acf @bep #13420

Improvements

  • Use the page path and not the backing filename as the last resort in the default sort c498d0fe1 @bep
  • tpl: HTTPS the instagram Shortcode JS 2f4e666d7 @coliff
  • Add transform.PortableText 04f21b4d8 @bep
  • hugolib: Deprecate _build front matter key in favor of build d0ce94219 @jmooring

Dependency Updates

  • deps: Upgrade github.com/rogpeppe/go-internal v1.13.1 => v1.14.1 6927e6f04 @bep #13449
  • build(deps): bump github.com/yuin/goldmark-emoji from 1.0.4 to 1.0.5 b7ae24b9c @dependabot[bot]
  • build(deps): bump github.com/google/go-cmp from 0.6.0 to 0.7.0 1a4851f13 @dependabot[bot]
  • build(deps): bump github.com/tetratelabs/wazero from 1.8.2 to 1.9.0 d1f23309b @dependabot[bot]

Documentation

  • github: Build docker image with both extended and withdeploy tags e5eecbd9b @margau

Build Setup

  • snap: Update Node.js to 22.x 4fd7f3233 @jmooring

下载链接