近来我的博客迁移到了hugo框架下,并使用blowfish作为主题,以下是我探索的过程。
创建站点
hugo new site mywebsite使用主题(共有三种方法)
git submodule:
git init git submodule add -b main https://github.com/nunocoracao/blowfish.git themes/blowfish并解注释(或手动添加)
config/_default/hugo.toml里的theme = blowfishhugo mod(使用go 下载包)
# If you're managing your project on GitHub hugo mod init github.com/<username>/<repo-name> # If you're managing your project locally hugo mod init my-project并编辑
config/_default/module.toml[[imports]] disable = false path = "github.com/nunocoracao/blowfish/v2"随后
hugo server就可以自动下载包了手动复制主题到对应文件夹下
hugo mod的好处#
由于国内网络不太好,使用git submodule update --init --recursive比较吃亏。另外由于go mod国内有源可以换,所以更快?(存疑)