title = “使用 Hugo 搭建个人博客 part 3 : 本地测试” date = 2026-05-15T14:00:00+08:00 draft = false

分类(大类)

categories = [“Hugo”]

标签(细节)

tags = [“博客”, “Cloudflare”, “GitHub”, “Hugo”]

自动目录

showToc = true TocOpen = true

文章简介

summary = “记录使用 Hugo + Cloudflare 搭建个人博客的完整流程”

封面(可选)

cover = { image = “/images/hugo-cover.jpg” } +++

Cloudflare部署Hugo个人博客(part 2 :本地测试)


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

这是测试内容

🧠 本阶段目标

✔ 本地能正常访问网站
✔ 文章可以正常显示
✔ 主题加载成功