Hexo+Butterfly主题博客搭建02 ——— 下载有关butterfly主题并进行配置

Butterfly主题的安装

  1. 在 hexo 项目根目录下执行操作clone主题
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
  1. 如果沒有 pug 以及 stylus 的渲染器,还需要下载,否则在项目运行时会报错:
npm install hexo-renderer-pug hexo-renderer-stylus --save
  1. 修改项目根目录下的_config.yml文件(称为站点配置文件),开启主题
# extensions
## plugins: https://hexo.io/plugins/
## themes: https://hexo.io/themes/
#theme: landscape
theme: butterfly
  1. 升级建议

为了減少升级主题带来的不便,我们还需要做以下操作:
把主题文件夹中的 _config.yml 复制到 hexo 根目录下,同重命名为 _config.butterfly.yml

hexo会自动合并主题中的 _config.yml 和 _config.butterfly.yml 里的配置,如果存在同名配置,会使用 _config.butterfly.yml 的配置,其优先度较高。

butterfly主题