hugo安装
方式一
mac使用brew安装,简单直接
brew install hugo
hugo version
方式二
由于看中的一款主题要求hugo不低于某版本,brew默认安装的版本不满足,想要安装其它版本。推荐直接下载可执行文件。
参考:https://www.dazhuanlan.com/2019/10/24/5db109f5382e7/
主题下载和配置
这里很多主题,略扫一遍,看中hugo-theme-pure。很喜欢这款主题,简单纯粹。
cd themes/
git clone https://github.com/xiaoheiAh/hugo-theme-pure
编辑config.yml,添加
theme: hugo-theme-pure
生成文章
新建博客项目
hugo new site blog
新建博文
hugo new posts/hello-hugo.md
预览网站
hugo server -D
预览无误后将要发布的文章内draft改为false后执行命令
hugo
根目录下多出的/public文件夹即为hugo生成的整个静态网站。
参考: