今日分享

记录学习 · 技术 · 工具 · 生活

Cloudflare部署Hugo个人博客(三步走③自动化上传)

Cloudflare部署Hugo个人博客(三步走③自动化上传) 1️⃣ 初始化 Git 仓库 git init 2️⃣ 配置 .gitignore 创建文件: notepad .gitignore 内容: public/ resources/ .hugo_build.lock 3️⃣ 提交源码到 GitHub git add . git commit -m "init blog" 4️⃣ 推送到 GitHub git branch -M main git remote add origin https://github.com/你的用户名/仓库名.git git push -u origin main 5️⃣ Cloudflare Pages 配置 连接 GitHub 仓库 选择你的 Hugo 仓库 构建配置 Build command: hugo Output directory: public 环境变量 HUGO_VERSION = 0.147.0 6️⃣ 自动部署流程 以后只需要: ...

May 15, 2026 · 1 min

Cloudflare部署Hugo个人博客(三步走②本地测试)

Cloudflare部署Hugo个人博客(三步走②本地测试) 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 编辑文章 +++ title = "测试文章" date = 2026-05-15 draft = false +++ # Hello Hugo 这是测试内容 🧠 本阶段目标 ✔ 本地能正常访问网站 ✔ 文章可以正常显示 ✔ 主题加载成功

May 15, 2026 · 1 min

Cloudflare部署Hugo个人博客(三步走①基础准备)

Cloudflare部署Hugo个人博客(三步走①基础准备) 1️⃣ 系统环境准备 🖥 操作系统 Windows 10 / Windows 11 🧰 必备工具 ① Windows Terminal 用于统一管理 PowerShell 终端 安装方式 Microsoft Store 搜索 Windows Terminal 安装后设置 PowerShell 为默认终端 🌐 必备账号 GitHub 用途:存储博客源码 + 自动部署触发 Cloudflare 用途:自动构建 Hugo 网站 + CDN 加速 + 域名绑定 ⚙️ Hugo 安装 下载 Hugo Extended https://github.com/gohugoio/hugo/releases 选择: hugo_extended_windows-amd64.zip 🔧 配置环境变量 将 Hugo 解压目录加入 Path ✅ 验证安装 hugo version 🧠 本阶段目标 ✔ 工具安装完成 ✔ 环境变量配置完成 ✔ 账号注册完成 ✔ Hugo 可运行

May 15, 2026 · 1 min