依赖
1 | git --version |
一键启动
1 | npm install hexo && npx hexo init blog && cd blog && npm un hexo-theme-landscape && npm i hexo-theme-butterfly hexo-renderer-pug && sed 's/landscape/butterfly/g' _config.yml > _config.yml.tmp && mv _config.yml.tmp _config.yml && curl -o _config.butterfly.yml https://cdn.jsdelivr.net/gh/jerryc127/hexo-theme-butterfly/_config.yml && npx hexo clean && npx hexo server |
普通安装
一键启动的分解
hexo&&butterfly安装
1 | npm install hexo #mac全局安装有权限问题,所以使用非全局 |
butterfly安装
1 | npm un hexo-theme-landscape #卸载默认主题 |
hexo配置
blog/_config.yml
的theme: landscape
改成下面
1 | theme: butterfly #修改默认主题 |
使用代码
1 | sed 's/landscape/butterfly/g' _config.yml > _config.yml.tmp && mv _config.yml.tmp _config.yml |
预览
1 | npx hexo clean && npx hexo server #清理和启动主题 |
主题配置下载
1 | curl -o _config.butterfly.yml https://cdn.jsdelivr.net/gh/jerryc127/hexo-theme-butterfly/_config.yml |
配置修改
hexo配置
blog/_config.yml
里修改,https://hexo.io/zh-cn/docs/configuration
主题配置
blog/_config.butterfly.yml
里修改,https://butterfly.js.org
卸载Hexo
1 | #npm uninstall hexo-cli -g |
参考
https://github.com/hexojs/hexo
https://github.com/jerryc127/hexo-theme-butterfly
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Ln's Blog!
评论