Skip to content

Commit 27dfe61

Browse files
author
lzm
committed
feat(blog): enable 'series' taxonomy
Hugo's default taxonomies (categories, tags) are preserved by listing them explicitly alongside the new series entry: taxonomies: category: categories tag: tags series: series With this, a post can declare 'series: [Hugo折腾笔记]' in front matter and Hugo will auto-generate /series/<slug>/ landing pages via PaperMod's existing taxonomy.html — no custom list template needed. Archetype picks up a commented '# series: []' example so the next 'hugo new posts/...' session shows the field without having to read this commit message.
1 parent 57da574 commit 27dfe61

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎archetypes/default.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ draft: true
66
# description: "" # SEO 摘要,会出现在 RSS 和 meta description
77
# tags: [] # 标签,例如: [Python, 异步]
88
# categories: [] # 分类,例如: [编程笔记]
9+
# series: [] # 系列文章(多篇同系列),例如: ["Hugo折腾笔记"];按发布时间升序显示
910
ShowToc: true # 是否显示右侧目录(默认开启;如不需要可注释掉)
1011
TocOpen: false # 目录默认折叠;改成 true 让目录默认展开
1112
# cover:

‎hugo.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ defaultContentLanguage: zh-cn
1010
defaultContentLanguageInSubdir: false
1111
languageCode: zh-CN
1212

13+
# ---------- Taxonomies ----------
14+
# Hugo 默认是 categories + tags;显式列出以保留默认并新增 series。
15+
# `series` 让任意 post 可以 front-matter 写 `series: [名名]` 即可归入
16+
# 一个系列——PaperMod 的 taxonomy.html 自动渲染 /series/<名名>/ 列表。
17+
taxonomies:
18+
category: categories
19+
tag: tags
20+
series: series
21+
1322
# ---------- PaperMod 主题参数 ----------
1423
params:
1524
env: production

0 commit comments

Comments
 (0)