引言 {#引言}
hexo-theme-butterfly是基於 hexo-theme-melody 的基礎上進行開發的。
Bufferfly主题安装 {#Bufferfly主题安装}
在hexo主题根目录下通过git bash输入以下命令安装Butterfly主题。
|-----------|----------------------------------------------------------------------------------------------------|
| 1 | git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly |
应用Butterfly主题 {#应用Butterfly主题}
修改 Hexo 根目录下的 _config.yml,把主题改为butterfly。(大概在_config.yml文件代码第100行)
|-----------------|---------------------------------------------------------------------------------------------------------------|
| 1 2 3 4 | # Extensions ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ theme: butterfly |
安装插件 {#安装插件}
一般情况下在上一步结束后就可以直接在本地运行成功了,但是butterfly主题依赖 pug 以及 stylus 的渲染器,如果不安装此插件直接运行网站会出现错误。
pug 以及 stylus 的渲染器安装命令如下所示:
|-----------|-------------------------------------------------------------------|
| 1 | npm install hexo-renderer-pug hexo-renderer-stylus --save |
安装完成后,清除缓存重新运行即可。
主题升级 {#主题升级}
在 Hexo 的根目录创建一个文件 _config.butterfly.yml,并把主题目录的 _config.yml 内复制到 _config.butterfly.yml 。以后只需要在 _config.butterfly.yml 进行配置就可以了。
注意:不要把主題目錄的
_config.yml刪掉。
Hexo会自动合并主题中的_config.yml和 _config.butterfly.yml 里的配置,如果存在同名配置,会使用_config.butterfly.yml的配置,其优先度更高。
注意:以後只需要在 _config.butterfly.yml進行配置就行。
如果使用了_config.butterfly.yml, 配置主題的 _config.yml 將不會有效果。
51工具盒子