一个基于 Hugo 和 Congo 主题构建的个人博客,支持中英文双语。
- 多语言支持:中文和英文双语切换
- 现代化设计:基于 Congo 主题的优雅界面
- 响应式布局:完美适配各种设备
- 快速加载:Hugo 静态站点生成器
- SEO 优化:内置 SEO 功能
- 暗色模式:支持明暗主题切换
blog/
├── config/ # 配置文件
│ └── _default/
│ ├── hugo.toml # Hugo 主配置
│ ├── languages.en.toml # 英文配置
│ └── languages.zh-Hans.toml # 中文配置
├── content/ # 内容文件
│ ├── posts/ # 博客文章
│ ├── about.md # 关于页面
│ └── _index.md # 首页
├── layouts/ # 自定义布局
├── themes/ # 主题文件
│ └── congo/ # Congo 主题
├── static/ # 静态资源
└── public/ # 构建输出
- Hugo Extended 版本
- Git
-
克隆仓库
git clone https://github.com/arkin-developer/blog.git cd blog -
启动开发服务器
hugo server --buildDrafts --buildFuture
-
访问网站
- 打开浏览器访问:
http://localhost:1313
- 打开浏览器访问:
hugo --minify-
创建新文章
hugo new posts/my-new-post.md
-
文章格式
--- title: "文章标题" date: 2024-01-01 description: "文章描述" tags: ["标签1", "标签2"] categories: ["分类"] --- 文章内容...
项目支持中英文双语:
- 中文:
/zh-hans/ - 英文:
/en/
在网站底部可以切换语言,或直接访问对应语言路径。
在 config/_default/params.toml 中修改:
colorScheme = "congo" # 可选:congo, avocado, cherry, fire, ocean, sapphire, slate在语言配置文件中修改作者信息:
[params.author]
name = "ArkinDev"
image = "img/author.jpg"
headline = "全栈开发者"
bio = "专注于Web开发和开源项目"本项目使用 GitHub Actions 自动部署到 GitHub Pages:
- 推送代码到
main分支 - GitHub Actions 自动构建和部署
- 访问:
https://arkin-developer.github.io/blog
# 构建
hugo --minify
# 推送到 GitHub
git add .
git commit -m "Update site"
git push origin main- 复制主题文件到
layouts/目录 - 根据需要修改模板文件
在 assets/css/custom.css 中添加自定义样式。
在 layouts/_partials/extend-footer.html 中添加自定义脚本。
本项目采用 MIT 许可证。
欢迎提交 Issue 和 Pull Request!
- GitHub:@arkin-developer
- 邮箱:[email protected]
⭐ 如果这个项目对您有帮助,请给个 Star!