这是一个基于 Hugo 的个人博客项目。
请参考 Hugo 官方安装指南。
git clone <repository-url> --recursive
cd bloghugo server -D然后在浏览器中打开 http://localhost:1313 即可查看博客。
. # 博客根目录
├── archetypes/ # 内容模板
├── content/ # 博客文章和页面
│ ├── posts/ # 文章
│ └── pages/ # 页面
├── layouts/ # 页面布局
├── static/ # 静态文件(CSS、JS、图片等)
├── themes/ # 主题
├── hugo.toml # 配置文件
└── README.md # 项目说明
hugo new content content/posts/my-first-post.md然后编辑 content/posts/my-first-post.md 文件,添加内容。
本项目使用 PaperMod 主题。
安装主题:
git submodule add <repository-url> themes/<theme-dir>更新所有主题到最新版本:
git submodule update --remote本项目使用 pagefind 实现站内搜索。
hugo && npx pagefind --site public这会在 public/ 目录下生成静态网站文件和搜索索引文件。
你可以将 public/ 目录下的内容部署到任何静态网站托管平台,例如:
- GitHub Pages
- Netlify
- Vercel
- Cloudflare Pages