这是 binbho7 的个人博客,使用 Hugo 构建的静态博客,部署在 Cloudflare Pages。
- ✅ Markdown 支持 - 使用 Markdown 格式编写文章
- ✅ 评论系统 - 集成 Giscus 评论功能
- ✅ 暗色模式 - 自动/手动切换亮色/暗色主题
- ✅ 搜索功能 - 基于 Fuse.js 的全文搜索
- ✅ 响应式设计 - 完美适配移动端和桌面端
- ✅ 快速加载 - 静态站点,CDN 加速
访问 Hugo 官网 下载并安装 Hugo。
# 克隆项目后进入目录
cd blog
# 启动开发服务器
hugo server -D
# 访问 http://localhost:1313hugo new posts/my-new-post.md本项目支持两种部署方式:
适合:纯静态博客,需要零配置自动部署
适合:需要 API、动态功能或更多控制
查看 Workers 部署指南 或 DEPLOY-WORKERS.md
-
将代码推送到 GitHub/GitLab
-
进入 Workers & Pages → 创建应用程序 → Pages → 连接到 Git
-
选择你的仓库并配置构建设置:
- 构建命令:
hugo --gc --minify - 构建输出目录:
public - Node.js 版本:不适用(Hugo 不需要)
- 构建命令:
-
点击 保存并部署
# 构建网站
hugo --gc --minify
# 使用 Wrangler CLI 部署
npm install -g wrangler
wrangler pages deploy public编辑 hugo.toml 文件:
baseURL = 'https://your-blog.pages.dev/'
title = '我的博客'-
访问 Giscus 官网
-
使用 GitHub 账号登录,配置你的仓库
-
获取配置参数并更新到
hugo.toml:
[params.comments.giscus]
enabled = true
repo = "your-username/your-repo"
repoId = "your-repo-id"
category = "Announcements"
categoryId = "your-category-id"Stack 主题支持高度自定义,详见:
blog/
├── content/ # 网站内容
│ ├── posts/ # 博客文章
│ └── about.md # 关于页面
├── static/ # 静态资源(图片、CSS、JS)
├── layouts/ # 自定义布局
├── data/ # 数据文件
├── themes/ # 主题
│ └── hugo-theme-stack/
├── hugo.toml # Hugo 配置文件
└── README.md # 本文件
MIT License