Hugo + PaperMod 博客写作完全指南

📝 创建新文章 使用 Hugo 命令创建 1 2 3 4 # 创建新文章 hugo new posts/my-article.md # 文章会自动应用 archetypes/default.md 模板 文件命名建议 ✅ 推荐:使用小写字母 + 连字符:how-to-write-hugo.md ✅ 可选:使用下划线:my_first_post.md ⚠️ 支持但不推荐:中文文件名 我的文章.md 🎯 Front Matter 配置详解 Front Matter 是文章开头的元数据部分,Hugo 支持 YAML 和 TOML 两种格式。 YAML 格式(推荐) 使用 --- 包裹,更易读,是本博客的标准格式: 1 2 3 4 5 6 7 8 9 --- title: "文章标题" date: 2025-11-15T14:30:00+08:00 draft: false author: "LexHsu" categories: ["tech", "life"] tags: ["hugo", "markdown"] description: "文章摘要,显示在列表页和搜索结果中" --- TOML 格式(备选) 使用 +++ 包裹: ...

November 15, 2025 · 6 min · LexHsu