基于 Fuse.js 的动态模糊搜索,支持关键词、父/子分类、单标签及多标签 AND/OR 组合查询
hugo-seotax — Hugo 博客模板
作者 minyeamer
hugo-seotax 是一个 Hugo 博客主题,围绕分类与标签的动态搜索来帮助读者发现内容,支持多语言界面、深色模式与系列文章导航。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
两级分类体系与可配置的分类菜单顺序,侧边栏可展示分类树和最近文章
27 种语言的客户端界面翻译,切换语言不刷新页面、不改变 URL
深色模式跟随系统偏好,支持键盘快捷键切换,并同步 Disqus 评论区
Mac 风格代码块,含 highlight.js 语法高亮、行号、复制按钮与语言标签
系列文章导航、Schema.org 结构化数据、PWA 预缓存与 giscus/Disqus 评论支持
模板详细介绍
hugo-seotax 是一个面向博客的 Hugo 主题,名称来自 Search 与 Taxonomies 的组合,核心思路是让读者通过搜索和分类筛选来发现文章,而不是依赖大量按标签或分类生成的静态页面。主题提供基于 Fuse.js 的动态模糊搜索,支持关键词、父分类、子分类、单个标签以及多标签 AND/OR 组合共五种查询方式,并可通过 / 或 s 快捷键或点击搜索栏触发。
分类体系采用两级结构:front matter 中 categories 的第一项为父分类,第二项为子分类;侧边栏可显示分类树与最近文章,分类顺序可通过 params.menu.categoryOrder 按 weight 配置。文章列表排序可配置为最新、最旧或关闭,搜索页另有 relevance、newest、oldest、disabled 四种排序模式。
主题包含 27 种语言的客户端界面翻译,语言切换在工具栏即时完成,不刷新页面也不改变 URL;这与 Hugo 自身的多语言内容系统相互独立。多语言站点下,搜索索引与搜索资源按内容语言分别生成,结果不会跨语言混合。
其他功能包括:深色模式(跟随系统偏好,可用 Cmd/Ctrl + Shift + S 切换,并同步 Disqus 评论区)、响应式布局(可折叠侧边栏、移动端覆盖式目录、自适应缩略图)、Mac 风格代码块(highlight.js 语法高亮、行号、复制按钮、语言标签)、系列文章导航、Schema.org 结构化数据、IcoMoon 子集图标字体、PWA Service Worker 预缓存、Disqus 与 giscus 评论,以及基于文本、图片、代码块和表格计算的阅读时间。
使用限制方面:主题要求 Hugo 0.158 或更高版本的 extended 版本;推荐通过 disableKinds 关闭 term 类型以避免生成大量标签静态页;图片相关配置需使用 params.images 而非 params.image;params.posts.sort 设为 disabled 时首页仍按最新优先,post-list 页面可单独设置 params.sort。远程图片若需在构建时提取尺寸以防止 CLS,需将副本存放在 assets/_images/ 下。
适合你的项目吗?
适用场景
- 搭建以分类和标签检索为主要浏览方式的个人技术博客
- 需要多语言界面但不想为每种语言重复生成页面的站点
- 希望用单个动态搜索页替代大量按标签/分类生成的静态页面的博客
- 需要系列文章连续阅读、代码块展示和深色模式的开发者写作场景
适合人群
- 使用 Hugo 并熟悉 YAML/TOML 配置的博客作者
- 内容按两级分类与标签组织的技术写作站点
- 需要客户端多语言界面与深色模式的个人站点
- 希望减少静态分类页数量、以搜索为主要入口的博客
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
需要 Hugo 0.158 或更高版本的 extended 版本
- 2
可通过 Git submodule、Hugo Module 或复制 exampleSite 三种方式安装
- 3
建议在配置中设置 disableKinds: ["term"],用单个动态搜索页替代按标签生成的静态页
- 4
图片相关参数使用 params.images,远程图片需在 assets/_images/ 存放副本以在构建时提取尺寸
- 5
params.posts.sort 设为 disabled 时首页仍按最新优先,post-list 页面可单独设置 params.sort
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 使用该主题需要 Hugo 0.158 或更高版本的 extended 版本,低于此版本或非 extended 版本无法正常构建。
- 官方建议在配置中通过 disableKinds 关闭 term 类型,以避免生成大量按标签划分的静态页面;这是推荐配置而非强制要求。
- 图片相关配置必须使用 params.images 而非 params.image,写错参数名将无法生效。
- 若希望在构建时提取远程图片尺寸以防止 CLS,需要把远程图片副本存放在 assets/_images/ 目录下,否则无法获得该优化。
- params.posts.sort 设为 disabled 时仅隐藏排序控件,首页仍按最新优先排序,并非关闭排序功能。
- 搜索页 params.search.sort 设为 disabled 只隐藏排序控件,搜索页仍按默认最新优先处理并响应 sort 查询参数。
- 评论功能需在 giscus 或 disqus 之间选择其一并配置对应参数(如 repo、repoId、shortname),否则评论不可用。
- 如需站点分析,需自行提供 Google Analytics 的 tagId;该功能依赖外部服务。
- 搜索引擎验证需自行填写 Google、Naver、Bing、Yandex 各自的验证码,依赖外部平台账号。
- 部分短代码组件(columns、hint、mermaid、katex、tabs、details)复用自 Hugo Book 项目,使用时需注意其来源。
- 图标使用 IcoMoon 子集字体,新增图标需在 IcoMoon 重新生成子集字体并更新 icon.css。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
- Hugo **0.158** or higher (extended version)
README 原文
# Recommended: use a single dynamic search page instead of per-tag static pages disableKinds: ["term"]
README 原文
Use `params.images`, not `params.image`.
README 原文
Store copies of remote images locally in assets/_images/ for build-time dimension extraction
README 原文
Set it to `disabled` to hide the sort control; the home page then uses newest-first order
README 原文
`disabled` hides the sort control only; the search page continues to process its default newest-first order and any `sort` query parameter.
README 原文
provider: "giscus" # "giscus" | "disqus"
README 原文
GoogleAnalytics: tagId: "G-XXXXXXXXXX"
README 原文
siteVerificationTag: "google-site-verification-code"
README 原文
SeoTax reuses the following shortcode components from Hugo Book.
README 原文
https://github.com/minyeamer/hugo-seotax/blob/main/LICENSEhttps://github.com/minyeamer/hugo-seotax/blob/main/README.mdThe theme uses an [IcoMoon](https://icomoon.io/) subset font with 26 icons.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 83 / 100
- 技术栈
- Hugo
- 网站类型
- 博客
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-20
- 截图检查日期
- 2026-10-01
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Hugo。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 532b591c45cc37bd665e2e45f142b71546c7ecffa2223052ba2058184e80d302
2026-10-01T14:00:28.250Z
来源文件 / 仓库# Hugo SeoTax Theme
[](https://gohugo.io)
[](LICENSE)
### A Hugo blog theme with dynamic taxonomy search and reader-first experience
> **SeoTax** = **Sea**rch + **Tax**onomies — built around the idea
> that readers should discover content effortlessly.

- [Features](#features)
- [Demo](#demo)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Page Layouts](#page-layouts)
- [Shortcodes](#shortcodes)
- [Customization](#customization)
- [Contributing](#contributing)
## Features
- **Dynamic Search** — Fuse.js-powered fuzzy search with instant results; no extra static pages generated
- **Advanced Taxonomy Filters** — Filter by category, tag, or combination without a keyword
- **Configurable List Sorting** — Choose newest or oldest post lists, plus relevance sorting for search and optional sort controls
- **27-Language i18n** — Client-side translation; no page reload, no per-language page duplication
- **Dark Mode** — Auto-detects system preference; toggleable with keyboard shortcut (`Cmd/Ctrl + Shift + S`)
- **Responsive Design** — Collapsible sidebar, overlay ToC on mobile, adaptive thumbnails
- **Mac-style Code Blocks** — Syntax highlighting (highlight.js), line numbers, copy button, language label
- **Series Support** — Velog-style series navigation across related posts
- **SEO Optimized** — Schema.org structured data, CLS < 0.01, optimized Core Web Vitals
- **Lightweight Icons** — IcoMoon subset font (~40 KB vs 800+ KB Font Awesome)
- **PWA Ready** — Service Worker with precache support
- **Disqus Comments** — With dark mode synchronization
- **Reading Time** — Calculated from text, images, code blocks, and tables
### Search

A single dynamic search page replaces hundreds of per-tag/per-category static pages.
Search is triggered via the `/` or `s` hotkey, or by clicking the search bar.
Supports 5 query types: keyword search, parent category, child category,
single tag, and multi-tag with AND/OR operators.
### Internationalization

All 27 languages are served from a single HTML page. The language switcher
in the toolbar translates UI text, dates, and ARIA labels instantly on
the client side — no page navigation, no URL changes.
### Dark Mode

Switches between light and dark themes using CSS variables on a single
`data-theme` attribute. Persisted in `localStorage`. Disqus comments are
synchronized via iframe reload.
### Code Blocks

Mac-style window dots, line numbers (with copy exclusion), one-click copy
with visual feedback, and a language label chip. Light theme uses
**Xcode** colors; dark theme uses **VS2015** colors.
## Demo
| Desktop | Mobile |
|---------|--------|
|  |  |
|  |  |
|  |  |
## Requirements
- Hugo **0.158** or higher (extended version)
- [Hugo Installation Guide](https://gohugo.io/installation/)
## Installation
### As a Git Submodule
```bash
cd your-hugo-site
git submodule add https://github.com/minyeamer/hugo-seotax themes/seotax
```
Then set the theme in your configuration file:
```yaml
theme: "seotax"
```
### As a Hugo Module
Initialize Hugo modules if not already done:
```bash
hugo mod init github.com/your/repo
```
Add to your `hugo.toml`:
```toml
[module]
[[module.imports]]
path = 'github.com/minyeamer/hugo-seotax'
```
Then fetch the module and run:
```bash
hugo mod get -u
hugo server --minify
```
### From Scratch
```bash
hugo new site myblog && cd myblog
git init
git submodule add https://github.com/minyeamer/hugo-seotax themes/seotax
cp -R themes/seotax/exampleSite/* .
hugo server --minify
```
## Configuration
### Site Configuration
Below is a full `config.yaml` example with all supported parameters:
```yaml
baseURL: "https://example.com/"
title: "My Blog"
theme: "seotax"
defaultContentLanguage: "en"
languageCode: "en"
enableRobotsTXT: true
buildDrafts: false
buildFuture: false
buildExpired: false
enableEmoji: true
# Recommended: use a single dynamic search page instead of per-tag static pages
disableKinds: ["term"]
minify:
disableXML: true
minifyOutput: true
# SEO-friendly URL structure
permalinks:
posts: "/blog/:slugorcontentbasename/"
markup:
goldmark:
extensions:
typographer:
disable: true
renderer:
unsafe: true
highlight:
noClasses: false
codeFences: true
tableOfContents:
startLevel: 2
endLevel: 4
params:
author: "Your Name"
keywords: ["blog", "tech"]
posts:
section: "posts" # Content section for blog posts
sort: "newest" # ["newest" | "oldest" | "disabled"]
# Search
search:
enabled: true
sort: "newest" # ["relevance" | "newest" | "oldest" | "disabled"]
assets:
favicon: "/images/favicon.ico"
favicon16x16: "/images/favicon-16x16.png"
favicon32x32: "/images/favicon-32x32.png"
apple_touch_icon: "/images/apple-touch-icon.png"
safari_pinned_tab: "/images/safari-pinned-tab.svg"
opengraph: "/images/og.jpg"
# Sidebar menu
menu:
profileImage: "/images/profile.jpg" # Sidebar profile image
categories: true # Show category tree
recentPosts: true # Show recent posts list
social:
github: "https://github.com/username"
twitter: "https://x.com/username"
# Comments
comments:
enabled: true
provider: "giscus" # "giscus" | "disqus"
# disqus:
# shortname: "your-shortname"
# giscus:
# repo: "owner/repo"
# repoId: "R_kgDO..."
# category: "Comments"
# categoryId: "DIC_kwDO..."
# mapping: "pathname"
# inputPosition: "bottom"
# i18n translation directory
i18nDir: "themes/seotax/i18n"
# Image CLS prevention (optional)
# Store copies of remote images locally in assets/_images/ for build-time dimension extraction
images:
rootPath: "_images"
maxImageSize: 1920
roundedCorners: false
rotateLandscapeImages: true
# Enable Hugo portable links for relative Markdown links and images
portableLinks: true
# PWA Service Worker ("precache" to enable)
serviceWorker: "precache"
# Table of Contents
tableOfContents:
startLevel: 2
endLevel: 4
# Optional per-page ToC toggle default
toc:
enabled: true
# Analytics
GoogleAnalytics:
tagId: "G-XXXXXXXXXX"
# Search engine verification
searchEngine:
google:
siteVerificationTag: "google-site-verification-code"
naver:
siteVerificationTag: "naver-site-verification-code"
bing:
siteVerificationTag: "bing-site-verification-code"
yandex:
siteVerificationTag: "yandex-site-verification-code"
# Schema.org structured data
schema:
publisherType: "Person"
sameAs:
- "https://github.com/username"
```
### Static Post Lists
`params.posts.sort` controls the sort order of the home page.
The default sort uses `/` and `/page/2/`; the example site also provides
static archive pages at `/list/newest/` and `/list/oldest/`, with additional
pages under `/page/2/`.
Set it to `disabled` to hide the sort control; the home page then uses newest-first
order, while a `post-list` page can still set its own `params.sort`.
Create matching list index files for each content language to enable the
archive routes in your site:
```yaml
# content/en/list/oldest/_index.md
title: "Oldest posts"
type: "post-list"
params:
sort: "oldest"
```
Create the equivalent `newest` page and translated files for each additional language.
If `params.sort` is omitted in a `post-list` page, it falls back to `params.posts.sort`.
### Search Sort
`params.search.sort` controls the default sort mode of `/search`.
Supported values are `relevance`, `newest`, `oldest`, and `disabled`.
`disabled` hides the sort control only; the search page continues to process
its default newest-first order and any `sort` query parameter.
- When the current sort matches `params.search.sort`, the search page omits
the `sort` query parameter.
- When the user selects a different sort, SeoTax writes `?sort=...` into the
search URL and reorders the current results on the client.
### Category Menu Order
Set `params.menu.categoryOrder` to control the sidebar category order. Lower
`weight` values are shown first; categories without a configured weight follow
in alphabetical order.
```yaml
params:
menu:
categoryOrder:
- name: "Guide"
weight: 10
- name: "Features"
weight: 20
```
For a multilingual site, place the same setting under each language's `params`
to define language-specific names and ordering. The order is applied to both
parent and child categories.
### Image Settings
Use `params.images`, not `params.image`.
- `rootPath` sets the asset directory used to resolve local image dimensions during the build.
- `maxImageSize` limits the resized image width used for CLS prevention.
- `roundedCorners` adds rounded styling to rendered Markdown images and the `image` shortcode.
- `rotateLandscapeImages` rotates landscape images in the image zoom viewer on narrow screens.
### Multi-Language Support
SeoTax supports Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/).
When multiple languages are configured, a language selector appears in the sidebar menu.
```yaml
languages:
en:
languageName: "English"
weight: 1
ko:
languageName: "한국어"
weight: 2
```
In addition, the theme includes **client-side i18n** for UI elements
(menus, labels, dates) across 27 languages. This works independently of
Hugo's multilingual content system and requires no extra configuration.
The Hugo language menu opens a translated page when one exists. On localized
taxonomy, search, and list pages without a page translation, it preserves the
current path in the selected language and carries query parameters and hashes
across. Search indexes and generated search assets are scoped per content
language, so results do not mix between languages.
### Post Front Matter
```yaml
---
title: "My Post Title"
date: 2026-01-01
summary: "A brief description of the post."
categories: ["Parent Category", "Child Category"]
tags: ["tag1", "tag2"]
series: ["Series Name"]
cover:
image: "/images/cover.jpg"
---
```
The theme uses a **two-level category hierarchy**.
The first item in `categories` is the parent; the second is the child.
Previous/next navigation prioritizes posts within the same child category,
then parent category, then all posts.
## Page Layouts
| Page | Description |
|------|-------------|
| **Home** | Post list with title, summary, date, categories, tags, and cover thumbnail. Pagination with 10 posts per page. |
| **Single Post** | Header with category breadcrumb, title, date, reading time, cover image, content, tags, prev/next navigation, and Disqus comments. |
| **Search** | Dynamic search page with keyword, category, and tag filters. Accessed via the search modal, category/tag chips, or the sidebar. |
| **Categories** | Two-level category tree with post counts. Up to 3 posts are shown per category with a "see more" link. |
| **Tags** | All tags displayed as clickable chips. |
## Shortcodes
### Hugo Book Shortcode Components
SeoTax reuses the following shortcode components from Hugo Book.
| Shortcode | Description |
|-----------|-------------|
| `{{</* columns */>}}` | Multi-column flexbox layout with `<--->` separator and optional `ratio` parameter |
| `{{</* hint [info\|success\|warning\|danger] */>}}` | Colored callout boxes |
| `{{</* mermaid */>}}` | Mermaid diagrams |
| `{{</* katex */>}}` | KaTeX math equations |
| `{{</* tabs */>}}` | Tabbed content panels |
| `{{</* details */>}}` | Collapsible content blocks |
### SeoTax Custom
#### Bookmark
Generates a rich link card by fetching Open Graph metadata from a URL.
```markdown
{{</* bookmark url="https://example.com" */>}}
```
Optional overrides: `title`, `description`, `image`, `fetch` (default `true`).
#### Data Table
Renders CSV-formatted text as a styled HTML table.
```markdown
{{</* data-table delimiter="," headers="1" file-name="data.csv" */>}}
Name,Age,City
Alice,30,Seoul
Bob,25,Tokyo
{{</* /data-table */>}}
```
Supports `align-center`, `enable-download`, and custom `class`.
#### Image
Enhanced image shortcode with click-to-zoom, automatic CLS prevention, and full layout control.
```markdown
{{</* image src="/images/photo.jpg" alt="Description" caption="Figure 1" max-width="600px" */>}}
```
Parameters: `src`, `alt`, `caption`, `class`, `loading`, `align`, `href`,
`target`, `width`, `min-width`, `max-width`, `height`, `min-height`,
`max-height`.
On mobile, landscape images rotate 90° when tapped for full-screen viewing.
#### Series
Velog-style series navigation that groups posts sharing the same `series` front matter value.
```markdown
{{</* series "My Tutorial Series" */>}}
```
Optional second parameter: regex pattern to strip common prefixes from titles.
Includes collapsible post list and prev/next links.
## Customization
### Overriding Styles
Create `assets/css/_custom.scss` in your site root to add or override styles:
```scss
// Example: change link color
:root {
--color-link: #0055bb;
}
```
### SCSS Variables
Key variables are defined in `assets/css/variables/`:
| File | Contents |
|------|----------|
| `_colors.scss` | Color palette and theme mixins (`theme-light`, `theme-dark`) |
| `_defaults.scss` | Spacing, font sizes, border radii, breakpoints, z-indices |
| `_fonts.scss` | Font family definitions |
### Icons
The theme uses an [IcoMoon](https://icomoon.io/) subset font with 26 icons.
Icon classes follow the pattern `icon-*`
(e.g., `icon-search`, `icon-folder`, `icon-moon`). To add more icons,
regenerate the subset font and update `assets/css/main/icon.css`.
### Directory Structure
```
seotax/
├── archetypes/ # Post templates
├── assets/
│ ├── css/ # SCSS source files
│ │ ├── main/ # Normalize, icons, utilities, print
│ │ ├── themes/ # Light/dark theme definitions
│ │ └── variables/ # Colors, defaults, fonts
│ ├── data/ # Build-time JSON (search index, categories, tags, i18n)
│ ├── js/
│ │ ├── core/ # Theme toggle, i18n, toolbar, sidebar
│ │ ├── partials/ # Reading time, ToC, image overlay, pagination
│ │ ├── search/ # Search engine, filters, rendering
│ │ └── shortcodes/ # Series, data-table, code block scripts
│ ├── main.scss # SCSS entry point
│ └── sw.js # Service Worker
├── i18n/ # 27 language YAML translation files
├── layouts/
│ ├── _markup/ # Render hooks (code blocks, images, links)
│ ├── _partials/ # Template partials (menu, header, footer, content)
│ ├── _shortcodes/ # Shortcode templates
│ ├── baseof.html # Base layout
│ ├── index.html # Home page
│ ├── list.html # List page
│ └── single.html # Single post page
├── static/ # Static assets (fonts, images)
└── theme.toml
```
## Performance
The theme is optimized for Core Web Vitals:
| Metric | Score |
|--------|-------|
| CLS | 0.002 |
| TBT | 0 ms |
| Performance | 82+ |
Optimizations include: build-time image dimension extraction to prevent
layout shifts, subset icon font to minimize font loading impact, hybrid
server/client reading time calculation, and `font-display: swap` for zero FOIT.
## Contributing
Contributions are welcome. Primary goals:
- Keep it simple and focused on blog use cases
- Minimize JavaScript where CSS can solve the problem
- Maintain cross-browser compatibility
- Preserve the reader-first exploration experience
Feel free to open issues or pull requests on [GitHub](https://github.com/minyeamer/hugo-seotax).
## License
[MIT](LICENSE)
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

hugo-PaperMod
PaperMod 是 Hugo 生态里知名度较高的主题之一,定位很明确:给博客和轻量作品集站点提供一套干净、响应式的阅读界面。
Hugo · 作品集

LoveIt
❤️A clean, elegant but advanced blog theme for Hugo 一个简洁、优雅且高效的 Hugo 主题
Hugo · 博客

hugo-coder
A minimalist blog theme for hugo.
Hugo · 博客

blowfish
Personal Website & Blog Theme for Hugo
Hugo · 博客

hugo-paper
🪺 A simple, clean, customizable Hugo theme
Hugo · 博客

hextra
Hextra 是一个 Hugo 主题,定位在文档站与博客之间:既提供侧边栏导航、目录、面包屑、分页这类文档站结构,也能承载博客内容。
Hugo · 文档
