单栏排版优先的版式,不依赖 JavaScript 框架
hugo-theme-lucent — Hugo 博客模板
作者 simple-is-awesome
Lucent 是一个面向 Hugo 的单栏博客主题,以排版为核心,不依赖 JavaScript 框架,内置深色模式、客户端搜索、目录、归档、KaTeX、giscus 评论与中英文界面。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
深色/浅色模式跟随系统并记忆用户选择,加载时无闪烁
由 Hugo 生成 JSON 索引、原生 JS 实现的客户端搜索
可折叠目录、按年份分组的归档页与带计数的标签云
代码块复制按钮、双模式语法高亮与 hl_lines 支持
内置英文与简体中文界面翻译,并提供 CJK 友好字体栈
模板详细介绍
Lucent 是发布在 GitHub 上的 Hugo 博客主题,采用单栏、排版优先的版式,不引入 JavaScript 框架。它面向用 Hugo 写个人博客或内容站点的用户,提供文章列表、文章详情、归档页和搜索页等基本页面结构。
功能方面,主题包含跟随系统并记忆用户选择的深色/浅色模式、由 Hugo 生成 JSON 索引配合原生 JS 实现的客户端搜索、可折叠且可按文章开关的目录、按年份分组的归档页与带计数的标签云、基于 Hugo 内容关联的相关文章、阅读时长/字数/最后更新等元信息、代码块复制按钮与双模式语法高亮、阅读进度条与返回顶部按钮、图片灯箱与懒加载、可选启用的 KaTeX 数学公式、延迟加载并同步主题的 giscus 评论、Plausible/Umami/Google Analytics 分析接入,以及 notice、details、quote 三个短代码。界面文案内置英文与简体中文翻译,并提供适配 CJK 的字体栈。
使用上有一些明确前提:需要 Hugo 0.128 或更高版本,标准版即可,因为主题不使用 Sass;搜索功能要求首页输出 JSON 格式;语法高亮需使用 CSS 类;数学公式需开启 Goldmark 的 passthrough 扩展并按指定分隔符书写;归档页和搜索页需要分别创建使用 archives 与 search 布局的内容文件;评论需自行填写 giscus 的仓库与分类标识。主题参数、front matter 选项和配置示例在示例站点的 hugo.toml 中有说明。
许可方面,仓库采用 MIT 许可,允许使用、修改、商用和分发该版本代码,分发时需保留版权与许可声明;演示中的图片、字体、图标等第三方素材需按各自许可单独核对。
适合你的项目吗?
适用场景
- 用 Hugo 搭建以文字为主的个人博客
- 需要深色模式与站内搜索的静态内容站点
- 发布含数学公式或代码片段的技术文章
- 希望通过 giscus 为文章接入评论
- 面向中英文读者的双语博客
适合人群
- 使用 Hugo 0.128 及以上版本建站的用户
- 偏好单栏、排版优先阅读体验的博客作者
- 希望减少前端依赖、以原生 JS 实现交互的开发者
- 需要归档页、标签云与站内搜索的内容站点维护者
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
需要 Hugo 0.128 或更高版本,标准版即可,主题不使用 Sass
- 2
搜索功能要求首页输出格式包含 json,即 outputs.home 需含 "json"
- 3
语法高亮需设置 markup.highlight.noClasses = false 以使用主题提供的明暗配色
- 4
数学公式需开启 Goldmark passthrough 扩展,并按 $$…$$ 与 \(…\) 书写
- 5
归档页与搜索页需分别创建使用 archives 和 search 布局的内容文件;giscus 评论需填写仓库、仓库 ID、分类与分类 ID
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 评论功能依赖第三方服务 giscus,需自行在 giscus.app 获取并填写仓库、仓库 ID、分类与分类 ID 等配置值,属于外部服务依赖。
- 分析统计需接入 Plausible、Umami 或 Google Analytics 等第三方外部服务,可能涉及账号注册与费用。
- 使用该主题要求 Hugo 版本不低于 0.128,标准版即可,无需扩展版。
- 客户端搜索功能要求首页输出格式包含 JSON,需在配置中设置 outputs.home 含 "json"。
- 语法高亮必须使用 CSS 类,需设置 markup.highlight.noClasses = false,否则主题提供的明暗配色不生效。
- 数学公式需开启 Goldmark passthrough 扩展,并按 $$…$$ 与 \(…\) 分隔符书写,否则 KaTeX 无法正确解析。
- 归档页与搜索页需分别创建使用 archives 和 search 布局的内容文件,否则对应页面无法生成。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
Fill in the values from [giscus.app](https://giscus.app):
README 原文
- 📈 **Analytics**: Plausible, Umami, or Google Analytics
README 原文
Requires **Hugo ≥ 0.128** (standard edition is fine — no Sass).
README 原文
# Search needs the JSON output format on the home page:
README 原文
# Syntax highlighting must use CSS classes (the theme ships light+dark colors):
README 原文
# For math: keeps LaTeX out of markdown processing so KaTeX sees it intact.
README 原文
https://github.com/simple-is-awesome/hugo-theme-lucent/blob/main/LICENSEhttps://github.com/simple-is-awesome/hugo-theme-lucent/blob/main/README.mdCreate two content files (the example site already has them):
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-13。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 80 / 100
- 技术栈
- Hugo
- 网站类型
- 博客
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-07-13
- 截图检查日期
- 2026-10-13
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Hugo。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: [email protected] · 2026-10-13
查看当时使用的来源资料
SHA-256: 5c382ce1e8fa0bfa114349106e69ada9538f2b52a019f287916bb3367c19ed4a
2026-10-13T06:31:25.512Z
来源文件 / 仓库# Lucent
A clean, fast and feature-rich blog theme for [Hugo](https://gohugo.io/).
Single-column, typography-first, zero JavaScript frameworks.
## Features
- 🌗 **Dark / light mode** — follows the system preference, remembers the visitor's choice, no flash on load
- 🔍 **Client-side search** — Hugo-generated JSON index + ~150 lines of vanilla JS, no dependencies
- 📑 **Table of contents** — collapsible, per-post toggle
- 🗂 **Archive page** grouped by year, and a **tag cloud** with counts
- 🔗 **Related posts** via Hugo's built-in content relations
- ⏱ **Reading time, word count, last-updated** meta
- 📋 **Copy button on code blocks**, syntax highlighting themed for both modes, `hl_lines` support
- 📊 **Reading progress bar** and back-to-top button
- 🖼 **Image lightbox**, lazy loading, `<figure>` captions from image titles
- 🧮 **KaTeX math** (opt-in per page or site-wide)
- 💬 **giscus comments** (lazy-loaded, theme-synced)
- 📈 **Analytics**: Plausible, Umami, or Google Analytics
- 🧩 **Shortcodes**: `notice` (note / tip / warning / danger), `details`, `quote`
- 🌍 **i18n** — English and Simplified Chinese included; CJK-friendly font stack
- 🔎 **SEO** — Open Graph, Twitter cards, JSON-LD, canonical URLs, RSS
- ♿ Skip link, focus styles, reduced-motion support, semantic HTML
- 📱 Fully responsive, print stylesheet included
Requires **Hugo ≥ 0.128** (standard edition is fine — no Sass).
## Quick start
```bash
hugo new site myblog && cd myblog
git init
git submodule add https://github.com/simple-is-awesome/hugo-theme-lucent themes/hugo-theme-lucent
cp themes/hugo-theme-lucent/exampleSite/hugo.toml .
cp -r themes/hugo-theme-lucent/exampleSite/content .
hugo server -D
```
Or preview the example site from inside this repo:
```bash
hugo server -s exampleSite --themesDir ../..
```
## Configuration
The example site's [`hugo.toml`](exampleSite/hugo.toml) documents every option.
The important non-obvious bits:
```toml
# Search needs the JSON output format on the home page:
[outputs]
home = ["html", "rss", "json"]
# Syntax highlighting must use CSS classes (the theme ships light+dark colors):
[markup.highlight]
noClasses = false
# Standalone images become <figure> elements:
[markup.goldmark.parser]
wrapStandAloneImageWithinParagraph = false
# For math: keeps LaTeX out of markdown processing so KaTeX sees it intact.
# Write display math as $$…$$ and inline math as \(…\).
[markup.goldmark.extensions.passthrough]
enable = true
[markup.goldmark.extensions.passthrough.delimiters]
block = [["\\[", "\\]"], ["$$", "$$"]]
inline = [["\\(", "\\)"]]
```
### Theme params
| Param | Default | What it does |
| --------------------- | ---------------- | --------------------------------------------- |
| `description` | — | Site description (hero subtitle fallback, SEO) |
| `author` | site title | Byline, copyright, JSON-LD |
| `avatar` | — (monogram) | Home hero image, e.g. `images/avatar.png` |
| `favicon` | ✦ (inline SVG) | Path to a favicon |
| `accent` / `accentDark` | indigo | Accent color per mode, any CSS color |
| `dateFormat` | `Jan 2, 2006` | Go date layout for post dates |
| `archiveDateFormat` | `Jan 2` | Date layout on the archive page |
| `recentCount` | `5` | Posts on the home page |
| `showToc` / `tocOpen` | `true` / `true` | Table of contents behavior |
| `showShare` | `true` | Share row under posts |
| `showReadingProgress` | `true` | Top progress bar on posts |
| `math` | `false` | Load KaTeX site-wide |
| `hideCredits` | `false` | Hide the "Hugo · Lucent" footer credit |
| `hero.title` / `hero.subtitle` | site title / description | Home hero text |
| `socialIcons` | — | List of `{ name, url }` (see below) |
Social icon names: `github`, `twitter`, `x`, `mail`, `rss`, `linkedin`,
`telegram`, `youtube`, `instagram`, `facebook`, `globe` — anything else
falls back to a link icon. Add `icon = "globe"` to override the glyph.
### Front matter
```yaml
title: "My post"
date: 2026-07-01
description: "Used for summaries and SEO." # optional
tags: ["hugo"]
math: true # load KaTeX for this page
showToc: false # hide the TOC for this page
share: false # hide the share row
comments: false # disable giscus for this page
```
### Archives & search pages
Create two content files (the example site already has them):
```yaml
# content/archives.md
---
title: "Archive"
layout: "archives"
---
# content/search.md
---
title: "Search"
layout: "search"
---
```
### Comments (giscus)
Fill in the values from [giscus.app](https://giscus.app):
```toml
[params.comments.giscus]
repo = "user/repo"
repoId = "R_xxx"
category = "Announcements"
categoryId = "DIC_xxx"
```
### Chinese interface
Set `defaultContentLanguage = "zh-cn"` and the UI strings switch to the
bundled Simplified Chinese translations (`i18n/zh-cn.toml`).
## Shortcodes
```markdown
{{</* notice tip "Optional custom title" */>}}
Callout body with **markdown**.
{{</* /notice */>}}
{{</* details "Summary text" */>}}
Collapsible content.
{{</* /details */>}}
{{</* quote author="Ada Lovelace" source="Notes" url="https://…" */>}}
The quote itself.
{{</* /quote */>}}
```
## Credits
This theme is a work by **Claude Fable 5** (Anthropic's Claude Code).
## 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 · 文档
