返回

静态博客网站工具

hexo

官方主页:https://hexo.io/zh-cn/

基于nodejs,部分主题对nodejs版本要求比较高,安装包升级包容易出现兼容性问题;

最大的问题就是编译速度太慢了。超过1W的文件量,windows底下就直接报“too many open files”错误,在linux下编译也是小时级别的,无法忍受。

找到的合适的主题:https://github.com/blinkfox/hexo-theme-matery

本地实施目录: F:\study\js\hexo_html 临时对比目录 F:\study\js\hexo2html

关于配置文件

根目录的配置文件和主题目录的配置文件一同生效,并且如果有相同配置,是以主题目录的配置为主的。这点试了好多次才发现的规律

遇到的问题:文件明太长,git无法cp文件,(windows文件名有255的长度限制)

报错信息:

1
unable to stat “xxxxxxxxxxxxxxxxxxx/index.html” Filename too long

解决方法:https://confluence.atlassian.com/bamkb/git-checkouts-fail-on-windows-with-filename-too-long-error-unable-to-create-file-errors-867363792.html

1
2
git config --system core.longpaths true
git config --global core.longpaths true

hugo

官网文档:https://gohugo.io/getting-started/quick-start/

合适的主题:https://themes.gohugo.io/themes/parsa-hugo/

​ :文档:https://docs.gethugothemes.com/parsa/?ref=github

  • 另一个参考的主题:https://themes.gohugo.io/themes/hugo-theme-dream/ (问题多,而且demo和文档都无法查到了)

本地实施并修改的目录:

cloudflare上部署的时候遇到版本太低的问题,用环境变量来指定版本。官方文档说明如下

  • 1
    
    Hugo builds automatically run an old version. To run the latest version of Hugo (for example, `0.80.0`), you will need to set an environment variable. Set `HUGO_VERSION` to `0.80.0` or the Hugo version of your choice.
    

更高阶的静态网站生成器

gatsby

Gatsby 是一个为 React 打造的快如闪电的现代化站点生成器

官网:https://www.gatsbyjs.com/how-it-works/

中文网站:https://www.gatsbyjs.cn/docs/

gridsome

基于 Vue.js 构建的 Jamstack 框架 Gridsome 让开发人员可以轻松地构建静态生成的网站和应用程序,这些网站和应用程序 天生速度快

官网:https://gridsome.org/

中文网站:https://www.gridsome.cn/