Hugo及GitHub Pages迁移教程
安装软件 安装Git for Windows 1 2 C:\>git --version git version 2.35.2.windows.1 安装Hugo 把下载的hugo_extended_0.97.0_Windows-64bit.zip解压到C:\bin\hugo_extended_0.97.0_Windows-64bit。 把该目录添加到Path。 1 2 C:\>hugo version hugo v0.97.0-c07f3626e7c8160943591f4d209977efa02c3dca+extended windows/amd64 BuildDate=2022-04-14T08:45:07Z VendorInfo=gohugoio 在本地搭建 新建项目 1 2 C:\>cd _gh C:\_gh>hugo new site hanson2010.github.io 由于Hugo跟Hexo不同,没有内置模板,下载一份喜欢的模板(我用kiera)。 1 2 3 4 C:\_gh>cd hanson2010.github.io C:\_gh\hanson2010.github.io>git init C:\_gh\hanson2010.github.io>git submodule add https://github.com/funkydan2/hugo-kiera.git themes/kiera C:\_gh\hanson2010.github.io>echo theme = "kiera" > config.toml 试发一篇文章 1 C:\_gh\hanson2010.github.io>hugo new posts/my-first-post.md 这时已生成一个文件content/posts/my-first-post.md,而且内容被初始化为: 1 2 3 title: "My First Post" date: 2022-04-14T20:07:04+08:00 draft: true 本地运行 1 C:\_gh\hanson2010.github.io>hugo server -D 访问http://localhost:1313看看效果吧: ...