部署到 GitHub Pages

本站使用 Hugo 构建,通过 GitHub Actions 部署到 GitHub Pages。 无需主题子模块 —— 所有布局与样式直接放在仓库根目录下。

前置条件

  • Hugo extended 0.164.0 或更高版本(brew install hugo)。

本地预览

cd ARES_Docs
hugo server --port 9090

在浏览器中打开 http://localhost:9090/ARES/。

生产构建

cd ARES_Docs
hugo --minify --baseURL "https://timwood0x10.github.io/ARES/"

生成的静态文件输出到 public/。

GitHub Pages CI

.github/workflows/hugo.yml 在推送到 main、master 或 dev 时构建并部署: 从 GitHub Releases 安装 Hugo extended,actions/configure-pages@v5 配置 Pages,运行 hugo --minify,再经 actions/upload-pages-artifact@v3 与 actions/deploy-pages@v4 发布 public/ 产物。

确保仓库的 Pages 来源设置为 GitHub Actions(Settings → Pages)。

配置

所有站点配置在 config.yaml 中。关键字段:

字段值
baseURLhttps://timwood0x10.github.io/ARES/
defaultContentLanguageen
markup.highlight.stylegithub-dark(高对比度代码块)
markup.highlight.noClassestrue(颜色内联,无需额外 CSS)