chore(docs): rename exampleSite to docs and create examples (#813)

* chore(docs): rename `exampleSite` to `docs` and create `examples`

* chore(build): update build script to support new version format and source directories; add v0.10 to documentation menu
This commit is contained in:
Xin
2025-09-06 12:06:26 +01:00
committed by GitHub
parent f8eae96c11
commit 83f3b5052e
156 changed files with 62 additions and 43 deletions

View File

@@ -0,0 +1,10 @@
---
title: "وبلاگ"
---
<div style="text-align: center; margin-top: 1em;">
{{< hextra/hero-badge link="index.xml" >}}
<span>فید RSS</span>
{{< icon name="rss" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
</div>

View File

@@ -0,0 +1,10 @@
---
title: "ブログ"
---
<div style="text-align: center; margin-top: 1em;">
{{< hextra/hero-badge link="index.xml" >}}
<span>RSS フィード</span>
{{< icon name="rss" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
</div>

View File

@@ -0,0 +1,10 @@
---
title: "Blog"
---
<div style="text-align: center; margin-top: 1em;">
{{< hextra/hero-badge link="index.xml" >}}
<span>RSS Feed</span>
{{< icon name="rss" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
</div>

View File

@@ -0,0 +1,10 @@
---
title: "博客"
---
<div style="text-align: center; margin-top: 1em;">
{{< hextra/hero-badge link="index.xml" >}}
<span>RSS 订阅</span>
{{< icon name="rss" attributes="height=14" >}}
{{< /hextra/hero-badge >}}
</div>

View File

@@ -0,0 +1,160 @@
---
title: راهنمای نحو Markdown
date: 2020-01-01
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
- name: Octocat
link: https://github.com/octocat
image: https://github.com/octocat.png
- name: Goudarz Jafari
link: https://github.com/Goudarz
image: https://github.com/Goudarz.png
tags:
- Markdown
- مثال
- راهنما
excludeSearch: true
---
این مقاله نمونه‌ای از نحو پایه‌ای Markdown را ارائه می‌دهد که می‌توان در فایل‌های محتوای Hugo استفاده کرد.
<!--more-->
## نحو پایه
### سرتیترها
```
# سرتیتر 1
## سرتیتر 2
### سرتیتر 3
#### سرتیتر 4
##### سرتیتر 5
###### سرتیتر 6
```
## سرتیتر 2
### سرتیتر 3
#### سرتیتر 4
##### سرتیتر 5
###### سرتیتر 6
### تأکید
```text
*این متن به صورت ایتالیک نمایش داده می‌شود*
_این نیز به صورت ایتالیک نمایش داده میشود_
**این متن به صورت پررنگ نمایش داده می‌شود**
__این نیز به صورت پررنگ نمایش داده میشود__
_شما می‌توانید **آن‌ها را ترکیب** کنید_
```
*این متن به صورت ایتالیک نمایش داده می‌شود*
_این نیز به صورت ایتالیک نمایش داده میشود_
**این متن به صورت پررنگ نمایش داده می‌شود**
__این نیز به صورت پررنگ نمایش داده میشود__
_شما می‌توانید **آن‌ها را ترکیب** کنید_
### فهرست‌ها
#### بدون ترتیب
```
* مورد ۱
* مورد ۲
* مورد ۲الف
* مورد ۲ب
```
* مورد ۱
* مورد ۲
* مورد ۲الف
* مورد ۲ب
#### با ترتیب
```
۱. مورد ۱
۲. مورد ۲
۳. مورد ۳
۱. مورد ۳الف
۲. مورد ۳ب
```
### تصاویر
```markdown
![لوگوی GitHub](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
```
![لوگوی GitHub](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
### پیوندها
```markdown
[Hugo](https://gohugo.io)
```
[Hugo](https://gohugo.io)
### نقل‌قول‌ها
```markdown
همان‌طور که نیوتن گفت:
> اگر من دورتر را دیده‌ام، به این دلیل است که بر شانه‌های غول‌ها ایستاده‌ام.
```
> اگر من دورتر را دیده‌ام، به این دلیل است که بر شانه‌های غول‌ها ایستاده‌ام.
### کد درون‌خطی
```markdown
کد `درون‌خطی` با `علامت back-tick` احاطه شده است.
```
کد `درون‌خطی` با `علامت back-tick` احاطه شده است.
### بلوک‌های کد
#### هایلایت سینتکس
````markdown
```go
func main() {
fmt.Println("Hello World")
}
```
````
```go
func main() {
fmt.Println("Hello World")
}
```
### جداول
```markdown
| سینتکس | توضیحات |
| --------- | ----------- |
| هدر | عنوان |
| پاراگراف | متن |
```
| سینتکس | توضیحات |
| --------- | ----------- |
| هدر | عنوان |
| پاراگراف | متن |
## منابع
- [نحو Markdown](https://www.markdownguide.org/basic-syntax/)
- [Markdown در Hugo](https://gohugo.io/content-management/formats/#markdown)

View File

@@ -0,0 +1,157 @@
---
title: Markdown 構文ガイド
date: 2020-01-01
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
- name: Octocat
link: https://github.com/octocat
image: https://github.com/octocat.png
tags:
- Markdown
- サンプル
- ガイド
excludeSearch: true
---
この記事では、Hugo のコンテンツファイルで使用できる基本的な Markdown 構文のサンプルを紹介します。
<!--more-->
## 基本構文
### 見出し
```
# 見出し1
## 見出し2
### 見出し3
#### 見出し4
##### 見出し5
###### 見出し6
```
## 見出し2
### 見出し3
#### 見出し4
##### 見出し5
###### 見出し6
### 強調
```text
*このテキストは斜体になります*
_これも斜体になります_
**このテキストは太字になります**
__これも太字になります__
_これらを**組み合わせる**こともできます_
```
*このテキストは斜体になります*
_これも斜体になります_
**このテキストは太字になります**
__これも太字になります__
_これらを**組み合わせる**こともできます_
### リスト
#### 順序なしリスト
```
* 項目1
* 項目2
* 項目2a
* 項目2b
```
* 項目1
* 項目2
* 項目2a
* 項目2b
#### 順序付きリスト
```
1. 項目1
2. 項目2
3. 項目3
1. 項目3a
2. 項目3b
```
### 画像
```markdown
![GitHub ロゴ](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
```
![GitHub ロゴ](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
### リンク
```markdown
[Hugo](https://gohugo.io)
```
[Hugo](https://gohugo.io)
### ブロッククォート
```markdown
ニュートンはこう言いました:
> 私が遠くを見渡せたとしたら、それは巨人の肩の上に立っていたからです。
```
> 私が遠くを見渡せたとしたら、それは巨人の肩の上に立っていたからです。
### インラインコード
```markdown
インライン `コード``バッククォートで囲みます`
```
インライン `コード``バッククォートで囲みます`
### コードブロック
#### シンタックスハイライト
````markdown
```go
func main() {
fmt.Println("Hello World")
}
```
````
```go
func main() {
fmt.Println("Hello World")
}
```
### テーブル
```markdown
| 構文 | 説明 |
| --------- | ----------- |
| 見出し | タイトル |
| 段落 | テキスト |
```
| 構文 | 説明 |
| --------- | ----------- |
| 見出し | タイトル |
| 段落 | テキスト |
## 参考資料
- [Markdown 構文](https://www.markdownguide.org/basic-syntax/)
- [Hugo Markdown](https://gohugo.io/content-management/formats/#markdown)

View File

@@ -0,0 +1,157 @@
---
title: Markdown Syntax Guide
date: 2020-01-01
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
- name: Octocat
link: https://github.com/octocat
image: https://github.com/octocat.png
tags:
- Markdown
- Example
- Guide
excludeSearch: true
---
This article offers a sample of basic Markdown syntax that can be used in Hugo content files.
<!--more-->
## Basic Syntax
### Headings
```
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
```
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
### Emphasis
```text
*This text will be italic*
_This will also be italic_
**This text will be bold**
__This will also be bold__
_You **can** combine them_
```
*This text will be italic*
_This will also be italic_
**This text will be bold**
__This will also be bold__
_You **can** combine them_
### Lists
#### Unordered
```
* Item 1
* Item 2
* Item 2a
* Item 2b
```
* Item 1
* Item 2
* Item 2a
* Item 2b
#### Ordered
```
1. Item 1
2. Item 2
3. Item 3
1. Item 3a
2. Item 3b
```
### Images
```markdown
![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
```
![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
### Links
```markdown
[Hugo](https://gohugo.io)
```
[Hugo](https://gohugo.io)
### Blockquotes
```markdown
As Newton said:
> If I have seen further it is by standing on the shoulders of Giants.
```
> If I have seen further it is by standing on the shoulders of Giants.
### Inline Code
```markdown
Inline `code` has `back-ticks around` it.
```
Inline `code` has `back-ticks around` it.
### Code Blocks
#### Syntax Highlighting
````markdown
```go
func main() {
fmt.Println("Hello World")
}
```
````
```go
func main() {
fmt.Println("Hello World")
}
```
### Tables
```markdown
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
```
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
## References
- [Markdown Syntax](https://www.markdownguide.org/basic-syntax/)
- [Hugo Markdown](https://gohugo.io/content-management/formats/#markdown)

View File

@@ -0,0 +1,157 @@
---
title: Markdown 语法指南
date: 2020-01-01
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
- name: Octocat
link: https://github.com/octocat
image: https://github.com/octocat.png
tags:
- Markdown
- 示例
- 指南
excludeSearch: true
---
本文展示了 Hugo 内容文件中可用的基础 Markdown 语法示例。
<!--more-->
## 基础语法
### 标题
```
# 一级标题
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题
```
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题
### 强调
```text
*这段文字会显示为斜体*
_这段文字也会显示为斜体_
**这段文字会显示为粗体**
__这段文字也会显示为粗体__
_你可以**组合**使用_
```
*这段文字会显示为斜体*
_这段文字也会显示为斜体_
**这段文字会显示为粗体**
__这段文字也会显示为粗体__
_你可以**组合**使用_
### 列表
#### 无序列表
```
* 项目1
* 项目2
* 子项目2a
* 子项目2b
```
* 项目1
* 项目2
* 子项目2a
* 子项目2b
#### 有序列表
```
1. 项目1
2. 项目2
3. 项目3
1. 子项目3a
2. 子项目3b
```
### 图片
```markdown
![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
```
![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
### 链接
```markdown
[Hugo](https://gohugo.io)
```
[Hugo](https://gohugo.io)
### 引用块
```markdown
正如牛顿所说:
> 如果说我看得比别人更远些,那是因为我站在巨人的肩膀上。
```
> 如果说我看得比别人更远些,那是因为我站在巨人的肩膀上。
### 行内代码
```markdown
行内`代码`会用`反引号包裹`起来。
```
行内`代码`会用`反引号包裹`起来。
### 代码块
#### 语法高亮
````markdown
```go
func main() {
fmt.Println("Hello World")
}
```
````
```go
func main() {
fmt.Println("Hello World")
}
```
### 表格
```markdown
| 语法 | 描述 |
| --------- | ----------- |
| 标题 | 标题文本 |
| 段落 | 正文内容 |
```
| 语法 | 描述 |
| --------- | ----------- |
| 标题 | 标题文本 |
| 段落 | 正文内容 |
## 参考资料
- [Markdown 语法](https://www.markdownguide.org/basic-syntax/)
- [Hugo Markdown](https://gohugo.io/content-management/formats/#markdown)

View File

@@ -0,0 +1,247 @@
---
title: "Hextra v0.10"
date: 2025-08-14
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
tags:
- انتشار
---
Hextra v0.10.0 یک انتشار بزرگ است که مملو از قابلیت‌های جدید، ارتقاهای معماری و بهبودهای کیفیت زندگی می‌باشد.
<!--more-->
همچنین شامل مشارکت‌های 10 [مشارکت‌کننده جدید](#contributors) بوده و درخواست‌های دیرینه جامعه را برطرف می‌کند.
## راهنمای ارتقا
> [!IMPORTANT]
> **تغییرات شکست‌آمیز**: این انتشار شامل چندین تغییر شکست‌آمیز است. لطفاً قبل از ارتقا، چک‌لیست و [راهنمای مهاجرت](#migration-guide) را بررسی کنید.
قبل از ارتقا به v0.10.0، مطمئن شوید که:
- Hugo v0.146.0+ (نسخه extended) نصب شده است
- CSS سفارشی را برای تغییرات نام کلاس بررسی کرده‌اید (به [تغییرات پیشوند کلاس‌های CSS](#css-class-prefix-changes) و [Tailwind CSS v4](#tailwind-css-v4) مراجعه کنید)
- تأیید کرده‌اید که محیط ساخت دسترسی به اینترنت برای دانلود دارایی‌ها هنگام استفاده از LaTeX و/یا Mermaid دارد
پس از آماده‌سازی، ماژول Hugo را به‌روزرسانی کنید:
```bash
hugo mod get -u github.com/imfing/hextra@v0.10.0
```
## ویژگی‌های جدید
در زیر لیستی از ویژگی‌های جدید قابل توجه در این انتشار آمده است:
- [**پشتیبانی از منوی کشویی در نوار ناوبری**](#dropdown-menu-support-in-navbar): ایجاد منوهای ناوبری سلسله‌مراتبی
- [**تجربه جستجوی بهبودیافته**](#enhanced-search-experience): جستجوی بهبودیافته در تمام سرتیترها با دقت بهتر
- [**پشتیبانی از llms.txt**](#llmstxt-support): تولید خلاصه سایت مناسب برای هوش مصنوعی
- [**هایلایت کردن اسکرول فهرست مطالب**](#table-of-contents-scroll-highlighting): هایلایت کردن خودکار سرتیترها هنگام اسکرول صفحه
- [**تبدیل همگام تب‌ها**](#synchronized-tab-switching): همگام‌سازی انتخاب تب‌ها در چندین گروه تب
- [**صفحه‌بندی لیست وبلاگ**](#blog-list-pagination): اضافه کردن کنترل‌های صفحه‌بندی به صفحات لیست وبلاگ
- [**پشتیبانی از MathJax**](#mathjax-support): موتور رندر ریاضی جایگزین در کنار KaTeX
### پشتیبانی از منوی کشویی در نوار ناوبری
منوهای کشویی را در نوار ناوبری خود برای سازماندهی بهتر موارد ناوبری ایجاد کنید.
```yaml {filename="hugo.yaml"}
menu:
main:
- identifier: products
name: "محصولات"
- name: "محصول الف"
parent: products
url: "/product-a"
- name: "محصول ب"
parent: products
url: "/product-b"
```
![ناوبری منوی کشویی](https://github.com/user-attachments/assets/1816f9b9-7fe3-46e8-9546-f15e43e9914a)
### تجربه جستجوی بهبودیافته
- **جستجو در تمام سرتیترها**: یافتن محتوا در تمام سطوح سرتیترها، نه فقط عنوان صفحات
- **دقت بهتر نتایج**: مدیریت بهتر عنوان‌ها و دقت پیونددهی
- **ناوبری ثابت نتایج**: نتایج جستجو اکنون به بخش‌های صحیح صفحه پیوند می‌خورند
با تشکر ویژه از [@ldez](https://github.com/ldez) برای پیشبرد قابلیت‌های جستجو!
![نتایج جستجوی بهبودیافته](https://github.com/user-attachments/assets/f819652a-95d4-4843-b7e2-c7953a8cabe8)
### پشتیبانی از llms.txt
Hextra اکنون از فرمت خروجی [llms.txt](https://llmstxt.org/) برای سایت شما پشتیبانی می‌کند، که سایت شما را برای ابزارهای هوش مصنوعی و مدل‌های زبانی برای زمینه و مرجع قابل دسترس‌تر می‌سازد.
```yaml {filename="hugo.yaml"}
outputs:
home: [html, llms]
```
این یک فایل `llms.txt` در ریشه سایت شما ایجاد می‌کند.
![مثال llms txt](https://github.com/user-attachments/assets/c6e929bb-0fce-4ab2-af15-a71c5a38b22c)
### هایلایت کردن اسکرول فهرست مطالب
فهرست مطالب اکنون به‌طور خودکار بخش فعلی را هنگام اسکرول صفحه هایلایت می‌کند، که ناوبری را شهودی‌تر می‌سازد.
![هایلایت اسکرول ToC](https://github.com/user-attachments/assets/d623fb99-7000-428b-af95-384eb722f0eb)
### تبدیل همگام تب‌ها
تب‌هایی با موارد یکسان اکنون در سراسر صفحه همگام می‌شوند. هنگامی که همگام‌سازی فعال است، انتخاب یک تب تمام گروه‌های تب که لیست موارد یکسانی دارند را به‌روزرسانی می‌کند (و انتخاب شما به خاطر سپرده می‌شود).
```yaml {filename="hugo.yaml"}
params:
page:
tabs:
sync: true
```
### صفحه‌بندی لیست وبلاگ
کنترل‌های صفحه‌بندی پایه به صفحات لیست وبلاگ اضافه شده‌اند.
```yaml {filename="hugo.yaml"}
params:
blog:
list:
pagerSize: 20 # پست‌ها در هر صفحه
```
![صفحه‌بندی وبلاگ](https://github.com/user-attachments/assets/60405fb4-ec36-4733-ba13-b4066396b5c5)
### پشتیبانی از MathJax
عبارات ریاضی را با [MathJax](https://www.mathjax.org/) در کنار پشتیبانی پیش‌فرض KaTeX رندر کنید. موتوری را انتخاب کنید که بهترین تناسب را با نیازهای شما دارد.
```yaml {filename="hugo.yaml"}
params:
math:
engine: "mathjax" # پیش‌فرض "katex" است
```
## بهبودهای فنی
### چارچوب و سیستم ساخت
- **مهاجرت به Tailwind CSS v4**: مهاجرت کامل به [Tailwind CSS v4](https://tailwindcss.com/blog/tailwindcss-v4) با پشتیبانی بهبودیافته سفارشی‌سازی.
- **سیستم قالب Hugo**: سازگار با [سیستم قالب جدید Hugo](https://gohugo.io/templates/new-templatesystem-overview/) (v0.146.0+) برای سازگاری آینده.
- **رندر سمت سرور ریاضی**: مدیریت بهتر رندر معادلات ریاضی با استفاده از رندر بومی Hugo به‌صورت پیش‌فرض.
- **ارتقای FlexSearch 0.8**: ارتقای موتور جستجو [FlexSearch](https://github.com/nextapps-de/flexsearch) برای نتایج سریع‌تر و دقیق‌تر با رمزگذاری بهبودیافته محتوای CJK (چینی، ژاپنی، کرهای).
- **مدیریت بهبودیافته دارایی‌ها**: دارایی‌های KaTeX و Mermaid از بارگیری از CDN یا محلی پشتیبانی می‌کنند
## بهبودهای کیفیت زندگی
- **تغییر دینامیک favicon**: به‌روزرسانی خودکار favicon بر اساس ترجیحات طرح رنگ
- **صفحه‌بندی معکوس**: نویسندگان اکنون می‌توانند `reversePagination` را در front matter صفحه تنظیم کنند
- **کنترل نمایه‌سازی گوگل**: پارامتر صفحه جدید برای مسدود کردن نمایه‌سازی گوگل در صورت نیاز
- **بهبودهای مدیریت عرض**: کنترل‌های طراحی پاسخگو بهتر از طریق متغیرهای CSS
- **بهبودهای استایل**: استایل‌های مدرن برای جدول Markdown و خط افقی
## رفع اشکالات و پایداری
- **همگام‌سازی تم Giscus**: نظرات اکنون به درستی تغییرات حالت تاریک/روشن را دنبال می‌کنند
- **دقت نتایج جستجو**: رفع مشکلات پیونددهی و فرار عنوان در نتایج جستجو
- **تبدیل تب‌ها**: رفع مشکلات ناوبری در حالت غیرهمگام تب
- **اسکرول فانتوم**: رفع رفتار ناخواسته اسکرول هنگام غیرفعال بودن پاورقی
- **دسترسی تصویر**: جلوگیری از رندر تکراری متن alt
- **رندر پیوند**: بهبود مدیریت URL پایه برای ساختارهای پیچیده سایت
---
## راهنمای مهاجرت
- [**نیازمندی‌های نسخه Hugo**](#hugo-version-requirements): نیاز به Hugo v0.146.0+ (نسخه extended) دارد
- [**تغییرات پیشوند کلاس‌های CSS**](#css-class-prefix-changes): کلاس‌های CSS کامپوننت اکنون از پیشوند سازگار `hextra-` استفاده می‌کنند
- [**مدیریت دارایی‌ها**](#asset-management-for-katex-and-mermaid): دارایی‌های KaTeX و Mermaid اکنون در زمان ساخت دانلود می‌شوند
- [**Tailwind CSS v4**](#tailwind-css-v4): کامپایل CSS داخلی اکنون از Tailwind CSS v4.x با پیشوند `hx:` استفاده می‌کند
#### نیازمندی‌های نسخه Hugo
**تأثیر**: سایت‌هایی که از نسخه‌های قدیمی Hugo استفاده می‌کنند
Hextra v0.10.0 به دلیل پذیرش سیستم قالب جدید، نیاز به Hugo v0.146.0 یا بالاتر (نسخه extended) دارد.
**اقدام مورد نیاز**: قبل از ارتقای Hextra، Hugo را به v0.146.0+ به‌روزرسانی کنید
#### تغییرات پیشوند کلاس‌های CSS
**تأثیر**: سایت‌هایی با CSS سفارشی که کلاس‌های کامپوننت Hextra را هدف قرار می‌دهند
Hextra v0.10.0 پیشوند سازگار `hextra-` را برای اکثر کلاس‌های CSS کامپوننت معرفی می‌کند تا قابلیت نگهداری را بهبود بخشد و از تداخل با استایل‌های کاربر جلوگیری کند.
**اقدام مورد نیاز**: اگر CSS سفارشی دارید که کامپوننت‌های Hextra را هدف قرار می‌دهد، نام کلاس‌های زیر را به‌روزرسانی کنید:
| حوزه | قبل | بعد |
| -------------------- | ---------------------------- | ------------------------------------------------- |
| جستجو (ظرف) | `.search-wrapper` | `.hextra-search-wrapper` |
| جستجو (ورودی) | `.search-input` | `.hextra-search-input` |
| جستجو (نتایج) | `.search-results` | `.hextra-search-results` |
| جستجو (عنوان) | `.search-wrapper .title` | `.hextra-search-wrapper .hextra-search-title` |
| جستجو (مورد فعال) | `.search-wrapper .active` | `.hextra-search-wrapper .hextra-search-active` |
| جستجو (بدون نتیجه) | `.search-wrapper .no-result` | `.hextra-search-wrapper .hextra-search-no-result` |
| جستجو (پیشوند) | `.search-wrapper .prefix` | `.hextra-search-wrapper .hextra-search-prefix` |
| جستجو (گزیده) | `.search-wrapper .excerpt` | `.hextra-search-wrapper .hextra-search-excerpt` |
| جستجو (مطابقت) | `.search-wrapper .match` | `.hextra-search-wrapper .hextra-search-match` |
| تارنما محو | `.nav-container-blur` | `.hextra-nav-container-blur` |
| منوی همبرگر | `.hamburger-menu` | `.hextra-hamburger-menu` |
| تغییر تم | `.theme-toggle` | `.hextra-theme-toggle` |
| تغییر زبان | `.language-switcher` | `.hextra-language-switcher` |
| ظرف نوار کناری | `.sidebar-container` | `.hextra-sidebar-container` |
| مورد فعال نوار کناری | `.sidebar-active-item` | `.hextra-sidebar-active-item` |
| نام فایل کد | `.filename` | `.hextra-code-filename` |
| آیکون کپی | `.copy-icon` | `.hextra-copy-icon` |
| آیکون موفقیت | `.success-icon` | `.hextra-success-icon` |
| مراحل | `.steps` | `.hextra-steps` |
#### مدیریت دارایی‌ها برای KaTeX و Mermaid
**تأثیر**: سایت‌هایی که از KaTeX یا Mermaid استفاده می‌کنند
Hextra v0.10.0 اکنون دارایی‌های KaTeX و Mermaid را از CDN در زمان ساخت دانلود می‌کند.
**چه چیزی تغییر کرده است:**
- فرآیند ساخت اکنون نیاز به دسترسی به اینترنت برای دانلود این دارایی‌ها دارد
- دیگر پس از ساخت، فراخوانی CDN خارجی برای این دارایی‌ها وجود ندارد
**اقدام مورد نیاز**:
- مطمئن شوید که محیط ساخت شما دسترسی به اینترنت برای دانلود دارایی‌ها دارد
- سایت‌های در محیط‌های ایزوله ممکن است نیاز به پیش‌دانلود این دارایی‌ها و پیکربندی Hextra برای بارگیری آنها داشته باشند
#### Tailwind CSS v4
**تأثیر**: سایت‌هایی با CSS سفارشی گسترده که کلاس‌های Tailwind Hextra `hx-*` را هدف قرار می‌دهند
در حالی که Hextra مهاجرت Tailwind CSS v4 را به صورت داخلی مدیریت می‌کند، سایت‌هایی با سفارشی‌سازی‌های سنگین ممکن است نیاز به تنظیمات بیشتری داشته باشند.
**چه چیزی تغییر کرده است:**
- کامپایل CSS داخلی اکنون از Tailwind CSS v4.x استفاده می‌کند
- کلاس‌های ابزار اکنون با پیشوند `hx:` به جای `hx-` هستند
## مشارکت‌کنندگان
این انتشار با مشارکت‌های 10 مشارکت‌کننده جدید ممکن شد:
- [@oosquare](https://github.com/oosquare) - فونت‌های KaTeX، قلاب‌های رندر تصویر، بهبودهای مدیریت پیوند
- [@Zabriskije](https://github.com/Zabriskije) - رفع اسکرول فانتوم
- [@miniwater](https://github.com/miniwater) - مرکزسازی پاورقی سفارشی، بهبودهای متن alt تصویر
- [@MattDodsonEnglish](https://github.com/MattDodsonEnglish) - کنترل‌های نمایه‌سازی گوگل، مستندات OpenGraph
- [@KStocky](https://github.com/KStocky) - ویژگی صفحه‌بندی معکوس
- [@PrintN](https://github.com/PrintN) - اضافه شدن نمایش مستندات
- [@hobobandy](https://github.com/hobobandy) - بهبودهای فاصله عنوان
- [@dlwocks31](https://github.com/dlwocks31) - به‌روزرسانی ترجمه کرهای
- [@TwoAnts](https://github.com/TwoAnts) - رفع تغییر تم Giscus
- [@ldez](https://github.com/ldez) - بهبودهای جستجو و رفع اشکالات
با تشکر ویژه از مشارکت‌کنندگان بازگشتی [@deining](https://github.com/deining) و [@yuri1969](https://github.com/yuri1969) برای حمایت مستمرشان در مستندات، ترجمه‌ها و بهبودهای فنی.
**تغییرات کامل**: https://github.com/imfing/hextra/compare/v0.9.7...v0.10.0

View File

@@ -0,0 +1,247 @@
---
title: "Hextra v0.10"
date: 2025-08-14
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
tags:
- Release
---
Hextra v0.10.0 は、新機能、アーキテクチャの刷新、利便性向上を詰め込んだ大きなリリースです。
<!--more-->
また、10名の[新規コントリビューター](#contributors)からの貢献と、長らく要望のあった機能の実装も含まれています。
## アップグレードガイド
> [!IMPORTANT]
> **破壊的変更**: このリリースにはいくつかの破壊的変更が含まれています。アップグレード前にチェックリストと[移行ガイド](#migration-guide)を確認してください。
v0.10.0 にアップグレードする前に、以下を確認してください:
- Hugo v0.146.0+ (extended 版) がインストールされていること
- カスタムCSSのクラス名変更を確認 ( [CSSクラスプレフィックス変更](#css-class-prefix-changes) と [Tailwind CSS v4](#tailwind-css-v4) を参照)
- LaTeX や Mermaid を使用する場合、ビルド環境がアセットダウンロードのためインターネットに接続できること
準備が整ったら、Hugoモジュールを更新します:
```bash
hugo mod get -u github.com/imfing/hextra@v0.10.0
```
## 新機能
このリリースの主な新機能は以下の通りです:
- [**ナビゲーションバーのドロップダウンメニューサポート**](#dropdown-menu-support-in-navbar): 階層型ナビゲーションメニューの作成
- [**検索機能の強化**](#enhanced-search-experience): すべての見出しを対象にした精度向上した検索
- [**llms.txt サポート**](#llmstxt-support): AI向けサイトアウトラインの生成
- [**目次のスクロールハイライト**](#table-of-contents-scroll-highlighting): ページスクロール中の見出し自動ハイライト
- [**タブの同期切り替え**](#synchronized-tab-switching): 複数のタブグループ間でのタブ選択の同期
- [**ブログ一覧のページネーション**](#blog-list-pagination): ブログ一覧ページへのページネーションコントロール追加
- [**MathJax サポート**](#mathjax-support): KaTeXに加えてMathJaxを数式レンダリングエンジンとして選択可能
### ナビゲーションバーのドロップダウンメニューサポート
ナビゲーションバーにドロップダウンメニューを作成し、ナビゲーション項目を整理できます。
```yaml {filename="hugo.yaml"}
menu:
main:
- identifier: products
name: "製品"
- name: "製品A"
parent: products
url: "/product-a"
- name: "製品B"
parent: products
url: "/product-b"
```
![ドロップダウンメニューナビゲーション](https://github.com/user-attachments/assets/1816f9b9-7fe3-46e8-9546-f15e43e9914a)
### 検索機能の強化
- **すべての見出しを検索**: ページタイトルだけでなく、すべてのレベルの見出しからコンテンツを検索
- **検索結果の精度向上**: タイトル処理とリンク精度の改善
- **結果ナビゲーションの修正**: 検索結果が正しいページセクションにリンクするようになりました
検索機能の強化に貢献してくださった [@ldez](https://github.com/ldez) に感謝します!
![強化された検索結果](https://github.com/user-attachments/assets/f819652a-95d4-4843-b7e2-c7953a8cabe8)
### llms.txt サポート
Hextra はサイトの [llms.txt](https://llmstxt.org/) 出力形式をサポートし、AIツールや言語モデルがコンテキストや参照のためにサイトをよりアクセスしやすくします。
```yaml {filename="hugo.yaml"}
outputs:
home: [html, llms]
```
これにより、サイトのルートに `llms.txt` ファイルが生成されます。
![llms txtの例](https://github.com/user-attachments/assets/c6e929bb-0fce-4ab2-af15-a71c5a38b22c)
### 目次のスクロールハイライト
ページをスクロールする際に、目次が現在のセクションを自動的にハイライトするようになり、ナビゲーションがより直感的になりました。
![目次のスクロールハイライト](https://github.com/user-attachments/assets/d623fb99-7000-428b-af95-384eb722f0eb)
### タブの同期切り替え
同じ項目を持つタブはページ全体で同期されるようになりました。同期が有効な場合、タブを選択すると同じ項目リストを共有するすべてのタブグループが更新されます(選択内容は記憶されます)。
```yaml {filename="hugo.yaml"}
params:
page:
tabs:
sync: true
```
### ブログ一覧のページネーション
ブログ一覧ページに基本的なページネーションコントロールが追加されました。
```yaml {filename="hugo.yaml"}
params:
blog:
list:
pagerSize: 20 # 1ページあたりの投稿数
```
![ブログページネーション](https://github.com/user-attachments/assets/60405fb4-ec36-4733-ba13-b4066396b5c5)
### MathJax サポート
デフォルトのKaTeXサポートに加えて、[MathJax](https://www.mathjax.org/) で数式をレンダリングできるようになりました。ニーズに合ったエンジンを選択できます。
```yaml {filename="hugo.yaml"}
params:
math:
engine: "mathjax" # デフォルトは "katex"
```
## 技術的改善
### フレームワークとビルドシステム
- **Tailwind CSS v4 移行**: [Tailwind CSS v4](https://tailwindcss.com/blog/tailwindcss-v4) への完全移行とカスタマイズサポートの改善
- **Hugoテンプレートシステム**: Hugoの[新しいテンプレートシステム](https://gohugo.io/templates/new-templatesystem-overview/) (v0.146.0+) への対応
- **数式のサーバーサイドレンダリング**: Hugoネイティブレンダリングを使用した数式レンダリングの改善
- **FlexSearch 0.8 アップグレード**: 検索エンジン [FlexSearch](https://github.com/nextapps-de/flexsearch) のアップグレードにより、CJK (中国語、日本語、韓国語) コンテンツのエンコーディング改善と高速化・精度向上
- **アセット管理の強化**: KaTeXとMermaidアセットのCDNまたはローカルからの読み込みサポート
## 利便性の向上
- **動的ファビコン切り替え**: カラースキーム設定に基づくファビコンの自動更新
- **逆順ページネーション**: ページフロントマターで `reversePagination` を設定可能に
- **Googleインデックス制御**: Googleのインデックスをブロックする新しいページパラメータ
- **幅の処理改善**: CSS変数によるレスポンシブデザイン制御の強化
- **スタイリング改善**: Markdownテーブルと水平線のモダンなスタイル
## バグ修正と安定性
- **Giscusテーマ同期**: コメントがダーク/ライトモードの切り替えに正しく追従
- **検索結果の精度**: 検索結果のリンク問題とタイトルエスケープの修正
- **タブ切り替え**: 非同期タブモードでのナビゲーション問題の解決
- **ファントムスクロール**: フッター無効時の不要なスクロール動作の修正
- **画像アクセシビリティ**: 重複したaltテキストレンダリングの防止
- **リンクレンダリング**: 複雑なサイト構造におけるベースURL処理の改善
---
## 移行ガイド
- [**Hugoバージョン要件**](#hugo-version-requirements): Hugo v0.146.0+ (extended版) が必要
- [**CSSクラスプレフィックス変更**](#css-class-prefix-changes): コンポーネントCSSクラスに一貫した `hextra-` プレフィックスを採用
- [**アセット管理**](#asset-management-for-katex-and-mermaid): KaTeXとMermaidアセットはビルド時にダウンロード
- [**Tailwind CSS v4**](#tailwind-css-v4): 内部CSSコンパイルにTailwind CSS v4.xを採用し `hx:` プレフィックスを使用
#### Hugoバージョン要件
**影響**: 古いHugoバージョンで動作しているサイト
Hextra v0.10.0 は新しいテンプレートシステムを採用しているため、Hugo v0.146.0以降 (extended版) が必要です。
**必要な対応**: Hextraをアップグレードする前にHugoをv0.146.0+に更新
#### CSSクラスプレフィックス変更
**影響**: HextraコンポーネントクラスをターゲットにしたカスタムCSSがあるサイト
Hextra v0.10.0 では、メンテナンス性向上とユーザースタイルとの衝突防止のため、ほとんどのコンポーネントCSSクラスに一貫した `hextra-` プレフィックスを導入しました。
**必要な対応**: HextraコンポーネントをターゲットにしたカスタムCSSがある場合、以下のクラス名を更新してください:
| 領域 | 変更前 | 変更後 |
| -------------------- | ---------------------------- | ------------------------------------------------- |
| 検索 (コンテナ) | `.search-wrapper` | `.hextra-search-wrapper` |
| 検索 (入力) | `.search-input` | `.hextra-search-input` |
| 検索 (結果) | `.search-results` | `.hextra-search-results` |
| 検索 (タイトル) | `.search-wrapper .title` | `.hextra-search-wrapper .hextra-search-title` |
| 検索 (アクティブ項目)| `.search-wrapper .active` | `.hextra-search-wrapper .hextra-search-active` |
| 検索 (結果なし) | `.search-wrapper .no-result` | `.hextra-search-wrapper .hextra-search-no-result` |
| 検索 (プレフィックス)| `.search-wrapper .prefix` | `.hextra-search-wrapper .hextra-search-prefix` |
| 検索 (抜粋) | `.search-wrapper .excerpt` | `.hextra-search-wrapper .hextra-search-excerpt` |
| 検索 (マッチ) | `.search-wrapper .match` | `.hextra-search-wrapper .hextra-search-match` |
| ナビバーブラー | `.nav-container-blur` | `.hextra-nav-container-blur` |
| ハンバーガーメニュー | `.hamburger-menu` | `.hextra-hamburger-menu` |
| テーマトグル | `.theme-toggle` | `.hextra-theme-toggle` |
| 言語スイッチャー | `.language-switcher` | `.hextra-language-switcher` |
| サイドバーコンテナ | `.sidebar-container` | `.hextra-sidebar-container` |
| サイドバーアクティブ項目 | `.sidebar-active-item` | `.hextra-sidebar-active-item` |
| コードファイル名 | `.filename` | `.hextra-code-filename` |
| コピーアイコン | `.copy-icon` | `.hextra-copy-icon` |
| 成功アイコン | `.success-icon` | `.hextra-success-icon` |
| ステップ | `.steps` | `.hextra-steps` |
#### KaTeXとMermaidのアセット管理
**影響**: KaTeXまたはMermaidを使用しているサイト
Hextra v0.10.0 では、KaTeXとMermaidアセットをビルド時にCDNからダウンロードするようになりました。
**変更点:**
- これらのアセットをダウンロードするため、ビルドプロセスでインターネットアクセスが必要
- ビルド後はこれらのアセットに対する外部CDN呼び出しが不要
**必要な対応**:
- アセットをダウンロードするため、ビルド環境がインターネットに接続できることを確認
- エアギャップ環境のサイトでは、これらのアセットを事前にダウンロードし、Hextraがそれらを読み込むように設定する必要がある場合があります
#### Tailwind CSS v4
**影響**: HextraのTailwindクラス `hx-*` を広範囲にカスタマイズしているサイト
HextraはTailwind CSS v4移行を内部で処理しますが、高度にカスタマイズされたサイトでは追加の調整が必要な場合があります。
**変更点:**
- 内部CSSコンパイルにTailwind CSS v4.xを使用
- ユーティリティクラスのプレフィックスが `hx-` から `hx:` に変更
## コントリビューター
このリリースは、10名の新規コントリビューターの貢献によって実現されました:
- [@oosquare](https://github.com/oosquare) - KaTeXフォント、画像レンダーフック、リンク処理の改善
- [@Zabriskije](https://github.com/Zabriskije) - ファントムスクロールの修正
- [@miniwater](https://github.com/miniwater) - カスタムフッターの中央揃え、画像altテキストの改善
- [@MattDodsonEnglish](https://github.com/MattDodsonEnglish) - Googleインデックス制御、OpenGraphドキュメント
- [@KStocky](https://github.com/KStocky) - 逆順ページネーション機能
- [@PrintN](https://github.com/PrintN) - ドキュメントショーケースの追加
- [@hobobandy](https://github.com/hobobandy) - タイトル間隔の改善
- [@dlwocks31](https://github.com/dlwocks31) - 韓国語翻訳の更新
- [@TwoAnts](https://github.com/TwoAnts) - Giscusテーマ切り替えの修正
- [@ldez](https://github.com/ldez) - 検索機能の改善とバグ修正
継続的なサポート、ドキュメント、翻訳、技術的改善を提供してくださった [@deining](https://github.com/deining) と [@yuri1969](https://github.com/yuri1969) にも感謝します。
**完全な変更履歴**: https://github.com/imfing/hextra/compare/v0.9.7...v0.10.0

247
docs/content/blog/v0.10.md Normal file
View File

@@ -0,0 +1,247 @@
---
title: "Hextra v0.10"
date: 2025-08-14
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
tags:
- Release
---
Hextra v0.10.0 is a big release packed with new capabilities, architectural upgrades, and quality-of-life improvements.
<!--more-->
It also includes contributions from 10 [new contributors](#contributors) and addresses long-standing community requests.
## Upgrade Guide
> [!IMPORTANT]
> **Breaking Changes**: This release includes several breaking changes. Please review the checklist and the [Migration Guide](#migration-guide) before upgrading.
Before upgrading to v0.10.0, ensure that you have:
- Hugo v0.146.0+ (extended version) installed
- Reviewed custom CSS for class name changes (see [CSS Class Prefix Changes](#css-class-prefix-changes) and [Tailwind CSS v4](#tailwind-css-v4))
- Verified that build environment has internet access for asset downloads when LaTeX and/or Mermaid is used
Once ready, update the Hugo module:
```bash
hugo mod get -u github.com/imfing/hextra@v0.10.0
```
## New Features
Here is a list of notable new features in this release:
- [**Dropdown Menu Support in Navbar**](#dropdown-menu-support-in-navbar): create hierarchical navigation menus
- [**Enhanced Search Experience**](#enhanced-search-experience): improved search across all headings with better accuracy
- [**llms.txt Support**](#llmstxt-support): generate AI-friendly site outline
- [**Table of Contents Scroll Highlighting**](#table-of-contents-scroll-highlighting): automatic heading highlighting during page scroll
- [**Synchronized Tab Switching**](#synchronized-tab-switching): synchronize tab selections across multiple tab groups
- [**Blog List Pagination**](#blog-list-pagination): add pagination controls to blog listing pages
- [**MathJax Support**](#mathjax-support): alternative math rendering engine alongside KaTeX
### Dropdown Menu Support in Navbar
Create dropdown menus in your navigation bar for better navigation items organization.
```yaml {filename="hugo.yaml"}
menu:
main:
- identifier: products
name: "Products"
- name: "Product A"
parent: products
url: "/product-a"
- name: "Product B"
parent: products
url: "/product-b"
```
![Dropdown menu navigation](https://github.com/user-attachments/assets/1816f9b9-7fe3-46e8-9546-f15e43e9914a)
### Enhanced Search Experience
- **Search in all headings**: find content across all heading levels, not just page titles
- **Improved result accuracy**: better title handling and linking precision
- **Fixed result navigation**: search results now link to the correct page sections
Huge thanks to [@ldez](https://github.com/ldez) for pushing the search capabilities forward!
![Enhanced search results](https://github.com/user-attachments/assets/f819652a-95d4-4843-b7e2-c7953a8cabe8)
### llms.txt Support
Hextra now supports [llms.txt](https://llmstxt.org/) output format for your site, making your site more accessible to AI tools and language models for context and reference.
```yaml {filename="hugo.yaml"}
outputs:
home: [html, llms]
```
This will generate an `llms.txt` file at your site's root.
![Example llms txt](https://github.com/user-attachments/assets/c6e929bb-0fce-4ab2-af15-a71c5a38b22c)
### Table of Contents Scroll Highlighting
The table of contents now automatically highlights the current section as you scroll through the page, making navigation more intuitive.
![ToC scroll highlighting](https://github.com/user-attachments/assets/d623fb99-7000-428b-af95-384eb722f0eb)
### Synchronized Tab Switching
Tabs with the same items now synchronize across the page. When sync is enabled, selecting a tab updates all tab groups that share the same items list (and your selection is remembered).
```yaml {filename="hugo.yaml"}
params:
page:
tabs:
sync: true
```
### Blog List Pagination
Basic pagination controls have been added to blog listing pages.
```yaml {filename="hugo.yaml"}
params:
blog:
list:
pagerSize: 20 # Posts per page
```
![Blog pagination](https://github.com/user-attachments/assets/60405fb4-ec36-4733-ba13-b4066396b5c5)
### MathJax Support
Render mathematical expressions with [MathJax](https://www.mathjax.org/) alongside the default KaTeX support. Choose the engine that best fits your needs.
```yaml {filename="hugo.yaml"}
params:
math:
engine: "mathjax" # default is "katex"
```
## Technical Improvements
### Framework and Build System
- **Tailwind CSS v4 Migration**: complete migration to [Tailwind CSS v4](https://tailwindcss.com/blog/tailwindcss-v4) with improved customization support.
- **Hugo Template System**: adapted to Hugo's [new template system](https://gohugo.io/templates/new-templatesystem-overview/) (v0.146.0+) for future compatibility.
- **Math Server-Side Rendering**: better handling of math equation rendering using Hugo native rendering by default.
- **FlexSearch 0.8 Upgrade**: upgraded search engine [FlexSearch](https://github.com/nextapps-de/flexsearch) for faster, more accurate results with improved CJK (Chinese, Japanese, Korean) content encoding.
- **Enhanced Asset Management**: KaTeX and Mermaid assets support loading from CDN or local
## Quality of Life Improvements
- **Dynamic favicon switching**: automatic favicon updates based on color scheme preferences
- **Reverse pagination**: authors can now set `reversePagination` in page front matter
- **Google indexing control**: new page parameter to block Google indexing when needed
- **Width handling improvements**: better responsive design controls via CSS variables
- **Styling improvements**: modern styles for Markdown table and horizontal line
## Bug Fixes and Stability
- **Giscus theme synchronization**: comments now properly follow dark/light mode switches
- **Search result accuracy**: fixed linking issues and title escaping in search results
- **Tab switching**: resolved navigation issues in non-synced tab mode
- **Phantom scrolling**: fixed unwanted scroll behavior when footer is disabled
- **Image accessibility**: prevented duplicate alt text rendering
- **Link rendering**: improved base URL handling for complex site structures
---
## Migration Guide
- [**Hugo Version Requirements**](#hugo-version-requirements): Requires Hugo v0.146.0+ (extended version)
- [**CSS Class Prefix Changes**](#css-class-prefix-changes): Component CSS classes now use consistent `hextra-` prefixing
- [**Asset Management**](#asset-management-for-katex-and-mermaid): KaTeX and Mermaid assets now download during build time
- [**Tailwind CSS v4**](#tailwind-css-v4): Internal CSS compilation now uses Tailwind CSS v4.x with `hx:` prefix
#### Hugo Version Requirements
**Impact**: Sites running older Hugo versions
Hextra v0.10.0 requires Hugo v0.146.0 or later (extended version) due to the new template system adoption.
**Action required**: Update Hugo to v0.146.0+ before upgrading Hextra
#### CSS Class Prefix Changes
**Impact**: Sites with custom CSS targeting Hextra component classes
Hextra v0.10.0 introduces consistent `hextra-` prefixing for majority of component CSS classes to improve maintainability and prevent conflicts with user styles.
**Action required**: If you have custom CSS targeting Hextra components, update the following class names:
| Area | Before | After |
| -------------------- | ---------------------------- | ------------------------------------------------- |
| Search (container) | `.search-wrapper` | `.hextra-search-wrapper` |
| Search (input) | `.search-input` | `.hextra-search-input` |
| Search (results) | `.search-results` | `.hextra-search-results` |
| Search (title) | `.search-wrapper .title` | `.hextra-search-wrapper .hextra-search-title` |
| Search (active item) | `.search-wrapper .active` | `.hextra-search-wrapper .hextra-search-active` |
| Search (no result) | `.search-wrapper .no-result` | `.hextra-search-wrapper .hextra-search-no-result` |
| Search (prefix) | `.search-wrapper .prefix` | `.hextra-search-wrapper .hextra-search-prefix` |
| Search (excerpt) | `.search-wrapper .excerpt` | `.hextra-search-wrapper .hextra-search-excerpt` |
| Search (match) | `.search-wrapper .match` | `.hextra-search-wrapper .hextra-search-match` |
| Navbar blur | `.nav-container-blur` | `.hextra-nav-container-blur` |
| Hamburger menu | `.hamburger-menu` | `.hextra-hamburger-menu` |
| Theme toggle | `.theme-toggle` | `.hextra-theme-toggle` |
| Language switcher | `.language-switcher` | `.hextra-language-switcher` |
| Sidebar container | `.sidebar-container` | `.hextra-sidebar-container` |
| Sidebar active item | `.sidebar-active-item` | `.hextra-sidebar-active-item` |
| Code filename | `.filename` | `.hextra-code-filename` |
| Copy icon | `.copy-icon` | `.hextra-copy-icon` |
| Success icon | `.success-icon` | `.hextra-success-icon` |
| Steps | `.steps` | `.hextra-steps` |
#### Asset Management for KaTeX and Mermaid
**Impact**: Sites using KaTeX or Mermaid
Hextra v0.10.0 now downloads KaTeX and Mermaid assets from CDN during build time.
**What's changed:**
- Build process now requires internet access to download these assets
- No more external CDN calls for these assets after build
**Action required**:
- Ensure your build environment has internet access to download assets
- Sites in air-gapped environments may need to pre-download these assets and configure Hextra to load them
#### Tailwind CSS v4
**Impact**: Sites with extensive custom CSS targeting Hextra Tailwind classes `hx-*`
While Hextra handles the Tailwind CSS v4 migration internally, sites with heavy customizations may need further adjustments.
**What's changed:**
- Internal CSS compilation now uses Tailwind CSS v4.x
- Utility classes now prefix with `hx:` rather than `hx-`
## Contributors
This release was made possible by contributions from 10 new contributors:
- [@oosquare](https://github.com/oosquare) - KaTeX fonts, image render hooks, link handling improvements
- [@Zabriskije](https://github.com/Zabriskije) - Phantom scroll fix
- [@miniwater](https://github.com/miniwater) - Custom footer centering, image alt text improvements
- [@MattDodsonEnglish](https://github.com/MattDodsonEnglish) - Google indexing controls, OpenGraph documentation
- [@KStocky](https://github.com/KStocky) - Reverse pagination feature
- [@PrintN](https://github.com/PrintN) - Documentation showcase additions
- [@hobobandy](https://github.com/hobobandy) - Title spacing improvements
- [@dlwocks31](https://github.com/dlwocks31) - Korean translation updates
- [@TwoAnts](https://github.com/TwoAnts) - Giscus theme switching fix
- [@ldez](https://github.com/ldez) - Search improvements and bug fixes
Additional thanks to returning contributors [@deining](https://github.com/deining) and [@yuri1969](https://github.com/yuri1969) for their continued support with documentation, translations, and technical improvements.
**Full Changelog**: https://github.com/imfing/hextra/compare/v0.9.7...v0.10.0

View File

@@ -0,0 +1,247 @@
---
title: "Hextra v0.10"
date: 2025-08-14
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
tags:
- Release
---
Hextra v0.10.0 是一个重大版本更新,包含多项新功能、架构升级和使用体验优化。
<!--more-->
本次更新还包含了来自 10 位 [新贡献者](#contributors) 的代码提交,并解决了社区长期期待的功能需求。
## 升级指南
> [!IMPORTANT]
> **破坏性变更**:此版本包含多项不兼容改动。升级前请仔细阅读检查清单和 [迁移指南](#migration-guide)。
升级至 v0.10.0 前,请确保:
- 已安装 Hugo v0.146.0+(扩展版)
- 检查自定义 CSS 的类名变更(参见 [CSS 类前缀变更](#css-class-prefix-changes) 和 [Tailwind CSS v4](#tailwind-css-v4)
- 确认构建环境可访问互联网以下载 LaTeX 和/或 Mermaid 资源
准备就绪后,更新 Hugo 模块:
```bash
hugo mod get -u github.com/imfing/hextra@v0.10.0
```
## 新功能
以下是本版本值得关注的新特性:
- [**导航栏下拉菜单支持**](#dropdown-menu-support-in-navbar):创建层级导航菜单
- [**增强搜索体验**](#enhanced-search-experience):改进全标题搜索精度
- [**llms.txt 支持**](#llmstxt-support):生成 AI 友好的站点大纲
- [**目录滚动高亮**](#table-of-contents-scroll-highlighting):滚动时自动高亮当前章节
- [**同步标签页切换**](#synchronized-tab-switching):跨多组标签页同步选择状态
- [**博客列表分页**](#blog-list-pagination):为博客列表添加分页控件
- [**MathJax 支持**](#mathjax-support):在 KaTeX 外新增数学公式渲染引擎
### 导航栏下拉菜单支持
在导航栏中创建下拉菜单,优化导航项组织方式。
```yaml {filename="hugo.yaml"}
menu:
main:
- identifier: products
name: "产品"
- name: "产品A"
parent: products
url: "/product-a"
- name: "产品B"
parent: products
url: "/product-b"
```
![下拉菜单导航](https://github.com/user-attachments/assets/1816f9b9-7fe3-46e8-9546-f15e43e9914a)
### 增强搜索体验
- **全标题搜索**:可搜索所有层级标题内容,不限于页面标题
- **提升结果精度**:改进标题处理和链接准确性
- **修复结果导航**:搜索结果现在能正确跳转到对应章节
特别感谢 [@ldez](https://github.com/ldez) 推动搜索功能升级!
![增强版搜索结果](https://github.com/user-attachments/assets/f819652a-95d4-4843-b7e2-c7953a8cabe8)
### llms.txt 支持
现支持生成 [llms.txt](https://llmstxt.org/) 格式输出,使站点内容更便于 AI 工具和语言模型获取上下文参考。
```yaml {filename="hugo.yaml"}
outputs:
home: [html, llms]
```
这将在站点根目录生成 `llms.txt` 文件。
![示例 llms 文本](https://github.com/user-attachments/assets/c6e929bb-0fce-4ab2-af15-a71c5a38b22c)
### 目录滚动高亮
滚动页面时,目录会自动高亮当前章节,使导航更加直观。
![目录滚动高亮效果](https://github.com/user-attachments/assets/d623fb99-7000-428b-af95-384eb722f0eb)
### 同步标签页切换
相同内容的标签页现在支持跨组同步。启用同步后,选择某个标签会更新所有包含相同项目的标签组(且会记住选择状态)。
```yaml {filename="hugo.yaml"}
params:
page:
tabs:
sync: true
```
### 博客列表分页
为博客列表页面添加基础分页控件。
```yaml {filename="hugo.yaml"}
params:
blog:
list:
pagerSize: 20 # 每页文章数
```
![博客分页效果](https://github.com/user-attachments/assets/60405fb4-ec36-4733-ba13-b4066396b5c5)
### MathJax 支持
除默认的 KaTeX 外,新增 [MathJax](https://www.mathjax.org/) 数学公式渲染引擎支持,可按需选择。
```yaml {filename="hugo.yaml"}
params:
math:
engine: "mathjax" # 默认为 "katex"
```
## 技术改进
### 框架与构建系统
- **Tailwind CSS v4 迁移**:完整迁移至 [Tailwind CSS v4](https://tailwindcss.com/blog/tailwindcss-v4),提供更好的定制支持
- **Hugo 模板系统**:适配 Hugo [新版模板系统](https://gohugo.io/templates/new-templatesystem-overview/)v0.146.0+)以确保未来兼容性
- **数学公式服务端渲染**:默认使用 Hugo 原生渲染改进数学公式处理
- **FlexSearch 0.8 升级**:搜索引擎升级至 [FlexSearch](https://github.com/nextapps-de/flexsearch) 0.8,提升 CJK中日韩内容编码处理能力
- **增强资源管理**KaTeX 和 Mermaid 资源支持从 CDN 或本地加载
## 使用体验优化
- **动态 favicon 切换**:根据色彩偏好自动更新网站图标
- **反向分页**:支持通过页面 front matter 设置 `reversePagination`
- **Google 索引控制**:新增页面参数控制是否允许 Google 索引
- **宽度处理改进**:通过 CSS 变量优化响应式设计控制
- **样式改进**:现代化 Markdown 表格和水平线样式
## 错误修复与稳定性
- **Giscus 主题同步**:评论模块现在正确跟随暗黑/明亮模式切换
- **搜索结果准确性**:修复搜索结果链接和标题转义问题
- **标签页切换**:解决非同步模式下的导航问题
- **幽灵滚动**:修复禁用页脚时出现的异常滚动行为
- **图片可访问性**:避免重复渲染 alt 文本
- **链接渲染**:改进复杂站点结构下的基础 URL 处理
---
## 迁移指南
- [**Hugo 版本要求**](#hugo-version-requirements):需 Hugo v0.146.0+(扩展版)
- [**CSS 类前缀变更**](#css-class-prefix-changes):组件 CSS 类现统一使用 `hextra-` 前缀
- [**资源管理**](#asset-management-for-katex-and-mermaid)KaTeX 和 Mermaid 资源改为构建时下载
- [**Tailwind CSS v4**](#tailwind-css-v4):内部 CSS 编译现使用 Tailwind CSS v4.x 并采用 `hx:` 前缀
#### Hugo 版本要求
**影响**:使用旧版 Hugo 的站点
Hextra v0.10.0 因采用新模板系统,要求 Hugo v0.146.0 或更高版本(扩展版)。
**需执行操作**:升级 Hextra 前先更新 Hugo 至 v0.146.0+
#### CSS 类前缀变更
**影响**:自定义 CSS 中引用了 Hextra 组件类的站点
v0.10.0 为大多数组件 CSS 类引入统一的 `hextra-` 前缀,以提高可维护性并避免与用户样式冲突。
**需执行操作**:如果自定义 CSS 中引用了 Hextra 组件,请更新以下类名:
| 区域 | 旧类名 | 新类名 |
| -------------------- | -------------------------- | ----------------------------------------------- |
| 搜索(容器) | `.search-wrapper` | `.hextra-search-wrapper` |
| 搜索(输入框) | `.search-input` | `.hextra-search-input` |
| 搜索(结果) | `.search-results` | `.hextra-search-results` |
| 搜索(标题) | `.search-wrapper .title` | `.hextra-search-wrapper .hextra-search-title` |
| 搜索(活动项) | `.search-wrapper .active` | `.hextra-search-wrapper .hextra-search-active` |
| 搜索(无结果) | `.search-wrapper .no-result` | `.hextra-search-wrapper .hextra-search-no-result` |
| 搜索(前缀) | `.search-wrapper .prefix` | `.hextra-search-wrapper .hextra-search-prefix` |
| 搜索(摘要) | `.search-wrapper .excerpt` | `.hextra-search-wrapper .hextra-search-excerpt` |
| 搜索(匹配项) | `.search-wrapper .match` | `.hextra-search-wrapper .hextra-search-match` |
| 导航栏模糊效果 | `.nav-container-blur` | `.hextra-nav-container-blur` |
| 汉堡菜单 | `.hamburger-menu` | `.hextra-hamburger-menu` |
| 主题切换 | `.theme-toggle` | `.hextra-theme-toggle` |
| 语言切换器 | `.language-switcher` | `.hextra-language-switcher` |
| 侧边栏容器 | `.sidebar-container` | `.hextra-sidebar-container` |
| 侧边栏活动项 | `.sidebar-active-item` | `.hextra-sidebar-active-item` |
| 代码文件名 | `.filename` | `.hextra-code-filename` |
| 复制图标 | `.copy-icon` | `.hextra-copy-icon` |
| 成功图标 | `.success-icon` | `.hextra-success-icon` |
| 步骤组件 | `.steps` | `.hextra-steps` |
#### KaTeX 和 Mermaid 资源管理
**影响**:使用 KaTeX 或 Mermaid 的站点
v0.10.0 改为在构建时从 CDN 下载 KaTeX 和 Mermaid 资源。
**变更内容:**
- 构建过程需要联网下载这些资源
- 构建后不再需要外部 CDN 调用
**需执行操作:**
- 确保构建环境可访问互联网以下载资源
- 隔离环境中的站点需预下载资源并配置 Hextra 加载路径
#### Tailwind CSS v4
**影响**:大量自定义 CSS 引用了 `hx-*` 类名的站点
虽然 Hextra 内部已处理 Tailwind CSS v4 迁移,但深度定制的站点可能需要额外调整。
**变更内容:**
- 内部 CSS 编译使用 Tailwind CSS v4.x
- 工具类前缀改为 `hx:` 而非 `hx-`
## 贡献者
本次发布得益于 10 位新贡献者的代码提交:
- [@oosquare](https://github.com/oosquare) - KaTeX 字体、图片渲染钩子、链接处理改进
- [@Zabriskije](https://github.com/Zabriskije) - 修复幽灵滚动问题
- [@miniwater](https://github.com/miniwater) - 自定义页脚居中、图片 alt 文本优化
- [@MattDodsonEnglish](https://github.com/MattDodsonEnglish) - Google 索引控制、OpenGraph 文档
- [@KStocky](https://github.com/KStocky) - 反向分页功能
- [@PrintN](https://github.com/PrintN) - 文档展示增强
- [@hobobandy](https://github.com/hobobandy) - 标题间距优化
- [@dlwocks31](https://github.com/dlwocks31) - 韩语翻译更新
- [@TwoAnts](https://github.com/TwoAnts) - 修复 Giscus 主题切换
- [@ldez](https://github.com/ldez) - 搜索功能改进与错误修复
同时感谢长期贡献者 [@deining](https://github.com/deining) 和 [@yuri1969](https://github.com/yuri1969) 在文档、翻译和技术改进方面的持续支持。
**完整更新日志**https://github.com/imfing/hextra/compare/v0.9.7...v0.10.0

View File

@@ -0,0 +1,128 @@
---
title: "Hextra v0.11"
date: 2025-08-30
authors:
- name: imfing
link: https://github.com/imfing
image: https://github.com/imfing.png
tags:
- انتشار
---
Hextra v0.11.0 بر صیقل UX و مؤلفه‌های جدید کاربردی تمرکز دارد: بنر سراسری سایت، کال‌اوت‌ها و بج‌های بهبودیافته، کارت‌های غنی‌تر، یکپارچه‌سازی تحلیل‌گرها، و چند بهبود ناوبری. همچنین شامل رفع اشکالات پایداری و به‌روزرسانی‌های مستندات است.
<!--more-->
## راهنمای ارتقا
برای بیشتر سایت‌ها تغییر شکست‌آمیزی وجود ندارد. با استفاده از [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
[Callout]({{% relref "docs/guide/shortcodes/callout" %}}) برای خوانایی بهتر و تأکید مناسب در تمام تم‌ها بازطراحی شده است.
![بازطراحی 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](https://www.asciinema.org/) و [شورت‌کد Asciinema]({{% relref "docs/guide/shortcodes/asciinema.md" %}}) ضبط‌های ترمینال را درون‌گذاری کنید.
```md
{{</* asciinema id="123456" autoplay=true loop=true */>}}
```
![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
```
### فعال‌سازی مسیر راهنما
با قرار دادن `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
- نوار ناوبری: بهبود موقعیت و تعاملات منو
## مستندات و بومی‌سازی
- مستندات: صفحهٔ جدیدی دربارهٔ شورت‌کدهای Hextra
- i18n: افزودن ترجمه‌های `copyCode` و `system` به `zh-cn`
---
**تغییرات کامل**: https://github.com/imfing/hextra/compare/v0.10.2...v0.11.0

View File

@@ -0,0 +1,128 @@
---
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 は、UX の磨き込みと便利な新コンポーネントに注力したリリースです。サイト全体バナー、改良されたコールアウトとバッジ、よりリッチなカード、アナリティクス連携、そしていくつかのナビゲーション改善を含みます。安定性の修正とドキュメント更新も同梱しています。
<!--more-->
## アップグレードガイド
ほとんどのサイトで破壊的変更はありません。[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](https://www.asciinema.org/) の端末録画を、新しい [Asciinema ショートコード]({{% relref "docs/guide/shortcodes/asciinema.md" %}}) で埋め込みできます。
```md
{{</* asciinema id="123456" autoplay=true loop=true */>}}
```
![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
```
### パンくずリストの有効化
フロントマターで `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
- Docs: Hextra のショートコードをまとめた新ページ
- i18n: `zh-cn` に `copyCode` と `system` の翻訳を追加
---
**完全な変更履歴**: https://github.com/imfing/hextra/compare/v0.10.2...v0.11.0

128
docs/content/blog/v0.11.md Normal file
View File

@@ -0,0 +1,128 @@
---
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 focuses on UX polish and useful new components: site-wide banner, improved callouts and badges, richer cards, analytics integrations, and several navigation refinements. It also ships stability fixes and documentation updates.
<!--more-->
## Upgrade Guide
No breaking changes are expected for most sites. Update using [Hugo Modules](https://gohugo.io/hugo-modules/use-modules/):
```bash
hugo mod get -u github.com/imfing/hextra
```
## Highlights
- Top banner component for announcements
- Revamped callouts with clearer styles
- Umami and Matomo analytics support
- Asciinema shortcode for terminal recordings
- External link decoration option
- Breadcrumbs for single pages (non-docs, non-blogs)
- Navbar enhancements: icon link item and improved positions
- Improved badges and cards customization
- Theme toggle supports "System"
## New Features
### Top Banner
Add a site-wide, dismissible banner for announcements, launches, or status messages.
```yaml {filename="hugo.yaml"}
params:
banner:
key: "announcement"
message: Welcome!
```
![Top Banner](https://github.com/user-attachments/assets/33a08c9b-db84-4200-b37c-1a53c1bef08d)
### Callout Revamp
[Callout]({{% relref "docs/guide/shortcodes/callout" %}}) receive a design refresh for better readability and emphasis across themes.
![Callout refresh](https://github.com/user-attachments/assets/b3154dbb-e582-4c84-a8b8-1ecb02c3464d)
### Analytics: Umami and Matomo
Built-in configuration for analytics providers:
- [Umami]({{% relref "docs/guide/configuration.md#umami-analytics" %}})
- [Matomo]({{% relref "docs/guide/configuration.md#matomo-analytics" %}})
### Asciinema Shortcode
Embed terminal recordings from [Asciinema](https://www.asciinema.org/) using the new [Asciinema shortcode]({{% relref "docs/guide/shortcodes/asciinema.md" %}}).
```md
{{</* asciinema id="123456" autoplay=true loop=true */>}}
```
![Asciinema](https://github.com/user-attachments/assets/3c33a8ef-3c01-4e30-9832-3ccb784ec538)
### Navbar Enhancements
- Support icons for link items in the navbar
- Refine menu positions to play nicely with the language switcher and other items
![Navbar with icon item](https://github.com/user-attachments/assets/6c035eee-cd7d-44d8-bcf7-9cbd7f92ab42)
Notably, version [0.10.2](https://github.com/imfing/hextra/releases/tag/v0.10.2) enables the addition of language switchers and theme toggles to the navbar.
### External Link Decoration
Optionally add a subtle external-link decoration to outbound links.
```yaml {filename="hugo.yaml"}
params:
externalLinkDecoration: true
```
### Breadcrumbs Enablement
Enable breadcrumbs on single pages (non-docs, non-blogs) by setting `breadcrumbs: true` in front matter.
```yaml {filename="content/about.md"}
---
title: About
breadcrumbs: true
---
```
### Cards and Badges Improvements
- [Cards]({{% relref "docs/guide/shortcodes/cards.md" %}}): new `tagIcon` and `tagBorder` options.
- [Badges]({{% relref "docs/guide/shortcodes/others.md" %}}): new colors and border styles.
## Quality of Life
- Theme toggle: add "System" option
![Theme toggle](https://github.com/user-attachments/assets/54a1d315-9243-4814-9154-6e63af9ea2e8)
- Typography: better task list styles with checkboxes
![Task list](https://github.com/user-attachments/assets/53722651-63b6-4469-95e7-326849a30306)
- Language switcher: improved ordering with icon menu items
## Fixes
- Giscus: sync theme and language properly
- Cards: fix badge rendering with RTL
- Navbar: refine menu positions and interactions
## Documentation & i18n
- Docs: new page covering Hextra shortcodes
- i18n: add `copyCode` and `system` translations to `zh-cn`
---
**Full Changelog**: https://github.com/imfing/hextra/compare/v0.10.2...v0.11.0

View File

@@ -0,0 +1,129 @@
---
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 专注于打磨使用体验并带来数个实用新组件:站点级顶部横幅、改进的提示框与徽章、更丰富的卡片、分析工具集成,以及多项导航优化。同时包含稳定性修复和文档更新。
<!--more-->
## 升级指南
对大多数站点而言没有破坏性变更。使用 [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 id="123456" autoplay=true loop=true */>}}
```
![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