以 Hugo Module 分发,消费站点无需 Node.js、npm、PostCSS 或打包器,构建与预览使用单个 hugo 二进制
oink — Hugo 文档模板
作者 pgsty
OINK 是一个基于 Hugo 的工程文档主题,将原生 Markdown 转换为包含 Docs、Blog、Book、OpenAPI 等阅读外壳的知识发布站点,资源本地化,无需 Node.js。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
提供 Docs、Blog、Book、Swagger/Redoc、发布、下载与数据驱动落地页等多种阅读外壳,共享导航与视觉系统
原生 Markdown 可转换为标签页、步骤、卡片、字段、图库、图表、数学公式和 API 参考等组件,无需 MDX
本地全文搜索、命令面板、分类法、反向链接,以及 Mermaid、PlantUML、Draw.io、Markmap、ECharts、KaTeX、Asciinema 等技术内容支持
输出 HTML、RSS、Print、Markdown、LLMS、LLMSFULL、NAVJSON 和 Book manifest,兼顾读者与机器消费
多语言路由、翻译页面关联、RTL 支持与本地化搜索,界面文本覆盖 Docsy 的 31 个 locale 名称及通用 zh
模板详细介绍
OINK 是 pgsty 维护的 Hugo 主题,定位为面向工程文档的本地优先发布方案。它把原生 Markdown 组织成完整的知识站点,提供 Docs、Blog、Book、Swagger/Redoc、发布记录、下载页和数据驱动落地页等多种阅读外壳,并共享同一套导航与视觉系统。主题内置本地全文搜索、命令面板、分类法与反向链接,支持 Mermaid、PlantUML、Draw.io、Markmap、ECharts、KaTeX、Asciinema 等技术内容组件,以及代码块、标签页、步骤、卡片、字段、图库、提示框等写作组件。输出方面可生成 HTML、RSS、Print、Markdown、LLMS、LLMSFULL、NAVJSON 和 Book manifest,便于面向读者与机器消费。主题支持多语言路由、翻译页面关联、RTL 和本地化搜索,界面文本覆盖 Docsy 提供的 31 个 locale 名称及通用 zh。
使用方式上,OINK 以 Hugo Module 形式分发,推荐通过 pgsty/oink-starter 模板起步,该模板包含 Docs、Blog、Book 以及英语、中文、法语配置和 GitHub Pages、Cloudflare Pages 工作流。现有 Hugo 站点可通过 hugo mod init 与 hugo mod get 引入模块,并在 hugo.yaml 中导入模块、配置 Goldmark 以启用原生容器短代码和块级图片属性。构建依赖 Hugo Extended 0.160.1 或更新版本,模块解析需要 Go 1.27 或更新版本,使用离线归档或子模块时不需要 Go;构建与运行不需要 Node.js。主题从 Docsy 的内容模型起步,但已发展为独立主题,导航、配置、front matter 与扩展契约均有变化,Docsy 站点迁移需参考官方迁移指南,不能假设可直接替换。
适合你的项目吗?
适用场景
- 搭建工程文档站点,需要 Docs、Blog、Book 等多种内容形态共享统一导航
- 为已有 Hugo 站点引入模块化主题,并希望避免 Node.js 构建链
- 发布多语言技术文档,需要语言路由、翻译页面关联和本地化搜索
- 编写包含图表、数学公式、API 参考和终端录制等技术内容的文档
- 需要同时输出面向读者的 HTML 和面向工具的 Markdown、LLMS、NAVJSON 索引
适合人群
- 使用 Hugo Extended 0.160.1 或更新版本的工程文档维护者
- 希望以原生 Markdown 写作、不引入 MDX 或前端打包流程的团队
- 需要多语言、多阅读外壳和机器可读输出的技术出版项目
- 从 Docsy 迁移并接受参考迁移指南调整配置与扩展契约的站点
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
推荐使用 pgsty/oink-starter 模板起步,该模板已固定经过测试的 OINK 版本并包含生产构建配置
- 2
在已有 Hugo 站点中通过 hugo mod init 与 hugo mod get github.com/pgsty/oink@latest 引入模块
- 3
在站点根 hugo.yaml 的 module.imports 中导入模块,并配置 Goldmark 的 unsafe、wrapStandAloneImageWithinParagraph 和 attribute.block 以启用原生容器短代码与块级图片属性
- 4
构建需要 Hugo Extended 0.160.1 或更新版本;模块解析需要 Go 1.27 或更新版本,使用离线归档或子模块时不需要 Go
- 5
生产构建建议提交 go.mod 与 go.sum,并使用 --panicOnWarning 等参数将警告提升为错误后检查代表性路由
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 Apache-2.0 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发;分发时需随附 Apache-2.0 许可证。
- 修改过的文件需显著标明改动,并保留相关版权、专利、商标及归属声明。
- 若原项目附有 NOTICE 文件,分发衍生作品时需保留其中适用的归属声明。
- 许可包含适用的贡献者专利授权;发起许可所述专利诉讼会终止该专利授权,且不授予商标使用权。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 使用官方 oink-starter 模板需要 Git、Go 1.27 或更新版本,以及 Hugo Extended 0.165.0 或更新版本;不需要 Node.js。
- 以 Hugo Module 方式解析主题需要 Go 1.27 或更新版本;若使用离线归档或子模块方式则不需要 Go。
- 构建站点必须使用 Hugo Extended 0.160.1 或更新版本,CI 当前固定为 0.165.0。
- 在 Hugo 0.160.x 上,若通用 zh 为非默认语言且存在地区中文目录,需按示例配置为具体的 locale: zh-CN。
- 从 Docsy 迁移的站点不能假设可直接替换,必须参考官方迁移指南调整导航、配置、front matter 与扩展契约。
- 交互功能为可选启用,站点需自行决定启用哪些输出、分析、评论、反馈、助手链接与图片行为。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 Apache-2.0 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
no-charge, royalty-free, irrevocable copyright license
许可证原文
The current starter expects Git, Go 1.27 or newer, and Hugo Extended 0.165.0 or newer; it does not require Node.js.
README 原文
Go | 1.27 or newer for Hugo Module resolution; not needed when using an offline archive or submodule
README 原文
Hugo | **Extended 0.160.1 or newer**; CI currently pins 0.165.0
README 原文
On Hugo 0.160.x, when generic `zh` is a non-default language and the regional Chinese catalogs are present, configure it with the concrete `locale: zh-CN`, as OINK's examples do.
README 原文
Use the [migration guide](https://oink.pgsty.com/docs/admin/upgrade/) instead of assuming drop-in compatibility.
README 原文
https://github.com/pgsty/oink/blob/main/LICENSEhttps://github.com/pgsty/oink/blob/main/README.mdInteractive features remain opt-in where they express site policy. The theme provides the implementation; the consuming site decides which outputs, analytics, comments, feedback, assistant links, and image behavior to enable.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-02。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- Hugo Themes
- 资料与维护参考分
- 资料较完整 · 91 / 100
- 技术栈
- Hugo
- 网站类型
- 文档
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-20
- 截图检查日期
- 2026-10-02
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Hugo。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 09e5f79c6bfdf4362d44347eace86346c1f4f21d21ebff363daf6cc2a4070213
2026-10-02T19:19:03.099Z
来源文件 / 仓库<h1 align="center">
<a href="https://oink.pgsty.com/">
<img src="https://raw.githubusercontent.com/pgsty/oink/main/images/logo.svg" alt="OINK" width="420">
</a>
</h1>
<p align="center">
<strong>Open. Indexed. Navigable. Knowledge.</strong><br>
A local-first Hugo theme for engineering documentation.
</p>
<p align="center">
<a href="https://oink.pgsty.com/"><img alt="Website" src="https://img.shields.io/badge/website-oink.pgsty.com-17385c?style=flat-square"></a>
<a href="https://github.com/pgsty/oink/releases/latest"><img alt="Release" src="https://img.shields.io/github/v/release/pgsty/oink?display_name=tag&sort=semver&style=flat-square"></a>
<a href="https://github.com/pgsty/oink/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/pgsty/oink/ci.yml?branch=main&label=CI&style=flat-square"></a>
<a href="https://gohugo.io/"><img alt="Hugo Extended 0.160.1 or newer" src="https://img.shields.io/badge/Hugo_Extended-%E2%89%A50.160.1-ff4088?logo=hugo&logoColor=white&style=flat-square"></a>
<a href="https://github.com/pgsty/oink/blob/main/LICENSE"><img alt="Apache 2.0" src="https://img.shields.io/github/license/pgsty/oink?label=license&style=flat-square"></a>
</p>
<p align="center">
<a href="https://oink.pgsty.com/docs/start/"><strong>Get started</strong></a> ·
<a href="https://github.com/pgsty/oink-starter"><strong>OINK Starter</strong></a> ·
<a href="https://oink.pgsty.com/docs/components/">Components</a> ·
<a href="https://oink.pgsty.com/case/">Live cases</a> ·
<a href="https://oink.pgsty.com/docs/design/">Design</a>
</p>
<a href="https://oink.pgsty.com/">
<img src="https://raw.githubusercontent.com/pgsty/oink/main/images/screenshot.png" alt="OINK documentation landing page in dark mode">
</a>
OINK turns native Markdown into a complete knowledge-publishing site with one
Hugo Extended build. Its fonts, icons, search, diagrams, and feature runtimes
ship locally and load only where they are used. Consumer sites need no Node.js,
npm, PostCSS, bundler, or CDN.
The same content can serve people and tools: responsive HTML for readers,
print and RSS for publication, semantic Markdown for reuse, and optional
`llms.txt`, `llms-full.txt`, and `navigation.json` indexes for agents.
## Why OINK
- **One deterministic toolchain.** Resolve the Hugo Module once, then build and
preview with one `hugo` binary.
- **Complete publishing surfaces.** Docs, Blog, Book, OpenAPI, releases,
downloads, and data-driven landing pages share one navigation and visual
system.
- **Native Markdown authoring.** Tables, fenced code, lists, and attributes
become tabs, steps, cards, fields, galleries, diagrams, mathematics, charts,
and API references without introducing MDX.
- **Local-first delivery.** Search, fonts, icons, syntax highlighting, and
interactive runtimes are vendored; a normal build performs no remote asset
fetch.
- **Multilingual by design.** Language-aware routing, translated-page peers,
RTL support, alternate-site links, and localized search work across large
documentation trees.
- **Progressive by default.** Server-rendered content remains useful without
JavaScript; interaction, accessibility, responsive behavior, print, and
machine-readable outputs are tested as separate contracts.
## Start a site
### Use OINK Starter
The recommended path is the public
[`pgsty/oink-starter`](https://github.com/pgsty/oink-starter) template. It is a
small production baseline with Docs, Blog, Book, English/Chinese/French
profiles, and GitHub Pages and Cloudflare Pages workflows—without this theme
repository's internal fixtures.
[**Use this template on GitHub**](https://github.com/new?template_name=oink-starter&template_owner=pgsty)
· [Live starter](https://pgsty.github.io/oink-starter/)
· [Setup guide](https://oink.pgsty.com/docs/start/)
The current starter expects Git, Go 1.27 or newer, and Hugo Extended 0.165.0
or newer; it does not require Node.js. To evaluate the neutral template locally:
```sh
git clone https://github.com/pgsty/oink-starter.git
cd oink-starter
hugo server
```
Open <http://localhost:1313/>. Replace the site identity, home-page data, and
sample content in that order; the starter already pins a tested OINK release
and includes a warning-strict production build.
### Add OINK to an existing Hugo site
OINK is a Hugo Module. A site that does not already use modules can initialize
one and resolve the latest release with:
```sh
hugo mod init github.com/example/docs
hugo mod get github.com/pgsty/oink@latest
```
Import the module in the site's root `hugo.yaml`:
```yaml
module:
imports:
- path: github.com/pgsty/oink
# Hugo does not merge a theme module's Goldmark settings into the site.
markup:
goldmark:
renderer:
unsafe: true
parser:
wrapStandAloneImageWithinParagraph: false
attribute:
block: true
```
Those Goldmark settings enable OINK's native container shortcodes, block-image
attributes, steps, fields, captions, and numbered Book targets. Select the
HTML, RSS, Print, Markdown, LLMS, LLMSFULL, and NAVJSON outputs the site needs;
the [configuration reference](https://oink.pgsty.com/docs/customize/config/)
documents their defaults and scope.
For production, commit `go.mod` and `go.sum`, build with warnings promoted to
errors, and inspect representative routes:
```sh
hugo --cleanDestinationDir --gc --minify --environment production \
--printPathWarnings --panicOnWarning
```
See [Get started](https://oink.pgsty.com/docs/start/) for repository structure,
language profiles, customization, and deployment. Existing Docsy sites should
also read the [upgrade and migration guide](https://oink.pgsty.com/docs/admin/upgrade/).
## What ships with the theme
| Area | Included capabilities |
| --- | --- |
| Reading shells | Docs, Blog, Book, Swagger/Redoc, releases, downloads, Print |
| Navigation | Sidebars, breadcrumbs, TOC rail, pager, version and language menus |
| Discovery | Local full-text search, command palette, taxonomies, backlinks |
| Authoring | Code, tabs, steps, cards, fields, images, galleries, callouts, includes |
| Technical content | Mermaid, PlantUML, Draw.io, Markmap, ECharts, KaTeX, Asciinema |
| Landing pages | 22 server-rendered sections with progressive enhancement |
| Outputs | HTML, RSS, Print, Markdown, LLMS, LLMSFULL, NAVJSON, Book manifest |
| Operations | SEO, analytics hooks, Giscus, feedback events, sharing, deployment-safe URLs |
Interactive features remain opt-in where they express site policy. The theme
provides the implementation; the consuming site decides which outputs,
analytics, comments, feedback, assistant links, and image behavior to enable.
## Live sites
OINK is exercised by fifteen real sites, from a two-page utility to large
documentation estates and multi-edition books. These are representative:
| Site | Shape | Case study |
| --- | --- | --- |
| [pigsty.io](https://pigsty.io/) / [pigsty.cc](https://pigsty.cc/) | Large English and Chinese documentation, blog, catalogue, and landing pages | [EN](https://oink.pgsty.com/case/pigsty-io/) · [ZH](https://oink.pgsty.com/case/pigsty-cc/) |
| [silo.pgsty.com](https://silo.pgsty.com/) | Large bilingual migration with manifest-generated navigation | [SILO](https://oink.pgsty.com/case/silo/) |
| [pgsty.com](https://pgsty.com/) | Compact bilingual corporate and landing-page site | [PGSTY](https://oink.pgsty.com/case/pgsty-com/) |
| [ddia.vonng.com](https://ddia.vonng.com/) | Multi-edition, multilingual Book with numbering and cross-references | [DDIA](https://oink.pgsty.com/case/ddia/) |
| [tpme.vonng.com](https://tpme.vonng.com/) | Focused bilingual Book publication | [TPME](https://oink.pgsty.com/case/tpme/) |
| [ext.pgsty.com](https://ext.pgsty.com/) | Data-driven PostgreSQL extension catalogue | [PGEXT](https://oink.pgsty.com/case/pgext-cloud/) |
| [exp.pgsty.com](https://exp.pgsty.com/) | Bilingual product docs with a structured metrics catalogue | [PG Exporter](https://oink.pgsty.com/case/pg-exporter/) |
| [caps.vonng.com](https://caps.vonng.com/) | Two-page bilingual project with an interactive configurator | [CapsLock](https://oink.pgsty.com/case/capslock/) |
[Browse all case studies](https://oink.pgsty.com/case/).
## Documentation
| Guide | Purpose |
| --- | --- |
| [Get started](https://oink.pgsty.com/docs/start/) | Install, understand the repository, and establish a working baseline |
| [Authoring](https://oink.pgsty.com/docs/write/) | Write Docs, Blog, Book, release, and OpenAPI content |
| [Components](https://oink.pgsty.com/docs/components/) | Source-first examples and parameter references |
| [Customization](https://oink.pgsty.com/docs/customize/) | Brand, navigation, layout, languages, search, outputs, and integrations |
| [Operations](https://oink.pgsty.com/docs/admin/) | Preview, deploy, upgrade, troubleshoot, analytics, and SEO |
| [Design](https://oink.pgsty.com/docs/design/) | Maintainer contracts, decisions, research, and active proposals |
| [Write Beautiful Docs](https://oink.pgsty.com/book/) | End-to-end tutorial in OINK's Book shell |
The public documentation and regression site lives in
[`pgsty/oink.pgsty.com`](https://github.com/pgsty/oink.pgsty.com). This theme
repository owns implementation, defaults, vendored assets, focused checkers,
and the narrow internal fixture under
[`tests/site/`](https://github.com/pgsty/oink/tree/main/tests/site/).
## OINK and Docsy
OINK began from Docsy's mature Hugo content model and remains Apache-2.0 with
explicit upstream attribution. It is now a separate theme rather than a Docsy
skin: OINK owns its Docs, Blog, Book, Swagger, and Landing shells; local search
and command palette; native-Markdown component model; responsive and
accessibility behavior; and reader, print, Markdown, and agent-facing outputs.
That difference is architectural as well as visual. OINK consumer sites do not
run Docsy's Node/PostCSS pipeline, and OINK changes navigation, configuration,
front matter, and extension contracts deliberately. Use the
[migration guide](https://oink.pgsty.com/docs/admin/upgrade/) instead of
assuming drop-in compatibility.
## Compatibility
| Dependency | Policy |
| --- | --- |
| Hugo | **Extended 0.160.1 or newer**; CI currently pins 0.165.0 |
| Go | 1.27 or newer for Hugo Module resolution; not needed when using an offline archive or submodule |
| Node.js | Not required to build or run an OINK site |
| Locales | Native OINK interface text for all 31 locale names shipped by Docsy, plus generic `zh`; every bundle owns the same 194-message schema, including CLDR plural forms, with no English placeholder blocks |
On Hugo 0.160.x, when generic `zh` is a non-default language and the regional
Chinese catalogs are present, configure it with the concrete `locale: zh-CN`,
as OINK's examples do. Hugo 0.161.0 and newer also resolve bare `locale: zh`
in that configuration.
## Community and releases
[Releases](https://github.com/pgsty/oink/releases) ·
[Changelog](https://github.com/pgsty/oink/blob/main/CHANGELOG.md) ·
[Issues](https://github.com/pgsty/oink/issues) ·
[Discussions](https://github.com/pgsty/oink/discussions)
A local build, a committed change, a public tag, a consumer dependency update,
and a deployed site are separate release states. Pin a release tag for
production and verify the public routes after deployment.
## License
OINK is licensed under the
[Apache License 2.0](https://github.com/pgsty/oink/blob/main/LICENSE) and
derived from [Docsy](https://github.com/google/docsy). See
[NOTICE](https://github.com/pgsty/oink/blob/main/NOTICE) for upstream
attribution and
[VENDOR.json](https://github.com/pgsty/oink/blob/main/VENDOR.json) for bundled
third-party components.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

hugo-book
Hugo Book 是一个面向文档场景的 Hugo 主题,定位很直接:把文档站点做得像一本朴素的书。
Hugo · 文档

docsy
Hugo theme for open source documentation
Hugo · 文档

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

doks
Doks 是 Thulite 生态下的文档主题,底层是 Hugo 静态站点生成器。 它把重点放在长文阅读体验上:极简且响应式的布局、为文档优化的排版,以及代码块语法高亮,整体更接近技术手册的形态,而不是通用营销页模板。
Hugo · 工具站

lotusdocs
📖 A free, lightweight, modern documentation theme for Hugo
Hugo · 文档

hugo-theme-relearn
A theme for Hugo designed for documentation
Hugo · 文档
