Hugo 主题
🦄 E25DX
您的下一个文档主题…
https://github.com/dumindu/E25DX/assets/1280428/00935567-6d50-4e1b-bb0c-cbd159ad37f0
🌱 灵感
- 构建一个简单、模块化但可自定义的技术文档。
- 无需使用 node/npm 或任何外部框架(CSS、JS、图标、字体)即可构建网站。
- 演示
✅ 功能
- 响应式和自适应布局。
- 内置浅色和深色模式。
- 使用 Hugo 数据模板自定义侧边栏。
- 支持多个文档集。
- 通过 Hugo 配置实现菜单。
- 集成搜索或 AI 助手。
🚀 入门
安装 Hugo。
- 通过 https://github.com/gohugoio/hugo/releases/latest 使用预构建的二进制文件
- 通过
hugo version
验证安装
使用 E25DX 主题创建一个新的 Hugo 站点。
基础
hugo new site newsite cd newsite git init git submodule add https://github.com/dumindu/E25DX.git themes/E25DX rm hugo.toml && cp themes/E25DX/hugo.yaml . cp themes/E25DX/static/sw.js ./static/ cp themes/E25DX/static/manifest.json ./static/
💡 我们不需要
newsite
文件夹中生成的archetypes
、assets
、i18n
、layouts
文件夹配置
newsite/hugo.yaml
- languages: en:title 和 en:description
- params: project、author 和 home
newsite/static/sw.js
- cacheName 前缀:例如 todo-
newsite/static/manifest.json
- name、short_name、description
示例内容和侧边栏
- 添加
newsite/content/en/docs/_overview.md
作为概述--- title: Overview url: "docs/overview" aliases: - "/docs" ---
- 添加
newsite/content/en/docs/a1.hello-world.md
作为第一个部分的第一页--- title: Hello World slug: hello-world ---
- 添加
newsite/content/en/docs/b1.modules.md
作为第二个部分的第一页--- title: Modules slug: modules ---
- 添加
newsite/data/en/docs/sidebar.yml
作为部分标题和页面标题- title: Documentation pages: - title: Overview - title: Basics pages: - title: Hello World - title: Beyond The Basics pages: - title: Modules
- 添加
运行
hugo server
💡 如果您想在提交更改之前运行
hugo server
,请更改newsite/hugo.yaml
->enableGitInfo: false
。