Butterfly 安装文档(一) 快速开始
📖 本教程更新于 2022 年 08 月 18 日,教程的内容针对最新稳定版而更新(如果你是旧版,教程会有些出入,请留意)
🦋 Butterfly 已经更新到 4.4.0
你可以通过右下角的 简 按钮切换为简体显示
hexo-theme-butterfly是基于 hexo-theme-melody 的基础上进行开发的。
安装
稳定版【建议】
在你的 Hexo 根目录里
1 | git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly |
测试版
测试版可能存在 bug,追求稳定的请安装稳定版
如果想要安装比较新的 dev 分支,可以
1 | git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly |
升级方法:在主题目录下,运行 git pull
稳定版【建议】
在你的 Hexo 根目录里
1 | git clone -b master https://gitee.com/immyw/hexo-theme-butterfly.git themes/butterfly |
测试版
测试版可能存在Bugs,追求稳定的请安装稳定版
如果想要安装比较新的dev分支,可以
1 | git clone -b dev https://gitee.com/immyw/hexo-theme-butterfly.git themes/butterfly |
升级方法:在主题目录下,运行git pull
此方法只支持 Hexo 5.0.0 以上版本
通过 npm 安装并不会在 themes 里生成主题文件夹,而是在 node_modules 里生成
在你的 Hexo 根目录里
1 | npm i hexo-theme-butterfly |
升级方法:在 Hexo 根目录下,运行 npm update hexo-theme-butterfly
应用主题
修改 Hexo 根目录下的 _config.yml,把主题改为butterfly
1 | theme: butterfly |
安装插件
如果你没有 pug 以及 stylus 的渲染器,请下载安装:
1 | npm install hexo-renderer-pug hexo-renderer-stylus --save |
升级建议
为了减少升级主题后带来的不便,请使用以下方法(建议,可以不做)。
在 hexo 的根目录创建一个文件 _config.butterfly.yml,并把主题目录的 _config.yml 内容複制到 _config.butterfly.yml 去。( 注意: 複制的是主题的 _config.yml ,而不是 hexo 的 _config.yml)
注意: 不要把主题目录的
_config.yml删掉
注意: 以后只需要在
_config.butterfly.yml进行配置就行。
如果使用了_config.butterfly.yml, 配置主题的_config.yml将不会有效果。
Hexo会自动合併主题中的_config.yml和 _config.butterfly.yml里的配置,如果存在同名配置,会使用_config.butterfly.yml的配置,其优先度较高。









