📖 本教程更新於 2023 年 02 月 20 日,教程的內容針對最新穩定版而更新(如果你是舊版,教程會有些出入,請留意)
🦋 Butterfly 已經更新到 4.7.0
📚 文檔目錄
🚀 快速開始 - 📑 主題頁面 - 🛠 主題配置 - 1 - ⚔️ 主題配置 - 2 - Post not found: Butterfly - 安裝文檔 - 五 - 主題問答 ❓ 主題問答 - Post not found: Butterfly - 安裝文檔 - 六 - 進階教程 ⚡️ 進階教程 - Post not found: Butterfly - 安裝文檔 - 七 - 更新日誌 ✨ 更新日誌 - Post not found: Butterfly - 打賞 🤞 打賞
你可以通過右下角的 簡 按鈕切換為簡體顯示
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
的配置,其優先度較高。