golang hugo 生成静态站点

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值