这是 yan 的个人博客站点,使用 Hugo 静态站点生成器与 PaperMod 主题。
🌐 网站地址:https://luoziyan100.github.io/myweb/
- 主题子模块(首次克隆后):
git submodule update --init --recursive
- 本地预览:
hugo server -D # 浏览器访问 http://localhost:1313
- 文章存放:
content/posts/<年份>/<月份(中文)>/YYYY-MM-DD-标题.md - Front matter 示例:
--- title: "文章标题" date: 2025-09-01T10:00:00+08:00 author: "yan" tags: ["AI", "实践"] image: "/images/image-1.png" # 存在于 static/images/ excerpt: "文章简介..." ---
- 图片放置:
static/images/,文内引用以/images/xxx开头。
通过 GitHub Actions 自动部署到 GitHub Pages。
- 将内容提交到
main分支:git add . && git commit -m "post: 新文章" && git push
- GitHub Actions 会自动构建并发布,无需手动操作。
💡 自动化流程:推送到
main分支后,CI 会使用 Hugo 0.149.0 构建静态文件并部署到 GitHub Pages。
content/:文章与页面static/:静态资源(图片、图标等)themes/PaperMod:主题子模块hugo.toml:站点配置
- 未来日期文章默认可见(
buildFuture=true);如不需要可在hugo.toml关闭。 - 如果
hugo server报主题缺失,执行子模块初始化命令。