Hugo启动器

kana-hugo-theme — Hugo 启动器模板

作者 ChrisWiegman

Kana 是一个面向个人博客的 Hugo 深色主题,采用暖色大地色调,内置客户端搜索、阅读书库、短笔记、响应式图片与 Gruvbox 代码高亮。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

3 个预览视图
桌面端首页1 / 3
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 3

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-03查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

暖色大地色调的深色主题,基于 Gruvbox 风格配色

02

客户端搜索,索引文章标题、分类、标签和正文,无需服务端

03

阅读书库支持按年份、作者、评分筛选与排序,并展示阅读统计

04

短笔记(notes)拥有独立分页归档和 RSS 订阅源

05

图片自动生成 srcset、转换为 WebP 并懒加载

06

代码块支持 Gruvbox 高亮、文件名标签和可折叠显示

模板详细介绍

Kana 是 ChrisWiegman 开发的 Hugo 主题,定位为个人博客的启动器。它采用暖色、大地质感的深色配色,并围绕博客写作场景提供几类内容组织方式:标准文章(posts)、短笔记(notes)以及阅读书库(books)。主题内置客户端搜索,索引来自首页的 JSON 输出,不依赖服务端;书库页面支持按完成年份、作者和星级筛选,并可按标题、作者、评分或日期排序,同时展示每年阅读量、高产作者和评分分布等统计信息。图片方面,主题通过 Markdown 渲染钩子和 asset-image 短代码生成 srcset、转换为 WebP 并启用懒加载;代码块使用 Gruvbox 高亮,支持文件名标签和可折叠块。SEO 相关输出包括 Open Graph、Twitter Cards、JSON-LD、canonical URL 和 Fediverse 创作者 meta 标签,并提供站点级 RSS 以及 notes 分区的独立 RSS。使用前需要 Hugo extended 版本,Node.js 与 npm 仅用于 Playwright 测试和工具链。主题以 MIT 许可发布,但演示图片、字体、图标等第三方素材需单独核对许可。

Hugo启动器

适合你的项目吗?

适用场景

  • 搭建以文章和短笔记为主的个人博客
  • 为读书记录建立可筛选、可排序并带统计的在线书库
  • 在无服务端环境下为站点添加客户端全文搜索
  • 需要 Open Graph、Twitter Cards、JSON-LD 等 SEO 元信息输出的博客
  • 希望图片自动适配多尺寸并输出 WebP 的内容站点

适合人群

  • 使用 Hugo extended 并愿意通过 Hugo Module、Git Submodule 或手动复制方式安装主题的开发者
  • 以个人写作、笔记和阅读记录为主要内容形态的站点
  • 偏好深色、暖色配色且不需要复杂后端服务的博客作者

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    需要 Hugo extended v0.152.0 或更高版本;Node.js 与 npm 仅用于 Playwright 测试和工具链

  2. 2

    首页输出必须包含 JSON(outputs.home 中加入 "JSON"),客户端搜索才能工作

  3. 3

    可通过 Hugo Module、Git Submodule 或手动复制到 themes/kana-hugo-theme 三种方式安装

  4. 4

    书库功能需添加 content/library.md 并设置 layout: library;搜索页需添加 content/search.md 并设置 layout: search

  5. 5

    演示图片、字体、图标等第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 使用该主题必须安装 Hugo extended 版本,且版本号不低于 v0.152.0,普通版 Hugo 无法使用。
  • 运行 Playwright 端到端测试和工具链需要额外安装 Node.js 与 npm;仅构建站点本身不需要。
  • 客户端搜索依赖首页输出 JSON,必须在 outputs.home 中加入 "JSON",否则搜索功能不可用。
  • 阅读书库功能需手动创建 content/library.md 并设置 layout: library 才会启用。
  • 搜索页面需手动创建 content/search.md 并设置 layout: search 才会启用。
  • 运行 make test 执行 Playwright 测试时,要求 hugo 可执行文件位于系统 PATH 中。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

- [Hugo](https://gohugo.io) extended, v0.152.0 or later

README 原文

- [Node.js](https://nodejs.org/en) + [npm](https://www.npmjs.com) (for Playwright tests and tooling only)

README 原文

The `JSON` output on `home` is required for client-side search to work.

README 原文

Add a `content/library.md` page with `layout: library` to activate it.

README 原文

Add a `content/search.md` page:

README 原文

Runs Playwright browser tests against the local dev site. Requires `hugo` on your `PATH`.

README 原文
https://github.com/ChrisWiegman/kana-hugo-theme/blob/main/LICENSE.txthttps://github.com/ChrisWiegman/kana-hugo-theme/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-03。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
Hugo Themes
资料与维护参考分
资料较完整 · 83 / 100
技术栈
Hugo
网站类型
启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-08-29
截图检查日期
2026-10-03

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Hugo。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: [email protected] · 2026-10-04

查看当时使用的来源资料

SHA-256: 849ce4c66db875152c32d2dcabb1d01b5938bc5a6df3cd03717ab59e2a3873ca

2026-10-03T16:40:45.144Z

来源文件 / 仓库
# Kana Theme

A warm, earthy dark Hugo theme for personal blogs. Features client-side search, a reading library, short-form notes, responsive images with WebP conversion, and Gruvbox syntax highlighting.

![Screenshot](https://github.com/ChrisWiegman/kana-hugo-theme/raw/main/images/screenshot.png)

**Demo**: [chriswiegman.com](https://chriswiegman.com)

## Requirements

- [Hugo](https://gohugo.io) extended, v0.152.0 or later
- [Node.js](https://nodejs.org/en) + [npm](https://www.npmjs.com) (for Playwright tests and tooling only)

## Installation

### As a Hugo Module (recommended)

Initialize Hugo modules in your site if you haven't already:

```sh
hugo mod init github.com/your-username/your-site
```

Add the theme to your `hugo.toml`:

```toml
theme = "github.com/ChrisWiegman/kana-hugo-theme"
```

Then fetch the module:

```sh
hugo mod get github.com/ChrisWiegman/kana-hugo-theme
```

### As a Git Submodule

```sh
git submodule add https://github.com/ChrisWiegman/kana-hugo-theme themes/kana-hugo-theme
```

Then set the theme in your `hugo.toml`:

```toml
theme = "kana-hugo-theme"
```

### Manual Copy

Download or clone the repository and copy it into your site's `themes/kana-hugo-theme` directory.

## Configuration

For a complete working example, see [`dev/hugo.toml`](https://github.com/ChrisWiegman/kana-hugo-theme/blob/main/dev/hugo.toml).

### Minimal Configuration

```toml
theme = "github.com/ChrisWiegman/kana-hugo-theme"

[params]
mainSections = ["posts"]
description  = "Your site description"

[outputs]
home = ["HTML", "RSS", "JSON"]
```

The `JSON` output on `home` is required for client-side search to work.

### Theme Parameters

| Parameter | Type | Description |
|---|---|---|
| `author` | string | Author name used as `dc:creator` in RSS feeds |
| `description` | string | Site description for meta tags |
| `subtitle` | string | Subtitle appended to the homepage title tag |
| `mainSections` | string[] | Content sections included in the homepage post list and RSS feed |
| `headerIcon` | string | Path (relative to `assets/`) to the icon shown in the site header |
| `imageSizes` | int[] | Image widths (px) to generate in srcset (e.g. `[850, 710, 300]`) |
| `imageSizeString` | string | The HTML `sizes` attribute for responsive images. Must be ordered **smallest breakpoint first** with no-condition default last (e.g. `"(max-width: 300px) 300w, (max-width: 710px) 710w, 850w"`) |
| `OpenGraph` | bool | Emit Open Graph meta tags |
| `TwitterCards` | bool | Emit Twitter Card meta tags |
| `jsonld` | bool | Emit JSON-LD meta tags |
| `FediverseCreator` | string | Fediverse handle for `fediverse:creator` meta tag (e.g. `"@[email protected]"`) |
| `MobileWebAppTitle` | string | `apple-mobile-web-app-title` meta value |
| `policies` | string | Path to a policies page linked in the footer |
| `license` | object | `name`, `title`, and `link` shown in the footer (see below) |

### License Footer

```toml
[params.license]
name  = "MIT Licensed"
title = "Short tooltip text"
link  = "https://example.com/license"
```

### Menus

The theme supports two menus: `main` (header) and `footer`.

```toml
[[menus.main]]
name    = "Blog"
pageRef = "/blog"
weight  = 10

[[menus.footer]]
name   = "RSS"
url    = "/index.xml"
weight = 10
```

## Content Types

### Posts

Standard blog posts. Recommended permalink structure:

```toml
[permalinks]
posts = "/:year/:month/:slug/"
```

Front matter:

```toml
title      = "Post title"
date       = 2025-09-15T15:47:00+00:00
draft      = false
images     = ["/images/path/to/image.jpeg"]
categories = ["Category"]
tags       = ["tag-one", "tag-two"]
```

### Notes

Short-form content with its own paginated archive and RSS feed at `/notes/index.xml`. Notes are grouped by year.

Front matter:

```toml
title = "Note title"
date  = 2025-06-27T00:00:00+00:00
draft = false
```

### Books (Library)

A reading library with interactive filtering and statistics. Books live in a headless `content/books/` section, organised by author slug.

```
content/
└── books/
    ├── index.md          # headless: true
    └── author-name/
        └── book-title.md
```

Front matter:

```toml
title    = "Book Title"
author   = "Author Name"
rating   = 4

finished = ["2024-10-23"]   # multiple dates supported for re-reads

[links]
amazon      = "https://www.amazon.com/..."
openlibrary = "https://openlibrary.org/..."
goodreads   = "https://www.goodreads.com/..."
```

The library page supports filtering by year finished, author, and star rating, plus sorting by title, author, rating, or date. A statistics panel shows books read per year, top authors, and rating distribution.

Books load progressively: an initial batch is shown (controlled by `site.Params.pagerSize`, default 25), and further batches append to the bottom of the list as you scroll, with a "Load More Books" link as a fallback trigger. Changing a sort or filter starts back at the first batch.

Add a `content/library.md` page with `layout: library` to activate it.

### Search

Add a `content/search.md` page:

```toml
+++
title = "Search"
layout = "search"
+++
```

The search index is built from the JSON output on the homepage and runs entirely client-side — no server required. It searches post titles, categories, tags, and body content.

## Shortcodes

### asset-image

Inserts a responsive image from `assets/` with automatic WebP conversion.

```
{{< asset-image "images/photo.jpg" "800" "600" "Alt text" >}}
```

| Position | Parameter | Default | Description |
|---|---|---|---|
| 1 | `path` | — | Path relative to `assets/` |
| 2 | `width` | `"225"` | Width in pixels |
| 3 | `height` | `"225"` | Height in pixels |
| 4 | `alt` | `""` | Alt text |

## Markdown Render Hooks

### Images

Markdown images are automatically rendered with:

- Responsive `srcset` based on `params.imageSizes`
- Lazy loading (`loading="lazy"`)
- WebP format output
- `<figure>`/`<figcaption>` for block images with a title

### Code Blocks

Code blocks support extra attributes:

````markdown
```go {file="main.go"}
package main
```
````

Features:
- Gruvbox syntax highlighting
- Optional filename label (`file=`)
- Collapsible blocks (`details=true`)
- Supports 200+ languages

## Features

- **Dark theme** — warm Gruvbox-inspired palette
- **Client-side search** — no server needed; indexes title, tags, categories, and content
- **Reading library** — filterable, sortable book list with statistics
- **Notes** — short-form content with its own RSS feed
- **Responsive images** — automatic WebP conversion, srcset generation, lazy loading
- **Syntax highlighting** — Gruvbox theme, collapsible blocks, filename labels
- **SEO** — Open Graph, Twitter Cards, Schema.org, Fediverse creator meta tag, canonical URLs, JSON-LD
- **RSS** — site-wide feed plus a per-section feed for notes
- **Sitemap** and **robots.txt** included

## Local Development

### Running the Development Site

```sh
make dev
```

The site will be available at `http://localhost:1313`.

### End-to-End Testing

```sh
make test
```

Runs Playwright browser tests against the local dev site. Requires `hugo` on your `PATH`.

### Updating Screenshots

```sh
make screenshots
```

Regenerates `images/screenshot.png` (1500×1000) and `images/tn.png` (900×600) from the dev site.

## Project Structure

```
├── assets/
│   ├── scripts/
│   │   ├── library.js      # book filtering and sorting
│   │   └── search.js       # client-side search
│   └── scss/               # component-based stylesheets
├── dev/                    # local development site
│   ├── content/
│   └── hugo.toml
├── e2e/                    # Playwright tests
├── images/                 # theme screenshots
├── layouts/
│   ├── _default/           # generic list templates
│   ├── _markup/            # image and code block render hooks
│   ├── blog/               # blog archive template
│   ├── library/            # reading library template
│   ├── notes/              # notes archive and RSS feed
│   ├── partials/           # shared template fragments
│   ├── shortcodes/         # asset-image shortcode
│   ├── home.html
│   ├── search.html
│   ├── single.html
│   └── 404.html
└── scripts/
    └── screenshots.mjs     # screenshot generation script
```

## Formatting

Templates in `layouts/` are formatted with Prettier using the `go-template` parser. Use the Prettier VS Code extension (configured in `.vscode/settings.json`) to avoid breaking Hugo template markup.

## License

[MIT](https://github.com/ChrisWiegman/kana-hugo-theme/blob/main/LICENSE.txt)
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。