Hi Hugo

发布时间 2020年6月11日 (更新时间 2023年12月12日) • 1 分钟 读完 • 154 字
分享链接

记录再一次折腾博客从 Hexo 转到 Hugo

放弃 Hexo

再一次又不得不折腾了下 Blog,原因是博文量起来后 Hexo 编译速度真是令人担忧,

INFO  Start processing
INFO  Files loaded in 1.55 s
INFO  Generated: atom.xml
INFO  Generated: about/index.html
...
...
INFO  318 files generated in 3.77 s

目前的编译耗时5s多些,还可以接受,但是发布到 OSS 还需要小5s,有时间push 到 OSS 尽然偶尔有错误,这就不能忍了。

拥抱 hugo

听闻 hugo 的编译速度是最快的没有之一,再加上自己这段时间也再持续再研究 Golang,拥抱 hugo 自然是不二之选。

我使用的主题依然还是 even

编译时间

(base) ➜  blog.codingbing.com git:(master) ✗ hugo -t even --buildDrafts

                   | EN
-------------------+------
  Pages            | 155
  Paginator pages  |  19
  Non-page files   |   0
  Static files     |  38
  Processed images |   0
  Aliases          |  50
  Sitemaps         |   1
  Cleaned          |   0

Total in 280 ms

发布时间(受影响于网络带宽)

(base) ➜  blog.codingbing.com git:(master) ✗ ./oss_upload.sh
checking env variables if all ready...

env checked completed, ready to download ossutil....

oss config initial completed,ready to upload files from /Users/bing/hexo/blog.codingbing.com/public ...

Succeed: Total num: 513, size: 2,660,503. OK num: 513(upload 227 files, skip 286 files), Skip size: 1,094,602.
3.917379(s) elapsed

done

将 hexo 文章的 front mater 转为 hugo 需要的类型,我没找搜索到特别好用的,这个开发者用 go 实现的一个,我使用时还不太完善,可以将就用一下ayuayue/hexo2hugo

本次折腾花费了,花费了一下午的时间,罪过,罪过。

参考文章


评论

关注我

我的工作是编码和发布开发者表情包