Postsread more
我的博客自动化发布SOP
这篇 SOP 记录当前博客的真实发布流程。早期我曾经用过 public 子模块和部署仓库分离的方案,但当前仓库已经改成更简单的方式:Markdown 源码、Hugo 模板和 GitHub Actions workflow 都在 caozuohua.github.io 仓库内,push 到 main 后由 Actions 构建并部署 GitHub Pages。
当前仓库结构
caozuohua.github.io/
├── content/posts/ # Markdown 文章源码
├── layouts/ # 站点模板覆盖
├── themes/ananke/ # Hugo 主题
├── hugo.toml # 站点配置
└── .github/workflows/ # GitHub Pages 部署流程
当前生产地址是 https://caozuohua.github.io/。本地构建产物会生成到 public/,但它只是验证结果,不再作为单独部署仓库提交。
第一阶段:内容创作
新文章统一放在 content/posts/ 下。推荐使用 page bundle 结构:
hugo new content/posts/YYYY-MM-DD-kebab-case-slug/index.md
Front matter 至少包含:
---
title: "文章标题"
date: 2026-06-30
publishDate: 2026-06-30
description: "一句话 SEO 摘要"
tags: ["标签1", "标签2"]
categories: ["分类"]
draft: false
---
写作完成后先做三项检查: