环境准备:wsl 中安装好了 go, hugo, npm, node

  1. 初始化hugo site
hugo new site MyFreshWebsite --format yaml
  1. 下载主题

https://github.com/adityatelange/hugo-PaperMod/archive/master.zip 将这个主题下载解压缩到MyFreshWebsite/themes/PaperMod文件夹

  1. 配置主题
echo "theme: ["PaperMod"]" >> hugo.yaml

接下来,就可以通过hugo server 命令运行项目了。

对于一个新网站,还没有任何内容。可以参考 https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite 往content中添加文件。

hugo new content content/posts/hugo-tutorial.md

添加上文章内容后,运行 hugo server -D 看测试效果。

image.png

image.png

如果需要发布网站,运行 hugo, 网站就打包到 public 文件夹中了。

参考资料:https://github.com/adityatelange/hugo-PaperMod/wiki/Installation