Hugo 主题
Henry
Henry 是一个 Hugo 主题,具有华丽的阅读体验,功能齐全。要了解有关所有功能的更多信息,请查看这篇博文。
入门指南
以下是使用 Henry 主题设置 Hugo 博客的说明。
# 1. Install Hugo
# https://gohugo.com.cn/getting-started/installing/
brew install hugo
hugo new site blog-henry
cd blog-henry
# 2. clone Henry
git clone https://github.com/kaushikgopal/henry-hugo.git themes/henry
touch assets/css/{output,override,override-fonts}.css
# brew install node # if you don't have npm installed
cp themes/henry/tailwind.config.henry.js ./tailwind.config.js
npm install -D tailwindcss
npx tailwindcss -i themes/henry/assets/css/input.css -o ./assets/css/output.css
# 3. configure blog
## add these lines to your hugo.toml config file
theme = "henry"
# 4. run Hugo!
# Option: use a single dev script
# See my blog post on this https://kau.sh/blog/tailwind-hugo#bonus-tip
./bin/dev
# open http://0.0.0.0:1313/
# sample posts are in henry's content folder : themes/henry/content
# if you want to see some samples, just mark them from draft true → false
您已准备就绪。祝您博客愉快!
现在,每当您需要启动并运行 Hugo 博客时,只需运行 ./bin/dev
。
可选配置
以下是一些建议在您的 hugo.toml
配置文件中进行的自定义设置,除了上面提到的内容之外。
RSS/JSON 订阅源自定义
## hugo.toml
# enable .json RSS feeds
[outputFormats]
# output formats
# https://gohugo.com.cn/templates/output-formats/#output-format-definitions
[outputFormats.rss]
mediatype = "application/rss"
# change RSS path for default XML feed to /feed.xml (default index.xml)
baseName = "feed"
[outputFormats.json]
# change RSS path for JSON feed to /feed.json
baseName = "feed"
# configure RSS feeds for specific pages
[outputs]
# output format for pages
# https://gohugo.com.cn/templates/output-formats/#output-formats-for-pages
page = ["html"]
home = ["html", "rss","json"]
# sections = directories e.g. blog, letters, ppt
section = ["html","rss","json"]
# taxonomies = virtual tags/directories e.g. categories, tags (built-in)
# no rss for these as they're mostly "list" pages
taxonomy = ["html"]
# terms = values of taxonomies e.g. categories/programming
term = ["html", "rss","json"]
相关文章自定义
## hugo.toml
[related]
includeNewer = true
threshold = 80
toLower = true
# weight index distribution tags > categories > title
[[related.indices]]
name = "tags"
weight = 80
[[related.indices]]
name = "categories"
weight = 20
[[related.indices]]
name = "title"
weight = 10
Henry 的实际应用
以下是几个使用 Henry 的博客
- Karthick Gopal 的博客
- Kaushik Gopal 的博客
许可证
该主题根据 MIT 许可证的条款以开源形式提供。
欢迎在 GitHub 上提交错误报告和拉取请求。该项目旨在成为一个安全、欢迎合作的空间,贡献者应遵守贡献者公约行为准则。