1/11/2025

Hugo 博客搭建记录

本文简要说明了 Hugo 博客的建站流程,时间久了容易遗忘,在这里记录一下,希望也能对大家有所帮助。

安装 Hugo 和 Github Desktop

brew install hugo

安装 Github Desktop,并连接仓库

创建博客

hugo new site my-blog
cd my-blog

添加主题

git submodule add https://github.com/yuanji-dev/futu.git themes/futu
git submodule add https://github.com/martignoni/hugo-notice.git themes/hugo-notice

配置 hugo.toml 和其他博客相关文件

参考 nikkiYuanji’s Blog

Cloudflare pages 部署

参考 Windows 下使用 Hugo 和 Cloudflare Pages 配置博客

Github Action 自动部署

参考 nikki.github 目录下的文件

其他问题

常用 Hugo 命令

hugo new posts/article.md  # 创建新博文
hugo server -D -w  # 启动服务器,在本地预览网站

没有评论:

发表评论

Cloudflare R2 + WebP Cloud + uPic 免费图床方案

搭建免费全球可访问的图床方案:Cloudflare R2 + WebP Cloud + uPic