avatar

hexo-theme-butterfly 安裝文檔(一)快速開始

本文转载自 https://jerryc.me/posts/21cfbf15/#%E5%AE%89%E8%A3%9D

快速开始

hexo-theme-butterfly 是基于Molunerfinn的hexo-theme-melody的基础上进行开发的。
文档也是在hexo-theme-melody的文档基础上修改。因为一些配置变更导致与原主题配置上有部分区别。故如果安装hexo-theme-butterfly主题,请参考这篇文档。

主题安装和升级

安装

在你的博客根目录里

1
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly

如果想要安装比较新的dev 分支,可以

1
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly

应用主题

修改站点配置文件_config.yml,把主题改为Butterfly

1
theme:  Butterfly

如果你没有pug以及stylus的渲染器,请下载安装:

1
2
3
npm install hexo-renderer-pug hexo-renderer-stylus --save
或者
yarn add hexo-renderer-pug hexo-renderer-stylus

平滑升级

为了主题的平滑升级,Butterfly使用了data files特性。

推荐把主题默认的配置文件_config.yml复制到 Hexo工作目录下的 source/_data/butterfly.yml,如果source/_data的目录不存在那就创建一个。

注意,如果你创建了butterfly.yml,它将会替换主题默认配置文件_config.yml里的配置项( 不是合并而是替换 ),之后你就只需要通过git pull的方式就可以平滑地升级theme-butterfly了。

文章作者: Wu Fei
文章链接: http://linuxwf.com/2020/04/08/hexo-theme-butterfly-%E5%AE%89%E8%A3%9D%E6%96%87%E6%AA%94%EF%BC%88%E4%B8%80%EF%BC%89%E5%BF%AB%E9%80%9F%E9%96%8B%E5%A7%8B-1/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 WF's Blog
打赏
  • 微信
    微信
  • 支付宝
    支付宝

评论