1️⃣ 创建 Hugo 项目
📁 创建目录
cd D:\blogprojects
hugo new site myblog
cd myblog
2️⃣ 安装主题(PaperMod)
✔ 推荐方式:手动复制
将主题放入:
themes/PaperMod
必须包含:
- layouts/
- assets/
- theme.toml
3️⃣ 配置 hugo.toml
notepad hugo.toml
基础配置:
title = "今日分享"
theme = "PaperMod"
defaultContentLanguage = "zh-cn"
[pagination]
pagerSize = 5
[params]
defaultTheme = "auto"
ShowToc = true
4️⃣ 启动本地服务器
hugo server --buildDrafts
访问:
http://localhost:1313
5️⃣ 写文章测试
创建文章
hugo new content posts/test.md
编辑文章
notepad .\content\posts\test.md
+++
title = "测试文章"
date = 2026-05-15
draft = false
+++
# Hello Hugo
这是测试内容
🧠 本阶段目标
✔ 本地能正常访问网站
✔ 文章可以正常显示
✔ 主题加载成功