使用 hugo 搭建 Blog 记录

1. 安装 hugo 对于Arch系Linux系统使用 pacman -S hugo 其他安装方式去官网查看 2. 使用 hugo 创建 Blog hugo new site <MyBlog> <MyBlog> 为自己想创建的文件夹名称 3. 下载 hugo 主题 到项目的根目录下, 即 MyBlog 文件夹下 我个人比较喜欢使用的主题为PaperMod 有两种使用 git 管理主题的方式 第一种是直接将主题 clone 到指定目录 git clone --depth 1 <github url> themes/<theme name> 第二种是使用 git submodule 来管理主题(以PaperMod主题为例) git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod 然后 cd themes/PaperMod git ls-remote --tags 用来查看该仓库的tag名称 git fetch --tags 将 tag 从远程仓库拉取下来 git tag 可以查看 tag 的名称 git checkout <tag_name> 切换到指定tag 切换到指定 tag 后,可以主git目录使用 git commit -a 来更改 submodule 的 tag 进行提交 日后重新 clone 该仓库到本地,不会自动 clone submodule 可以使用 git submodule update --init --depth 1 --recursive 来手动 clone 一般主题下面都有一个 exampleSite/config....