基础环境
安装 Hugo
访问 Hugo 选择下载适合当前系统的版本并下载
本博客使用 Hugo Windows AMD64
下载解压后可以直接文件夹内使用,或为其添加系统变量
安装 Git
访问 Git 选择下载适合当前系统的版本并下载
安装 Golang (非必要)
初始化博客
生成新博客
使用 hugo new site siteName
命令生成一个新的博客
将刚刚生成的博客文件夹初始化为一个 Git 仓库方便部署
添加 Stack 主题
访问 Stack ,Fork 一个自己的方便后期改动
在博客文件夹内使用 git submodule add submoduleUrl themes/hugo-theme-stack
命令
其中 submoduleUrl
为自己 Fork 的仓库地址,hugo-theme-stack
为主题名称
本博客使用 git submodule add git@github.com:Cerocate/HugoThemeStack.git themes/HugoThemeStac
命令
删除根目录下的 content
文件夹和 config.toml
文件
复制 themes/HugoThemeStack/exampleSite
文件夹中的所有文件至根目录
启动博客
使用 hugo server
命令启动博客