Compare commits

...
14 Commits
37 changed files with 1267 additions and 982 deletions

No files matched your search

+12 -18
View File
@@ -1,27 +1,21 @@
name: npm publish name: npm publish
on: on:
release: release:
types: [created] types: [created]
jobs: jobs:
build: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
id-token: write # OIDC 必須 id-token: write # OIDC 必須
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# Setup .npmrc file to publish to npm - uses: actions/setup-node@v4
- uses: actions/setup-node@v4 with:
with: node-version: '24' # trusted publishing 需要 >= 22.14
node-version: '20.x' - run: npm install -g npm@latest
registry-url: 'https://registry.npmjs.org' - run: npm install
- name: Publish
- run: npm install run: |
echo "repo=$GITHUB_REPOSITORY"
- run: npm publish --provenance --access public npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+158 -90
View File
@@ -1,5 +1,5 @@
<div align="right"> <div align="right">
<a title="中文" href="/README_CN.md">中文</a> <a title="繁體中文" href="./README_CN.md">繁體中文</a>
</div> </div>
<div align="center"> <div align="center">
@@ -8,18 +8,18 @@
# hexo-theme-butterfly # hexo-theme-butterfly
A modern, elegant and feature-rich theme for Hexo A modern, elegant, and feature-rich theme for Hexo
![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/master?color=%231ab1ad&label=master) ![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/master?color=%231ab1ad&label=master)
![dev version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev) ![dev version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev)
![npm version](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff) ![npm version](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%23bf00ff)
![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83cd) ![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83cd)
![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531) ![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531)
![GitHub stars](https://img.shields.io/github/stars/jerryc127/hexo-theme-butterfly?style=social) ![GitHub stars](https://img.shields.io/github/stars/jerryc127/hexo-theme-butterfly?style=social)
📢 **Demo**: [Butterfly Official](https://butterfly.js.org/) | [CrazyWong's Blog](https://blog.crazywong.com/) 📢 **Demo**: [Official Site](https://butterfly.js.org/) | [CrazyWong's Blog](https://blog.crazywong.com/)
📖 **Documentation**: [English Docs](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/) | [中文文档](https://butterfly.js.org/posts/21cfbf15/) 📖 **Documentation**: [English](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/) | [中文文檔](https://butterfly.js.org/posts/21cfbf15/)
![Butterfly Theme Preview](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/theme-butterfly-readme.png) ![Butterfly Theme Preview](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/theme-butterfly-readme.png)
@@ -27,166 +27,234 @@ A modern, elegant and feature-rich theme for Hexo
--- ---
## 📑 Table of Contents
- [Requirements](#requirements)
- [Quick Start](#quick-start)
- [Upgrade](#upgrade)
- [Theme Features](#theme-features)
- [Screenshots](#screenshots)
- [Get Help & Support](#get-help)
- [License](#license)
<a id="requirements"></a>
## 📋 Requirements
- **Hexo**: 5.3.0 or later
- **Node.js**: 18 or later (`hexo-util` 4.x requires it)
- **Git**: only needed for Git installs
<a id="quick-start"></a>
## 🚀 Quick Start ## 🚀 Quick Start
### 💾 Installation ### 💾 Installation
#### Method 1: Git Installation (Recommended) #### Option 1: Git (Recommended)
> 💡 **Tip**: If GitHub access is slow in mainland China, you can use the [Gitee Mirror](https://gitee.com/immyw/hexo-theme-butterfly.git) > 💡 **Tip**: If GitHub access is slow from mainland China, use the [Gitee mirror](https://gitee.com/immyw/hexo-theme-butterfly.git).
Execute in your Hexo blog root directory: Run the following in your Hexo blog root:
```bash ```bash
# Install stable version (recommended) # Stable release (recommended)
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly git clone -b master --depth 1 https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
``` ```
```bash ```bash
# Install development version (early access to new features) # Development branch (early access to new features)
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly git clone -b dev --depth 1 https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
``` ```
#### Method 2: NPM Installation > 📁 If `themes/butterfly` already exists, remove or rename it first; `git clone` will fail if the target folder isn't empty.
> ⚠️ **Note**: NPM installation only supports Hexo 5.0.0 and above #### Option 2: npm
```bash ```bash
npm install hexo-theme-butterfly npm install hexo-theme-butterfly
``` ```
### ⚙️ Theme Configuration > ⚠️ **Note**: npm doesn't create a folder under `themes/`; the theme goes into `node_modules/` instead.
1. **Enable Theme**: Modify your Hexo configuration file `_config.yml`: ### ⚙️ Enable & Configure
```yaml 1. **Enable the theme**: set it in the `_config.yml` at your Hexo root:
theme: butterfly
```
2. **Install Dependencies**: If you haven't installed pug and stylus renderers, please run: ```yaml
theme: butterfly
```
2. **Copy the theme config** (recommended, so upgrades don't overwrite your settings):
```bash
# Git install
cp themes/butterfly/_config.yml _config.butterfly.yml
# npm install
cp node_modules/hexo-theme-butterfly/_config.yml _config.butterfly.yml
```
> 💡 Hexo 5+ automatically loads `_config.butterfly.yml` from the blog root. On Windows, use `copy themes\butterfly\_config.yml _config.butterfly.yml` for Git installs, or `copy node_modules\hexo-theme-butterfly\_config.yml _config.butterfly.yml` for npm installs.
>
> ⚠️ After this, edit only `_config.butterfly.yml`. Don't delete the theme's own `_config.yml`, and keep custom files and images out of the theme's `source/` folder — upgrades may overwrite them.
3. **Install the renderers and preview locally**:
```bash
npm install hexo-renderer-pug hexo-renderer-stylus --save
hexo clean && hexo s
```
<a id="upgrade"></a>
## 🔄 Upgrade
**Git install**
```bash ```bash
npm install hexo-renderer-pug hexo-renderer-stylus --save cd themes/butterfly
git pull
``` ```
**npm install**
```bash
npm update hexo-theme-butterfly
```
Before upgrading, back up your config. After upgrading, check [Releases](https://github.com/jerryc127/hexo-theme-butterfly/releases) for `_config` changes and merge them into `_config.butterfly.yml`.
<a id="theme-features"></a>
## ✨ Theme Features ## ✨ Theme Features
### 🎨 Design Style > 💡 All features can be configured in `_config.butterfly.yml`. See the [theme configuration docs](https://butterfly.js.org/en/posts/butterfly-docs-en-theme-config/) for details.
- [x] **Card-based Design** - Modern card-style layout
- [x] **Rounded/Square Design** - Customizable border styles
- [x] **Responsive Design** - Perfect adaptation to all screen sizes
- [x] **Two-column Layout** - Optimized reading experience
- [x] **Dark Mode** - Eye-friendly night mode
### 📝 Content Features ### 🎨 Design
- [x] **Multi-level Menu** - Support for secondary navigation menus - ✅ **Card-based design** — Modern card layout
- [x] **Reading Mode** - Focused article reading experience - ✅ **Rounded or square corners** — Configurable corner radius
- [x] **TOC Navigation** - Desktop and mobile TOC support - ✅ **Responsive layout** — Looks great on any screen size
- [x] **Word Count** - Display article word count and reading time - ✅ **Two-column layout** — Optimized for reading
- [x] **Related Articles** - Smart recommendation of related content - ✅ **Dark mode** — Easy on the eyes at night
- [x] **Outdated Reminder** - Automatic article update status alerts
- [x] **Traditional/Simplified Chinese** - Support for Traditional and Simplified Chinese switching ### 📝 Content
- [x] **Tag Plugins** - Rich tag plugin support - ✅ **Multi-level menu** — Nested navigation menus
- ✅ **Reading mode** — Distraction-free reading
- ✅ **Table of contents** — Available on desktop and mobile
- ✅ **Word count** — Shows the word count and estimated reading time
- ✅ **Related posts** — Smart recommendations at the end of a post
- ✅ **Outdated post warning** — Alerts readers when a post may be out of date
- ✅ **Traditional/Simplified Chinese** — Convert between Traditional and Simplified Chinese
- ✅ **Tag plugins** — Extra tags for richer content
### 🔍 Search & Navigation ### 🔍 Search & Navigation
- [x] **Multiple Search Options** - Algolia Search / Local Search / Docsearch - ✅ **Multiple search options** — Algolia, local search, or DocSearch
- [x] **Built-in 404** - Beautiful 404 error page - ✅ **Built-in 404 page** — A polished error page
- [x] **Pjax Support** - Smooth page transition experience - ✅ **PJAX** — Smooth page transitions
### 🎨 Code Display ### 🎨 Code Display
- [x] **Syntax Highlighting** - Built-in multiple themes (darker/pale night/light/ocean) - ✅ **Syntax highlighting** — Several built-in themes (darker, pale night, light, ocean)
- [x] **Code Features** - Language display/fold expand/copy button/auto-wrap - ✅ **Code block tools** — Language labels, folding, copy button, word wrap
- [x] **Math Formulas** - Support for Mathjax and Katex - ✅ **Math formulas** — MathJax and KaTeX support
### 💬 Social Interaction ### 💬 Social Interaction
- [x] **Multiple Comment Systems** - Disqus/Gitalk/Valine/Waline/Twikoo/Giscus/Artalk etc. - ✅ **Multiple comment systems** — Disqus, Gitalk, Valine, Waline, Twikoo, Giscus, Artalk, and more
- [x] **Dual Comments Support** - Enable two comment systems simultaneously - ✅ **Two comment systems at once** — Use two systems side by side
- [x] **Share Features** - Sharejs/Addtoany sharing components - ✅ **Sharing** — Share.js and AddToAny
- [x] **Live Chat** - Chatra/Tidio/Crisp instant messaging - ✅ **Live chat** — Chatra, Tidio, or Crisp
### 📊 Analytics & Statistics ### 📊 Analytics & Statistics
- [x] **Visit Statistics** - Busuanzi counter - ✅ **Visit counter** — Busuanzi
- [x] **Site Analytics** - Google Analytics/Baidu Analytics/Cloudflare Analytics/Microsoft Clarity/Umami - ✅ **Site analytics** — Google Analytics, Baidu Analytics, Cloudflare Analytics, Microsoft Clarity, or Umami
- [x] **Webmaster Verification** - Major search engine verification - ✅ **Search engine verification** — Google and Baidu
- [x] **Ad Support** - Google AdSense/custom ad slots - ✅ **Ads** — Google AdSense and custom ad slots
### 🎪 Visual Effects ### 🎪 Visual Effects
- [x] **Typing Effects** - activate_power_mode animations - ✅ **Typing effects** — activate_power_mode animations
- [x] **Background Effects** - Static ribbons/dynamic ribbons/floating ribbons/Canvas Nest - ✅ **Background effects** — Static, dynamic, or fluttering ribbons, plus Canvas Nest
- [x] **Mouse Effects** - Fireworks/hearts/text click effects - ✅ **Mouse effects** — Fireworks, hearts, and text on click
- [x] **Loading Animations** - Preloader and pace.js progress bars - ✅ **Loading animations** — Preloader or a pace.js progress bar
- [x] **Image Effects** - Medium Zoom/Fancybox image lightbox - ✅ **Image lightbox** — medium-zoom or Fancybox
- [x] **Lazy Loading** - Image lazy loading optimization - ✅ **Lazy loading** — Images load as they enter the viewport
### 🛠️ Advanced Features ### 🛠️ Advanced Features
- [x] **PWA Support** - Progressive Web App - ✅ **PWA** — Progressive Web App support
- [x] **Copy Protection** - Disable text copying/copyright info append - ✅ **Copy protection** — Disable copying or append a copyright notice
- [x] **Theme Customization** - Custom site color schemes - ✅ **Theme customization** — Custom color schemes
- [x] **Chart Support** - Mermaid flowcharts/Chart.js data charts - ✅ **Charts** — Mermaid flowcharts and Chart.js charts
- [x] **Music Notation** - ABCJS music notation support - ✅ **Music notation** — ABCJS support
- [x] **Article Series** - Series article organization - ✅ **Post series** — Group posts into series
- [x] **Instantpage** - Page preloading acceleration - ✅ **instant.page** — Preload pages for faster navigation
- [x] **Snackbar** - Elegant notification messages - ✅ **Snackbar** — Elegant toast notifications
## 🤝 Contributors ## 🤝 Contributors
Thanks to all the developers who have contributed to the Butterfly theme! Thanks to everyone who has contributed to Butterfly!
[![Contributors](https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly)](https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors) [![Contributors](https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly)](https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors)
<a id="screenshots"></a>
## 📸 Screenshots ## 📸 Screenshots
<div align="center"> <div align="center">
<table>
![Theme Demo](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg) <tr>
<td><a href="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg" alt="Light homepage on desktop, tablet and phone" width="440" loading="lazy" /></a></td>
![Theme Demo](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg) <td><a href="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg" alt="Light article page with a full-screen cover" width="440" loading="lazy" /></a></td>
</tr>
![Theme Demo](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg) <tr>
<td><a href="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg" alt="Dark mode homepage on desktop, tablet and phone" width="440" loading="lazy" /></a></td>
![Theme Demo](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg) <td><a href="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg" alt="Dark mode article page with a full-screen cover" width="440" loading="lazy" /></a></td>
</tr>
</table>
</div> </div>
## ⭐ Star History ## ⭐ Star History
[![Star History Chart](https://api.star-history.com/svg?repos=jerryc127/hexo-theme-butterfly&type=Date)](https://star-history.com/#jerryc127/hexo-theme-butterfly&Date) [![Star History Chart](https://api.star-history.com/svg?repos=jerryc127/hexo-theme-butterfly&type=Date)](https://star-history.com/#jerryc127/hexo-theme-butterfly&Date)
<a id="get-help"></a>
## 🤝 Building a Better Theme Together ## 🤝 Building a Better Theme Together
We believe **the power of open source comes from everyone's participation**! Whether you're a developer, designer, or user, you can contribute to the development of the Butterfly theme. We believe open source thrives on participation. Whether you're a developer, a designer, or a user, you can help make Butterfly better.
### 💬 Get Help & Support ### 💬 Get Help & Support
- 🐛 **Found a bug?** → [GitHub Issues](https://github.com/jerryc127/hexo-theme-butterfly/issues) - Let's solve it together! - 🐛 **Found a bug?** → [Open an issue](https://github.com/jerryc127/hexo-theme-butterfly/issues) and let's fix it together.
- 💡 **Have ideas?** → [GitHub Discussions](https://github.com/jerryc127/hexo-theme-butterfly/discussions) - Share your creative ideas! - 💡 **Have an idea?** → [Start a discussion](https://github.com/jerryc127/hexo-theme-butterfly/discussions) to share it.
- 📚 **Learning to use?** → [Official Documentation](https://butterfly.js.org/) - Detailed usage guide - 📚 **New to Butterfly?** → Read the [documentation](https://butterfly.js.org/).
- 💬 **Real-time discussion?** → [Telegram Group](https://t.me/bu2fly) - Chat with community members - ❓ **Stuck?** → Check the [FAQ](https://butterfly.js.org/en/posts/butterfly-docs-en-theme-question/) for common problems and fixes.
- 📦 **What's new?** → See [Releases](https://github.com/jerryc127/hexo-theme-butterfly/releases) for version notes and `_config` changes.
- 💬 **Want to chat?** → Join the [Telegram group](https://t.me/bu2fly).
### 🎯 Contributing ### 🎯 Contributing
Want to make Butterfly better? We welcome any form of contribution: Want to help? Contributions of every kind are welcome:
- **🔧 Code Contributions** - Fix bugs, add new features, optimize performance - **Code** — Fix bugs, add features, improve performance
- **📝 Documentation** - Improve docs, translate content, write tutorials - **Documentation** — Improve docs, translate pages, write tutorials
- **🎨 Design Suggestions** - UI/UX improvements, theme colors, icon design - **Design** — UI/UX improvements, color schemes, icons
- **🧪 Testing & Feedback** - Test new features, report issues, provide user experience - **Testing** — Try new features, report issues, share feedback
- **💰 Financial Support** - [Sponsor the Project](https://buy.stripe.com/3cs6rP6YA91sbbG5kk) - Support long-term development - **Funding** — [Sponsor the project](https://buy.stripe.com/3cs6rP6YA91sbbG5kk) to support ongoing development
<a id="license"></a>
## 📄 License ## 📄 License
This project is licensed under the [Apache 2.0](LICENSE) License. This project is licensed under the [Apache 2.0 License](LICENSE).
## 🙏 Acknowledgments ## 🙏 Acknowledgments
This theme is developed based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody). Thanks to the original author for their excellent work that provided inspiration and foundation! This theme is based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody). Thanks to its author for the inspiration and solid foundation.
Thanks to all friends who have contributed to the development of the Butterfly theme. Your support has made this theme continuously improve and progress. Thanks to everyone who has contributed to Butterfly — your support keeps the theme moving forward.
--- ---
<div align="center"> <div align="center">
**✨ If this theme helps you, please give us a ⭐ Star! ✨** **✨ If you find this theme useful, please give it a ⭐ star! ✨**
</div> </div>
+260 -192
View File
@@ -1,192 +1,260 @@
<div align="right"> <div align="right">
<a title="English" href="/README.md">English</a> <a title="English" href="./README.md">English</a>
</div> </div>
<div align="center"> <div align="center">
<img src="./source/img/butterfly-icon.png" width="150" height="150" alt="Butterfly Logo" /> <img src="./source/img/butterfly-icon.png" width="150" height="150" alt="Butterfly Logo" />
# hexo-theme-butterfly # hexo-theme-butterfly
一個適用於 Hexo 的現代化、美觀且功能豐富的主題 一個現代、美觀且功能豐富的 Hexo 主題
![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/master?color=%231ab1ad&label=master) ![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/master?color=%231ab1ad&label=master)
![dev version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev) ![dev version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev)
![npm version](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff) ![npm version](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%23bf00ff)
![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83cd) ![hexo version](https://img.shields.io/badge/hexo-5.3.0+-0e83cd)
![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531) ![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531)
![GitHub stars](https://img.shields.io/github/stars/jerryc127/hexo-theme-butterfly?style=social) ![GitHub stars](https://img.shields.io/github/stars/jerryc127/hexo-theme-butterfly?style=social)
📢 **在線預覽**: [Butterfly 官方](https://butterfly.js.org/) | [CrazyWong 博客](https://blog.crazywong.com/) 📢 **線上預覽**:[Butterfly 官方](https://butterfly.js.org/) | [CrazyWong 部落格](https://blog.crazywong.com/)
📖 **完整文檔**: [中文文檔](https://butterfly.js.org/posts/21cfbf15/) | [English Docs](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/) 📖 **完整文檔**:[中文文檔](https://butterfly.js.org/posts/21cfbf15/) | [English](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/)
![Butterfly 主題預覽](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/theme-butterfly-readme.png) ![Butterfly 主題預覽](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/theme-butterfly-readme.png)
</div> </div>
--- ---
## 🚀 快速開始 ## 📑 目錄
### 💾 安裝方式 - [環境要求](#requirements)
- [快速開始](#quick-start)
#### 方式一:Git 安裝(推薦) - [升級](#upgrade)
- [主題特色](#theme-features)
> 💡 **提示**: 如果您在中國大陸訪問 GitHub 速度較慢,可以使用 [Gitee 鏡像](https://gitee.com/immyw/hexo-theme-butterfly.git) - [主題截圖](#screenshots)
- [取得協助](#get-help)
在您的 Hexo 博客根目錄下執行: - [授權條款](#license)
```bash <a id="requirements"></a>
# 安裝穩定版本(推薦)
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly ## 📋 環境要求
```
- **Hexo**:5.3.0 或以上
```bash - **Node.js**:18 或以上(`hexo-util` 4.x 的要求)
# 安裝開發版本(搶先體驗新功能) - **Git**:僅 Git 安裝需要
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
``` <a id="quick-start"></a>
#### 方式二:NPM 安裝 ## 🚀 快速開始
> ⚠️ **注意**: NPM 安裝方式僅支援 Hexo 5.0.0 及以上版本 ### 💾 安裝方式
```bash #### 方式一:Git 安裝(推薦)
npm install hexo-theme-butterfly
``` > 💡 **提示**:如果您在中國大陸連線 GitHub 較慢,可以使用 [Gitee 鏡像](https://gitee.com/immyw/hexo-theme-butterfly.git)。
### ⚙️ 主題配置 在 Hexo 部落格根目錄執行以下指令:
1. **啟用主題**: 修改您的 Hexo 配置檔案 `_config.yml`: ```bash
# 安裝穩定版本(推薦)
```yaml git clone -b master --depth 1 https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
theme: butterfly ```
```
```bash
2. **安裝依賴**: 如果您尚未安裝 pug 和 stylus 渲染器,請執行: # 安裝開發版本(搶先體驗新功能)
git clone -b dev --depth 1 https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
```bash ```
npm install hexo-renderer-pug hexo-renderer-stylus --save
``` > 📁 如果 `themes/butterfly` 已存在,請先刪除或重新命名,否則目標資料夾不是空的,`git clone` 會失敗。
## ✨ 主題特色 #### 方式二:npm 安裝
### 🎨 設計風格 ```bash
- [x] **卡片化設計** - 現代化的卡片式佈局 npm install hexo-theme-butterfly
- [x] **圓角/直角設計** - 支援自訂邊框樣式 ```
- [x] **響應式設計** - 完美適配各種螢幕尺寸
- [x] **雙欄佈局** - 優化的閱讀體驗 > ⚠️ **注意**:npm 安裝不會在 `themes/` 底下建立資料夾,主題會放在 `node_modules/` 中。
- [x] **深色模式** - 護眼的夜間模式
### ⚙️ 啟用與設定
### 📝 內容功能
- [x] **多級選單** - 支援二級導航選單 1. **啟用主題**:修改 Hexo 根目錄的 `_config.yml`:
- [x] **閱讀模式** - 專注的文章閱讀體驗
- [x] **目錄導航** - 電腦和手機雙端支援 TOC ```yaml
- [x] **字數統計** - 顯示文章字數和閱讀時間 theme: butterfly
- [x] **相關文章** - 智能推薦相關內容 ```
- [x] **過期提醒** - 自動提示文章更新狀態
- [x] **簡繁轉換** - 支援繁體中文和簡體中文切換 2. **複製主題設定**(建議,這樣升級時才不會覆蓋您的設定):
- [x] **標籤外掛** - 豐富的標籤外掛支持
```bash
### 🔍 搜尋與導航 # Git 安裝
- [x] **多種搜尋** - Algolia 搜尋 / 本地搜尋 / Docsearch cp themes/butterfly/_config.yml _config.butterfly.yml
- [x] **內建 404** - 美觀的 404 錯誤頁面
- [x] **Pjax 支援** - 流暢的頁面切換體驗 # npm 安裝
cp node_modules/hexo-theme-butterfly/_config.yml _config.butterfly.yml
### 🎨 程式碼展示 ```
- [x] **語法高亮** - 內建多種主題(darker/pale night/light/ocean)
- [x] **程式碼功能** - 語言顯示/摺疊展開/複製按鈕/自動換行 > 💡 Hexo 5+ 會自動讀取根目錄的 `_config.butterfly.yml`。Windows 請使用 `copy themes\butterfly\_config.yml _config.butterfly.yml`(Git 安裝)或 `copy node_modules\hexo-theme-butterfly\_config.yml _config.butterfly.yml`(npm 安裝)。
- [x] **數學公式** - 支援 Mathjax 和 Katex >
> ⚠️ 之後只需修改 `_config.butterfly.yml`。請勿刪除主題內的 `_config.yml`,也不要將自訂檔案或圖片放進主題的 `source/` 資料夾,升級時可能會被覆蓋。
### 💬 社交互動
- [x] **多元評論系統** - Disqus/Gitalk/Valine/Waline/Twikoo/Giscus/Artalk 等 3. **安裝渲染器並在本機預覽**:
- [x] **雙評論支援** - 可同時啟用兩套評論系統
- [x] **分享功能** - Sharejs/Addtoany 分享套件 ```bash
- [x] **線上客服** - Chatra/Tidio/Crisp 即時聊天 npm install hexo-renderer-pug hexo-renderer-stylus --save
hexo clean && hexo s
### 📊 數據分析 ```
- [x] **訪問統計** - 不蒜子計數器
- [x] **網站分析** - Google Analytics/百度統計/Cloudflare Analytics/Microsoft Clarity/Umami <a id="upgrade"></a>
- [x] **站長驗證** - 各大搜尋引擎驗證
- [x] **廣告支援** - Google AdSense/自訂廣告位 ## 🔄 升級
### 🎪 視覺效果 **Git 安裝**
- [x] **打字特效** - activate_power_mode 動畫
- [x] **背景特效** - 靜態彩帶/動態彩帶/飄帶效果/Canvas Nest ```bash
- [x] **滑鼠特效** - 煙花/愛心/文字點擊效果 cd themes/butterfly
- [x] **載入動畫** - Preloader 和 pace.js 進度條 git pull
- [x] **圖片效果** - Medium Zoom/Fancybox 圖片燈箱 ```
- [x] **懶載入** - 圖片延遲載入優化
**npm 安裝**
### 🛠️ 進階功能
- [x] **PWA 支援** - 漸進式網頁應用 ```bash
- [x] **複製保護** - 可關閉文字複製/版權資訊追加 npm update hexo-theme-butterfly
- [x] **主題定製** - 自訂網站配色方案 ```
- [x] **圖表支援** - Mermaid 流程圖/Chart.js 數據圖表
- [x] **音樂符號** - ABCJS 音樂記譜法支援 升級前請先備份設定。升級後請到 [Releases](https://github.com/jerryc127/hexo-theme-butterfly/releases) 查看 `_config` 的變更,並同步到 `_config.butterfly.yml`。
- [x] **系列文章** - 系列文章組織功能
- [x] **Instantpage** - 頁面預載入加速 <a id="theme-features"></a>
- [x] **Snackbar** - 優雅的提示訊息
## ✨ 主題特色
## 🤝 貢獻者
> 💡 所有功能都能在 `_config.butterfly.yml` 中開啟、關閉與調整,詳見[主題設定文檔](https://butterfly.js.org/posts/4aa8abbe/)。
感謝所有為 Butterfly 主題做出貢獻的開發者們!
### 🎨 設計
[![Contributors](https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly)](https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors) - ✅ **卡片化設計**:現代卡片式佈局
- ✅ **圓角或直角**:可自訂圓角大小
## 📸 主題截圖 - ✅ **響應式設計**:自動適應各種螢幕尺寸
- ✅ **雙欄佈局**:優化閱讀體驗
<div align="center"> - ✅ **深色模式**:夜間閱讀更護眼
![主題展示](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg) ### 📝 內容
- ✅ **多層選單**:支援多層導覽
![主題展示](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg) - ✅ **閱讀模式**:專注閱讀
- ✅ **目錄**:電腦與手機皆支援
![主題展示](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg) - ✅ **字數統計**:顯示字數與預估閱讀時間
- ✅ **相關文章**:在文章底部推薦相關內容
![主題展示](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg) - ✅ **過期提醒**:文章可能過期時提醒讀者
- ✅ **簡繁轉換**:在繁體與簡體中文之間切換
</div> - ✅ **標籤外掛**:提供多種實用外掛
### 🔍 搜尋與導覽
## ⭐ Star 趨勢 - ✅ **多種搜尋方式**:Algolia、本機搜尋或 DocSearch
- ✅ **內建 404 頁面**:美觀的錯誤頁面
[![Star History Chart](https://api.star-history.com/svg?repos=jerryc127/hexo-theme-butterfly&type=Date)](https://star-history.com/#jerryc127/hexo-theme-butterfly&Date) - ✅ **PJAX**:流暢的頁面切換
## 🤝 一起構建更美好的主題 ### 🎨 程式碼展示
- ✅ **語法高亮**:內建多種主題(darker、pale night、light、ocean)
我們相信,**開源的力量來自於每一個人的參與**!無論您是開發者、設計師還是用戶,都可以為 Butterfly 主題的發展貢獻力量。 - ✅ **程式碼區塊工具**:語言標示、摺疊、複製按鈕、自動換行
- ✅ **數學公式**:支援 MathJax 與 KaTeX
### 💬 獲取幫助與支援
### 💬 社群互動
- 🐛 **發現問題?** → [GitHub Issues](https://github.com/jerryc127/hexo-theme-butterfly/issues) - 讓我們一起解決! - ✅ **多種留言系統**:Disqus、Gitalk、Valine、Waline、Twikoo、Giscus、Artalk 等
- 💡 **有好想法?** → [GitHub Discussions](https://github.com/jerryc127/hexo-theme-butterfly/discussions) - 分享您的創意想法! - ✅ **雙留言系統**:可同時啟用兩套
- 📚 **學習使用?** → [官方文檔](https://butterfly.js.org/) - 詳細的使用指南 - ✅ **分享**:Share.js 與 AddToAny
- 💬 **即時討論?** → [Telegram 群組](https://t.me/bu2fly) - 與社群成員實時交流 - ✅ **即時客服**:Chatra、Tidio 或 Crisp
### 🎯 參與貢獻 ### 📊 分析與統計
- ✅ **瀏覽統計**:不蒜子計數器
想要讓 Butterfly 變得更好嗎?我們歡迎您的任何形式的貢獻: - ✅ **網站分析**:Google Analytics、百度統計、Cloudflare Analytics、Microsoft Clarity 或 Umami
- ✅ **搜尋引擎驗證**:Google 與百度
- **🔧 代碼貢獻** - 修復 Bug、添加新功能、優化性能 - ✅ **廣告**:Google AdSense 與自訂廣告版位
- **📝 文檔完善** - 改進文檔、翻譯內容、撰寫教程
- **🎨 設計建議** - UI/UX 改進、主題配色、圖示設計 ### 🎪 視覺效果
- **🧪 測試反饋** - 測試新功能、回報問題、提供使用體驗 - ✅ **打字特效**:activate_power_mode 動畫
- **💰 資金支援** - [贊助項目](https://buy.stripe.com/3cs6rP6YA91sbbG5kk) - 支持長期發展 - ✅ **背景特效**:靜態、動態或飄動彩帶,以及 Canvas Nest
- ✅ **滑鼠特效**:點擊時顯示煙花、愛心或文字
## 📄 授權條款 - ✅ **載入動畫**:Preloader 或 pace.js 進度條
- ✅ **圖片燈箱**:medium-zoom 或 Fancybox
本專案採用 [Apache 2.0](LICENSE) 授權條款。 - ✅ **延遲載入**:圖片進入視窗時才載入
## 🙏 致敬與感謝 ### 🛠️ 進階功能
- ✅ **PWA**:漸進式網頁應用
本主題基於 [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) 進行開發,感謝原作者的精彩創作為我們提供了靈感與基礎! - ✅ **複製保護**:停用複製或附加版權聲明
- ✅ **主題自訂**:可更換網站配色
感謝所有為 Butterfly 主題發展做出貢獻的朋友們,是你們的支持讓這個主題能夠不斷完善與進步。 - ✅ **圖表**:Mermaid 流程圖與 Chart.js 圖表
- ✅ **樂譜**:支援 ABCJS 記譜
--- - ✅ **文章系列**:將文章整理成系列
- ✅ **instant.page**:預載頁面,加快導覽
<div align="center"> - ✅ **Snackbar**:優雅的提示通知
**✨ 如果這個主題對您有幫助,請給我們一個 ⭐ Star!✨** ## 🤝 貢獻者
</div>
感謝每一位為 Butterfly 付出過的貢獻者!
[![Contributors](https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly)](https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors)
<a id="screenshots"></a>
## 📸 主題截圖
<div align="center">
<table>
<tr>
<td><a href="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg" alt="淺色首頁在桌面、平板與手機上的響應式效果" width="440" loading="lazy" /></a></td>
<td><a href="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg" alt="淺色文章頁與全螢幕封面" width="440" loading="lazy" /></a></td>
</tr>
<tr>
<td><a href="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg" alt="深色模式首頁在桌面、平板與手機上的響應式效果" width="440" loading="lazy" /></a></td>
<td><a href="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg" alt="深色模式文章頁與全螢幕封面" width="440" loading="lazy" /></a></td>
</tr>
</table>
</div>
## ⭐ Star 趨勢
[![Star History Chart](https://api.star-history.com/svg?repos=jerryc127/hexo-theme-butterfly&type=Date)](https://star-history.com/#jerryc127/hexo-theme-butterfly&Date)
<a id="get-help"></a>
## 🤝 一起打造更美好的主題
我們相信,**開源之所以能成長,是因為每個人願意參與**。不論您是開發者、設計師還是使用者,都能讓 Butterfly 變得更好。
### 💬 取得協助
- 🐛 **發現問題?** 開一個 [Issue](https://github.com/jerryc127/hexo-theme-butterfly/issues),我們一起解決。
- 💡 **有好想法?** 到 [Discussions](https://github.com/jerryc127/hexo-theme-butterfly/discussions) 分享。
- 📚 **剛開始使用?** 閱讀[官方文檔](https://butterfly.js.org/)。
- ❓ **卡住了?** 查看[主題問答](https://butterfly.js.org/posts/98d20436/),那裡整理了常見問題與排錯方法。
- 📦 **想了解更新?** 查看 [Releases](https://github.com/jerryc127/hexo-theme-butterfly/releases),裡面有版本說明與 `_config` 變更。
- 💬 **想聊聊?** 加入 [Telegram 群組](https://t.me/bu2fly)。
### 🎯 參與貢獻
想讓 Butterfly 更好嗎?我們歡迎各種形式的貢獻:
- **🔧 程式碼**:修復 Bug、新增功能、改善效能
- **📝 文檔**:改進文檔、翻譯內容、撰寫教學
- **🎨 設計**:UI/UX 改進、配色、圖示設計
- **🧪 測試**:試用新功能、回報問題、分享使用心得
- **💰 資金**:[贊助專案](https://buy.stripe.com/3cs6rP6YA91sbbG5kk),支持專案長期發展
<a id="license"></a>
## 📄 授權條款
本專案採用 [Apache 2.0 授權條款](LICENSE)。
## 🙏 致敬與感謝
本主題以 [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) 為基礎開發,感謝原作者提供靈感與基礎。
感謝每一位為 Butterfly 付出的人,因為有你們,這個主題才能持續進步。
---
<div align="center">
**✨ 如果這個主題對您有幫助,請給我們一顆 ⭐!**
</div>
Loaded 3 of 37 files, more files were not shown because too many files have changed in this diff. Show more