--- title: "Hextra v0.11" date: 2025-08-30 authors: - name: imfing link: https://github.com/imfing image: https://github.com/imfing.png tags: - Release --- Hextra v0.11.0 专注于打磨使用体验并带来数个实用新组件:站点级顶部横幅、改进的提示框与徽章、更丰富的卡片、分析工具集成,以及多项导航优化。同时包含稳定性修复和文档更新。 ## 升级指南 对大多数站点而言没有破坏性变更。使用 [Hugo Modules](https://gohugo.io/hugo-modules/use-modules/) 更新: ```bash hugo mod get -u github.com/imfing/hextra ``` ## 亮点 - 用于公告的顶栏横幅组件 - 重新设计的提示框,样式更清晰 - 支持 Umami 与 Matomo 分析 - Asciinema 短代码用于终端录屏 - 外链装饰选项 - 单页(非文档、非博客)支持面包屑 - 导航栏增强:图标链接项与更优布局 - 徽章与卡片的自定义能力提升 - 主题切换增加「System」选项 ## 新功能 ### 顶部横幅 为公告、发布或状态消息添加一个站点级、可关闭的横幅。 ```yaml {filename="hugo.yaml"} params: banner: key: "announcement" message: Welcome! ``` ![顶部横幅](https://github.com/user-attachments/assets/33a08c9b-db84-4200-b37c-1a53c1bef08d) ### 提示框重设计 [Callout]({{% relref "docs/guide/shortcodes/callout" %}}) 获得样式刷新,在各主题下具备更好的可读性与强调效果。 ![提示框刷新](https://github.com/user-attachments/assets/b3154dbb-e582-4c84-a8b8-1ecb02c3464d) ### 分析:Umami 与 Matomo 内置以下分析平台的配置支持: - [Umami]({{% relref "docs/guide/configuration.md#umami-analytics" %}}) - [Matomo]({{% relref "docs/guide/configuration.md#matomo-analytics" %}}) ### Asciinema 短代码 使用全新的 [Asciinema 短代码]({{% relref "docs/guide/shortcodes/asciinema.md" %}}) 嵌入 [Asciinema](https://www.asciinema.org/) 终端录屏。 ```md {{}} ``` ![Asciinema](https://github.com/user-attachments/assets/3c33a8ef-3c01-4e30-9832-3ccb784ec538) ### 导航栏增强 - 支持在导航栏链接项中使用图标 - 优化菜单的相对位置,使其与语言切换器等项协同更佳 ![带图标项的导航栏](https://github.com/user-attachments/assets/6c035eee-cd7d-44d8-bcf7-9cbd7f92ab42) 值得一提的是,版本 [0.10.2](https://github.com/imfing/hextra/releases/tag/v0.10.2) 已支持在导航栏添加语言切换器与主题切换。 ### 外链装饰 可选地为外部链接添加轻量的外链标识装饰。 ```yaml {filename="hugo.yaml"} params: externalLinkDecoration: true ``` ### 启用面包屑 在单页(非文档、非博客)上,通过在 Front Matter 中设置 `breadcrumbs: true` 启用面包屑。 ```yaml {filename="content/about.md"} --- title: About breadcrumbs: true --- ``` ### 卡片与徽章的改进 - [卡片]({{% relref "docs/guide/shortcodes/cards.md" %}}):新增 `tagIcon` 与 `tagBorder` 选项。 - [徽章]({{% relref "docs/guide/shortcodes/others.md" %}}):新增颜色与边框样式。 ## 使用体验优化 - 主题切换:增加「System」选项 ![主题切换](https://github.com/user-attachments/assets/54a1d315-9243-4814-9154-6e63af9ea2e8) - 字体排版:改进带复选框的任务列表样式 ![任务列表](https://github.com/user-attachments/assets/53722651-63b6-4469-95e7-326849a30306) - 语言切换器:与图标菜单项的排序更合理 ## 修复 - Giscus:正确同步主题与语言 - 卡片:修复 RTL 场景下的徽章渲染 - 导航栏:优化菜单位置与交互 ## 文档与 i18n - 文档:新增页面介绍 Hextra 的短代码 - i18n:为 `zh-cn` 增加 `copyCode` 与 `system` 翻译 --- **完整变更日志**: https://github.com/imfing/hextra/compare/v0.10.2...v0.11.0