转载翻译自: https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-installation/
作者:PaperMod Authors
已获得作者授权
中文demo
https://note.ftls.xyz/papermod/
介绍
-
我们将在下面的所有示例中使用
yml/yaml
格式,我建议使用yml
而不是toml
,因为它更易于阅读。 -
如果你需要,你可以找 YML to TOML 这类转换器。
指南
按照 快速入门 指南设置 Hugo 并创建一个新站点。
注意:使用 -f 选择 yml 格式
hugo new site <name of site> -f yml
确保安装最新版本的**hugo(>=0.82.0)
**。
创建新站点后,在Step 3 执行以下步骤:
方法一
在 Hugo 站点的文件夹中,运行:
git clone https://github.com/adityatelange/hugo-PaperMod themes/PaperMod --depth=1
注意:如果你想坚持特定的版本,你可以使用--branch v5.0
来结束上面的命令。
更新主题 :
cd themes/PaperMod git pull
方法二
您可以将其用作 submodule
git submodule add https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod --depth=1
git submodule update --init --recursive # needed when you reclone your repo (submodules may not get cloned automatically)
注意:如果你想坚持特定的版本,你可以使用--branch v5.0
来结束上面的命令。
更新主题 :
git submodule update --remote --merge
方法三
或者您可以从 Github Page 下载为 Zip 并解压到您的主题目录中
直达链接:
最后 …
在config.yml
中添加:
theme: "PaperMod"
相关链接
config.yml
示例
示例站点在这里:exampleSite
适当使用
baseURL: "https://examplesite.com/"
title: ExampleSite
paginate: 5
theme: PaperMod
enableRobotsTXT: true