Butterfly 主题安装与基础配置
安装主题
1 | git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly |
升级:
1 | cd themes/butterfly |
1 | npm i hexo-theme-butterfly |
升级:
1 | npm update hexo-theme-butterfly |
NPM 安装文件在 node_modules 里,不在 themes 目录。
1 | git clone -b master https://gitee.com/immyw/hexo-theme-butterfly.git themes/butterfly |
适合国内网络慢的情况。
应用主题
修改根目录 _config.yml:
1 | theme: butterfly |
安装渲染器
1 | npm install hexo-renderer-pug hexo-renderer-stylus --save |
配置文件分离(重要)
在根目录创建 _config.butterfly.yml,把主题目录的 _config.yml 内容复制进去。
好处:升级主题时不会覆盖你的配置。
固定文章链接(abbrlink)
中文标题会导致 URL 乱码,改标题后链接失效。
1 | npm install hexo-abbrlink --save |
修改 _config.yml:
1 | permalink: post/:abbrlink.html |
效果:链接变成 https://xxx/post/abc123.html,简洁稳定。
代码块配置
深色背景,亮色文字,经典深色风。
柔和深色,护眼底色。
浅色背景,适合亮色主题。
海洋蓝色调。
Mac 风格深色(推荐)。
Mac 风格浅色。
1 | highlight_theme: mac |
顶部图配置
| 配置项 | 说明 |
|---|---|
index_img |
主页顶部图 |
default_top_img |
默认顶部图 |
archive_img |
归档页顶部图 |
tag_img |
标签页默认顶部图 |
category_img |
分类页默认顶部图 |
1 | index_img: /img/banner.jpg |
单篇文章单独设置(front-matter):
1 |
|
页脚背景
1 | footer_bg: true # 页脚显示图片背景 |
打字粒子特效
鼠标点击时的粒子爆炸效果:
1 | activate_power_mode: |
背景特效
1 | canvas_ribbon: |
静态几何线条,点击可切换。
1 | canvas_fluttering_ribbon: |
彩带随风飘动,更生动。
1 | canvas_nest: |
鼠标跟随粒子连线动画。
提示:特效越多加载越慢,手机端建议只开一个或全关。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Biko的个人小站!
