hugo 安装
windows 下安装与其他系统不同
特别安装 https://www.mingw-w64.org/downloads/ 下的 gcc
gcc -v 来检验是否完成。
我是安装 scoop 包管理器来安装 hugo 的。
hugo 和 hugo-extends 都安装了。
创建站点
创建
hugo new site site-name
输出:
Congratulations! Your new Hugo site is created in C:\Website.
Just a few more steps and you're ready to go:
1. Download a theme into the same-named folder.
Choose a theme from https://themes.gohugo.io/ or
create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".
Visit https://gohugo.io/ for quickstart guide and full documentation.
添加主题
主题 Blonde
git clone https://github.com/opera7133/Blonde themes/Blonde
cd themes/Blonde
git pull
1, 复制 package.json
2,复制 tailwind.config.js
3,复制 postcss.config.js
文件在 themes/Blonde/exampleSite 复制到根目录。
执行:npm install
查看站点:
npm run start
生成站点:
npm run build
添加内容文章
hugo new posts/new1.md
注:
更新文章后,再用 npm run start 是不能刷新出文章的。
可以使用 hugo server -D