🆕 A quick-start template base on Hugo Modules to create a Hugo FixIt site.
来源:hugo-fixit/hugo-fixit-starter
网站:https://hugo-fixit.github.io/hugo-fixit-starter/
目录
Hugo FixIt 博客模板(Go)
👉 中文 | English
这是 Hugo 主题 FixIt 的快速启动模板。它使用 Hugo 模块 功能加载主题。如果你更熟悉 Git,可以 查看这个模板。
它提供了基本的主题结构和 配置目录1。已经设置了 GitHub Actions,可以自动部署博客到 GitHub Pages。此外,还有一个定时任务,每天自动更新主题。
目录结构
| |
快速入门
完整的快速入门,请参阅此 页面。
准备
使用模板
CLI
| |
手动
点击 Use this template,在 GitHub 上创建你的存储库。
存储库创建后,只需克隆并享受吧!
1 2# 使用你自己的存储库 URL 进行克隆 git clone --recursive https://github.com/<your_name>/<your_blog_repo>.git
提示
仓库名决定了你的 GitHub Pages URL,例如:
| 仓库名 | GitHub Pages |
|---|---|
<your_name>.github.io | https://<your_name>.github.io/ |
blog | https://<your_name>.github.io/blog/ |
启动站点
| |
构建站点
当你的站点准备部署时,运行以下命令:
| |
部署到 GitHub Pages
注意
聪明的你可能已经注意到,模板初始化后的第一次 GitHub Actions 自动部署失败了。这是因为你还没有配置 Workflow 权限和 GitHub Pages。
- 转到 Setting => Actions => General => Workflow permissions => 选中 “Read and write permissions”。
- GitHub Pages 设置:Setting => Pages => Source: GitHub Actions。
- 修改
config/_default/hugo.toml文件中的baseURL为你的站点 URL。 - 提交上一步的修改到
main分支,GitHub Actions 将自动打包并部署站点到 GitHub Pages。
更新主题
之后,你可以使用以下命令升级主题:
| |
通过 NPM 脚本启动
| |
故障排除
remote: Permission to git denied to github-actions[bot].
转到 Setting => Actions => General => Workflow permissions => 选中 "Read and write permissions"。与单一站点配置文件不同,配置按环境、根配置键和语言进行拆分。 ↩︎
Buy me a coffee~
支付宝
微信