mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-12-02 20:55:08 +08:00
Compare commits
No files matched your search
@@ -1,19 +1,21 @@
|
||||
name: npm publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
jobs:
|
||||
build:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write # OIDC 必須
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
# Setup .npmrc file to publish to npm
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- run: npm install
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24' # trusted publishing 需要 >= 22.14
|
||||
- run: npm install -g npm@latest
|
||||
- run: npm install
|
||||
- name: Publish
|
||||
run: |
|
||||
echo "repo=$GITHUB_REPOSITORY"
|
||||
npm publish --access public
|
||||
@@ -1,5 +1,5 @@
|
||||
<div align="right">
|
||||
<a title="中文" href="/README_CN.md">中文</a>
|
||||
<a title="繁體中文" href="./README_CN.md">繁體中文</a>
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
@@ -8,18 +8,18 @@
|
||||
|
||||
# hexo-theme-butterfly
|
||||
|
||||
A modern, elegant and feature-rich theme for Hexo
|
||||
A modern, elegant, and feature-rich theme for Hexo
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
📢 **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/)
|
||||
|
||||

|
||||
|
||||
@@ -27,167 +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
|
||||
|
||||
### 💾 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
|
||||
# Install stable version (recommended)
|
||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||
# Stable release (recommended)
|
||||
git clone -b master --depth 1 https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||
```
|
||||
|
||||
```bash
|
||||
# Install development version (early access to new features)
|
||||
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||
# Development branch (early access to new features)
|
||||
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
|
||||
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
|
||||
theme: butterfly
|
||||
```
|
||||
1. **Enable the theme**: set it in the `_config.yml` at your Hexo root:
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
### 🎨 Design Style
|
||||
- [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
|
||||
> 💡 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.
|
||||
|
||||
### 📝 Content Features
|
||||
- [x] **Multi-level Menu** - Support for secondary navigation menus
|
||||
- [x] **Reading Mode** - Focused article reading experience
|
||||
- [x] **TOC Navigation** - Desktop and mobile TOC support
|
||||
- [x] **Word Count** - Display article word count and reading time
|
||||
- [x] **Related Articles** - Smart recommendation of related content
|
||||
- [x] **Outdated Reminder** - Automatic article update status alerts
|
||||
- [x] **Traditional/Simplified Chinese** - Support for Traditional and Simplified Chinese switching
|
||||
- [x] **Tag Plugins** - Rich tag plugin support
|
||||
### 🎨 Design
|
||||
- ✅ **Card-based design** — Modern card layout
|
||||
- ✅ **Rounded or square corners** — Configurable corner radius
|
||||
- ✅ **Responsive layout** — Looks great on any screen size
|
||||
- ✅ **Two-column layout** — Optimized for reading
|
||||
- ✅ **Dark mode** — Easy on the eyes at night
|
||||
|
||||
### 📝 Content
|
||||
- ✅ **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
|
||||
- [x] **Multiple Search Options** - Algolia Search / Local Search / Docsearch
|
||||
- [x] **Built-in 404** - Beautiful 404 error page
|
||||
- [x] **Pjax Support** - Smooth page transition experience
|
||||
- ✅ **Multiple search options** — Algolia, local search, or DocSearch
|
||||
- ✅ **Built-in 404 page** — A polished error page
|
||||
- ✅ **PJAX** — Smooth page transitions
|
||||
|
||||
### 🎨 Code Display
|
||||
- [x] **Syntax Highlighting** - Built-in multiple themes (darker/pale night/light/ocean)
|
||||
- [x] **Code Features** - Language display/fold expand/copy button/auto-wrap
|
||||
- [x] **Math Formulas** - Support for Mathjax and Katex
|
||||
- ✅ **Syntax highlighting** — Several built-in themes (darker, pale night, light, ocean)
|
||||
- ✅ **Code block tools** — Language labels, folding, copy button, word wrap
|
||||
- ✅ **Math formulas** — MathJax and KaTeX support
|
||||
|
||||
### 💬 Social Interaction
|
||||
- [x] **Multiple Comment Systems** - Disqus/Gitalk/Valine/Waline/Twikoo/Giscus/Artalk etc.
|
||||
- [x] **Dual Comments Support** - Enable two comment systems simultaneously
|
||||
- [x] **Share Features** - Sharejs/Addtoany sharing components
|
||||
- [x] **Live Chat** - Chatra/Tidio/Crisp instant messaging
|
||||
- ✅ **Multiple comment systems** — Disqus, Gitalk, Valine, Waline, Twikoo, Giscus, Artalk, and more
|
||||
- ✅ **Two comment systems at once** — Use two systems side by side
|
||||
- ✅ **Sharing** — Share.js and AddToAny
|
||||
- ✅ **Live chat** — Chatra, Tidio, or Crisp
|
||||
|
||||
### 📊 Analytics & Statistics
|
||||
- [x] **Visit Statistics** - Busuanzi counter
|
||||
- [x] **Site Analytics** - Google Analytics/Baidu Analytics/Cloudflare Analytics/Microsoft Clarity/Umami
|
||||
- [x] **Webmaster Verification** - Major search engine verification
|
||||
- [x] **Ad Support** - Google AdSense/custom ad slots
|
||||
- ✅ **Visit counter** — Busuanzi
|
||||
- ✅ **Site analytics** — Google Analytics, Baidu Analytics, Cloudflare Analytics, Microsoft Clarity, or Umami
|
||||
- ✅ **Search engine verification** — Google and Baidu
|
||||
- ✅ **Ads** — Google AdSense and custom ad slots
|
||||
|
||||
### 🎪 Visual Effects
|
||||
- [x] **Typing Effects** - activate_power_mode animations
|
||||
- [x] **Background Effects** - Static ribbons/dynamic ribbons/floating ribbons/Canvas Nest
|
||||
- [x] **Mouse Effects** - Fireworks/hearts/text click effects
|
||||
- [x] **Loading Animations** - Preloader and pace.js progress bars
|
||||
- [x] **Image Effects** - Medium Zoom/Fancybox image lightbox
|
||||
- [x] **Lazy Loading** - Image lazy loading optimization
|
||||
- ✅ **Typing effects** — activate_power_mode animations
|
||||
- ✅ **Background effects** — Static, dynamic, or fluttering ribbons, plus Canvas Nest
|
||||
- ✅ **Mouse effects** — Fireworks, hearts, and text on click
|
||||
- ✅ **Loading animations** — Preloader or a pace.js progress bar
|
||||
- ✅ **Image lightbox** — medium-zoom or Fancybox
|
||||
- ✅ **Lazy loading** — Images load as they enter the viewport
|
||||
|
||||
### 🛠️ Advanced Features
|
||||
- [x] **PWA Support** - Progressive Web App
|
||||
- [x] **Copy Protection** - Disable text copying/copyright info append
|
||||
- [x] **Theme Customization** - Custom site color schemes
|
||||
- [x] **Chart Support** - Mermaid flowcharts/Chart.js data charts
|
||||
- [x] **Music Notation** - ABCJS music notation support
|
||||
- [x] **Music Player** - APlayer/Meting music playback
|
||||
- [x] **Article Series** - Series article organization
|
||||
- [x] **Instantpage** - Page preloading acceleration
|
||||
- [x] **Snackbar** - Elegant notification messages
|
||||
- ✅ **PWA** — Progressive Web App support
|
||||
- ✅ **Copy protection** — Disable copying or append a copyright notice
|
||||
- ✅ **Theme customization** — Custom color schemes
|
||||
- ✅ **Charts** — Mermaid flowcharts and Chart.js charts
|
||||
- ✅ **Music notation** — ABCJS support
|
||||
- ✅ **Post series** — Group posts into series
|
||||
- ✅ **instant.page** — Preload pages for faster navigation
|
||||
- ✅ **Snackbar** — Elegant toast notifications
|
||||
|
||||
## 🤝 Contributors
|
||||
|
||||
Thanks to all the developers who have contributed to the Butterfly theme!
|
||||
Thanks to everyone who has contributed to Butterfly!
|
||||
|
||||
[](https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors)
|
||||
|
||||
<a id="screenshots"></a>
|
||||
|
||||
## 📸 Screenshots
|
||||
|
||||
<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="Light homepage on desktop, tablet and phone" 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="Light article page with a full-screen cover" 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="Dark mode homepage on desktop, tablet and phone" 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="Dark mode article page with a full-screen cover" width="440" loading="lazy" /></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
## ⭐ Star History
|
||||
|
||||
[](https://star-history.com/#jerryc127/hexo-theme-butterfly&Date)
|
||||
|
||||
<a id="get-help"></a>
|
||||
|
||||
## 🤝 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
|
||||
|
||||
- 🐛 **Found a bug?** → [GitHub Issues](https://github.com/jerryc127/hexo-theme-butterfly/issues) - Let's solve it together!
|
||||
- 💡 **Have ideas?** → [GitHub Discussions](https://github.com/jerryc127/hexo-theme-butterfly/discussions) - Share your creative ideas!
|
||||
- 📚 **Learning to use?** → [Official Documentation](https://butterfly.js.org/) - Detailed usage guide
|
||||
- 💬 **Real-time discussion?** → [Telegram Group](https://t.me/bu2fly) - Chat with community members
|
||||
- 🐛 **Found a bug?** → [Open an issue](https://github.com/jerryc127/hexo-theme-butterfly/issues) and let's fix it together.
|
||||
- 💡 **Have an idea?** → [Start a discussion](https://github.com/jerryc127/hexo-theme-butterfly/discussions) to share it.
|
||||
- 📚 **New to Butterfly?** → Read the [documentation](https://butterfly.js.org/).
|
||||
- ❓ **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
|
||||
|
||||
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
|
||||
- **📝 Documentation** - Improve docs, translate content, write tutorials
|
||||
- **🎨 Design Suggestions** - UI/UX improvements, theme colors, icon design
|
||||
- **🧪 Testing & Feedback** - Test new features, report issues, provide user experience
|
||||
- **💰 Financial Support** - [Sponsor the Project](https://buy.stripe.com/3cs6rP6YA91sbbG5kk) - Support long-term development
|
||||
- **Code** — Fix bugs, add features, improve performance
|
||||
- **Documentation** — Improve docs, translate pages, write tutorials
|
||||
- **Design** — UI/UX improvements, color schemes, icons
|
||||
- **Testing** — Try new features, report issues, share feedback
|
||||
- **Funding** — [Sponsor the project](https://buy.stripe.com/3cs6rP6YA91sbbG5kk) to support ongoing development
|
||||
|
||||
<a id="license"></a>
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is licensed under the [Apache 2.0](LICENSE) License.
|
||||
This project is licensed under the [Apache 2.0 License](LICENSE).
|
||||
|
||||
## 🙏 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">
|
||||
|
||||
**✨ If this theme helps you, please give us a ⭐ Star! ✨**
|
||||
**✨ If you find this theme useful, please give it a ⭐ star! ✨**
|
||||
</div>
|
||||
+260
-193
@@ -1,193 +1,260 @@
|
||||
<div align="right">
|
||||
<a title="English" href="/README.md">English</a>
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img src="./source/img/butterfly-icon.png" width="150" height="150" alt="Butterfly Logo" />
|
||||
|
||||
# hexo-theme-butterfly
|
||||
|
||||
一個適用於 Hexo 的現代化、美觀且功能豐富的主題
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
📢 **在線預覽**: [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/)
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## 🚀 快速開始
|
||||
|
||||
### 💾 安裝方式
|
||||
|
||||
#### 方式一:Git 安裝(推薦)
|
||||
|
||||
> 💡 **提示**: 如果您在中國大陸訪問 GitHub 速度較慢,可以使用 [Gitee 鏡像](https://gitee.com/immyw/hexo-theme-butterfly.git)
|
||||
|
||||
在您的 Hexo 博客根目錄下執行:
|
||||
|
||||
```bash
|
||||
# 安裝穩定版本(推薦)
|
||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||
```
|
||||
|
||||
```bash
|
||||
# 安裝開發版本(搶先體驗新功能)
|
||||
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||
```
|
||||
|
||||
#### 方式二:NPM 安裝
|
||||
|
||||
> ⚠️ **注意**: NPM 安裝方式僅支援 Hexo 5.0.0 及以上版本
|
||||
|
||||
```bash
|
||||
npm install hexo-theme-butterfly
|
||||
```
|
||||
|
||||
### ⚙️ 主題配置
|
||||
|
||||
1. **啟用主題**: 修改您的 Hexo 配置檔案 `_config.yml`:
|
||||
|
||||
```yaml
|
||||
theme: butterfly
|
||||
```
|
||||
|
||||
2. **安裝依賴**: 如果您尚未安裝 pug 和 stylus 渲染器,請執行:
|
||||
|
||||
```bash
|
||||
npm install hexo-renderer-pug hexo-renderer-stylus --save
|
||||
```
|
||||
|
||||
## ✨ 主題特色
|
||||
|
||||
### 🎨 設計風格
|
||||
- [x] **卡片化設計** - 現代化的卡片式佈局
|
||||
- [x] **圓角/直角設計** - 支援自訂邊框樣式
|
||||
- [x] **響應式設計** - 完美適配各種螢幕尺寸
|
||||
- [x] **雙欄佈局** - 優化的閱讀體驗
|
||||
- [x] **深色模式** - 護眼的夜間模式
|
||||
|
||||
### 📝 內容功能
|
||||
- [x] **多級選單** - 支援二級導航選單
|
||||
- [x] **閱讀模式** - 專注的文章閱讀體驗
|
||||
- [x] **目錄導航** - 電腦和手機雙端支援 TOC
|
||||
- [x] **字數統計** - 顯示文章字數和閱讀時間
|
||||
- [x] **相關文章** - 智能推薦相關內容
|
||||
- [x] **過期提醒** - 自動提示文章更新狀態
|
||||
- [x] **簡繁轉換** - 支援繁體中文和簡體中文切換
|
||||
- [x] **標籤外掛** - 豐富的標籤外掛支持
|
||||
|
||||
### 🔍 搜尋與導航
|
||||
- [x] **多種搜尋** - Algolia 搜尋 / 本地搜尋 / Docsearch
|
||||
- [x] **內建 404** - 美觀的 404 錯誤頁面
|
||||
- [x] **Pjax 支援** - 流暢的頁面切換體驗
|
||||
|
||||
### 🎨 程式碼展示
|
||||
- [x] **語法高亮** - 內建多種主題(darker/pale night/light/ocean)
|
||||
- [x] **程式碼功能** - 語言顯示/摺疊展開/複製按鈕/自動換行
|
||||
- [x] **數學公式** - 支援 Mathjax 和 Katex
|
||||
|
||||
### 💬 社交互動
|
||||
- [x] **多元評論系統** - Disqus/Gitalk/Valine/Waline/Twikoo/Giscus/Artalk 等
|
||||
- [x] **雙評論支援** - 可同時啟用兩套評論系統
|
||||
- [x] **分享功能** - Sharejs/Addtoany 分享套件
|
||||
- [x] **線上客服** - Chatra/Tidio/Crisp 即時聊天
|
||||
|
||||
### 📊 數據分析
|
||||
- [x] **訪問統計** - 不蒜子計數器
|
||||
- [x] **網站分析** - Google Analytics/百度統計/Cloudflare Analytics/Microsoft Clarity/Umami
|
||||
- [x] **站長驗證** - 各大搜尋引擎驗證
|
||||
- [x] **廣告支援** - Google AdSense/自訂廣告位
|
||||
|
||||
### 🎪 視覺效果
|
||||
- [x] **打字特效** - activate_power_mode 動畫
|
||||
- [x] **背景特效** - 靜態彩帶/動態彩帶/飄帶效果/Canvas Nest
|
||||
- [x] **滑鼠特效** - 煙花/愛心/文字點擊效果
|
||||
- [x] **載入動畫** - Preloader 和 pace.js 進度條
|
||||
- [x] **圖片效果** - Medium Zoom/Fancybox 圖片燈箱
|
||||
- [x] **懶載入** - 圖片延遲載入優化
|
||||
|
||||
### 🛠️ 進階功能
|
||||
- [x] **PWA 支援** - 漸進式網頁應用
|
||||
- [x] **複製保護** - 可關閉文字複製/版權資訊追加
|
||||
- [x] **主題定製** - 自訂網站配色方案
|
||||
- [x] **圖表支援** - Mermaid 流程圖/Chart.js 數據圖表
|
||||
- [x] **音樂符號** - ABCJS 音樂記譜法支援
|
||||
- [x] **音樂播放器** - APlayer/Meting 音樂播放功能
|
||||
- [x] **系列文章** - 系列文章組織功能
|
||||
- [x] **Instantpage** - 頁面預載入加速
|
||||
- [x] **Snackbar** - 優雅的提示訊息
|
||||
|
||||
## 🤝 貢獻者
|
||||
|
||||
感謝所有為 Butterfly 主題做出貢獻的開發者們!
|
||||
|
||||
[](https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors)
|
||||
|
||||
## 📸 主題截圖
|
||||
|
||||
<div align="center">
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
## ⭐ Star 趨勢
|
||||
|
||||
[](https://star-history.com/#jerryc127/hexo-theme-butterfly&Date)
|
||||
|
||||
## 🤝 一起構建更美好的主題
|
||||
|
||||
我們相信,**開源的力量來自於每一個人的參與**!無論您是開發者、設計師還是用戶,都可以為 Butterfly 主題的發展貢獻力量。
|
||||
|
||||
### 💬 獲取幫助與支援
|
||||
|
||||
- 🐛 **發現問題?** → [GitHub Issues](https://github.com/jerryc127/hexo-theme-butterfly/issues) - 讓我們一起解決!
|
||||
- 💡 **有好想法?** → [GitHub Discussions](https://github.com/jerryc127/hexo-theme-butterfly/discussions) - 分享您的創意想法!
|
||||
- 📚 **學習使用?** → [官方文檔](https://butterfly.js.org/) - 詳細的使用指南
|
||||
- 💬 **即時討論?** → [Telegram 群組](https://t.me/bu2fly) - 與社群成員實時交流
|
||||
|
||||
### 🎯 參與貢獻
|
||||
|
||||
想要讓 Butterfly 變得更好嗎?我們歡迎您的任何形式的貢獻:
|
||||
|
||||
- **🔧 代碼貢獻** - 修復 Bug、添加新功能、優化性能
|
||||
- **📝 文檔完善** - 改進文檔、翻譯內容、撰寫教程
|
||||
- **🎨 設計建議** - UI/UX 改進、主題配色、圖示設計
|
||||
- **🧪 測試反饋** - 測試新功能、回報問題、提供使用體驗
|
||||
- **💰 資金支援** - [贊助項目](https://buy.stripe.com/3cs6rP6YA91sbbG5kk) - 支持長期發展
|
||||
|
||||
## 📄 授權條款
|
||||
|
||||
本專案採用 [Apache 2.0](LICENSE) 授權條款。
|
||||
|
||||
## 🙏 致敬與感謝
|
||||
|
||||
本主題基於 [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) 進行開發,感謝原作者的精彩創作為我們提供了靈感與基礎!
|
||||
|
||||
感謝所有為 Butterfly 主題發展做出貢獻的朋友們,是你們的支持讓這個主題能夠不斷完善與進步。
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**✨ 如果這個主題對您有幫助,請給我們一個 ⭐ Star!✨**
|
||||
</div>
|
||||
<div align="right">
|
||||
<a title="English" href="./README.md">English</a>
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img src="./source/img/butterfly-icon.png" width="150" height="150" alt="Butterfly Logo" />
|
||||
|
||||
# hexo-theme-butterfly
|
||||
|
||||
一個現代、美觀且功能豐富的 Hexo 主題
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
📢 **線上預覽**:[Butterfly 官方](https://butterfly.js.org/) | [CrazyWong 部落格](https://blog.crazywong.com/)
|
||||
|
||||
📖 **完整文檔**:[中文文檔](https://butterfly.js.org/posts/21cfbf15/) | [English](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/)
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## 📑 目錄
|
||||
|
||||
- [環境要求](#requirements)
|
||||
- [快速開始](#quick-start)
|
||||
- [升級](#upgrade)
|
||||
- [主題特色](#theme-features)
|
||||
- [主題截圖](#screenshots)
|
||||
- [取得協助](#get-help)
|
||||
- [授權條款](#license)
|
||||
|
||||
<a id="requirements"></a>
|
||||
|
||||
## 📋 環境要求
|
||||
|
||||
- **Hexo**:5.3.0 或以上
|
||||
- **Node.js**:18 或以上(`hexo-util` 4.x 的要求)
|
||||
- **Git**:僅 Git 安裝需要
|
||||
|
||||
<a id="quick-start"></a>
|
||||
|
||||
## 🚀 快速開始
|
||||
|
||||
### 💾 安裝方式
|
||||
|
||||
#### 方式一:Git 安裝(推薦)
|
||||
|
||||
> 💡 **提示**:如果您在中國大陸連線 GitHub 較慢,可以使用 [Gitee 鏡像](https://gitee.com/immyw/hexo-theme-butterfly.git)。
|
||||
|
||||
在 Hexo 部落格根目錄執行以下指令:
|
||||
|
||||
```bash
|
||||
# 安裝穩定版本(推薦)
|
||||
git clone -b master --depth 1 https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||
```
|
||||
|
||||
```bash
|
||||
# 安裝開發版本(搶先體驗新功能)
|
||||
git clone -b dev --depth 1 https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||
```
|
||||
|
||||
> 📁 如果 `themes/butterfly` 已存在,請先刪除或重新命名,否則目標資料夾不是空的,`git clone` 會失敗。
|
||||
|
||||
#### 方式二:npm 安裝
|
||||
|
||||
```bash
|
||||
npm install hexo-theme-butterfly
|
||||
```
|
||||
|
||||
> ⚠️ **注意**:npm 安裝不會在 `themes/` 底下建立資料夾,主題會放在 `node_modules/` 中。
|
||||
|
||||
### ⚙️ 啟用與設定
|
||||
|
||||
1. **啟用主題**:修改 Hexo 根目錄的 `_config.yml`:
|
||||
|
||||
```yaml
|
||||
theme: butterfly
|
||||
```
|
||||
|
||||
2. **複製主題設定**(建議,這樣升級時才不會覆蓋您的設定):
|
||||
|
||||
```bash
|
||||
# Git 安裝
|
||||
cp themes/butterfly/_config.yml _config.butterfly.yml
|
||||
|
||||
# npm 安裝
|
||||
cp node_modules/hexo-theme-butterfly/_config.yml _config.butterfly.yml
|
||||
```
|
||||
|
||||
> 💡 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 安裝)。
|
||||
>
|
||||
> ⚠️ 之後只需修改 `_config.butterfly.yml`。請勿刪除主題內的 `_config.yml`,也不要將自訂檔案或圖片放進主題的 `source/` 資料夾,升級時可能會被覆蓋。
|
||||
|
||||
3. **安裝渲染器並在本機預覽**:
|
||||
|
||||
```bash
|
||||
npm install hexo-renderer-pug hexo-renderer-stylus --save
|
||||
hexo clean && hexo s
|
||||
```
|
||||
|
||||
<a id="upgrade"></a>
|
||||
|
||||
## 🔄 升級
|
||||
|
||||
**Git 安裝**
|
||||
|
||||
```bash
|
||||
cd themes/butterfly
|
||||
git pull
|
||||
```
|
||||
|
||||
**npm 安裝**
|
||||
|
||||
```bash
|
||||
npm update hexo-theme-butterfly
|
||||
```
|
||||
|
||||
升級前請先備份設定。升級後請到 [Releases](https://github.com/jerryc127/hexo-theme-butterfly/releases) 查看 `_config` 的變更,並同步到 `_config.butterfly.yml`。
|
||||
|
||||
<a id="theme-features"></a>
|
||||
|
||||
## ✨ 主題特色
|
||||
|
||||
> 💡 所有功能都能在 `_config.butterfly.yml` 中開啟、關閉與調整,詳見[主題設定文檔](https://butterfly.js.org/posts/4aa8abbe/)。
|
||||
|
||||
### 🎨 設計
|
||||
- ✅ **卡片化設計**:現代卡片式佈局
|
||||
- ✅ **圓角或直角**:可自訂圓角大小
|
||||
- ✅ **響應式設計**:自動適應各種螢幕尺寸
|
||||
- ✅ **雙欄佈局**:優化閱讀體驗
|
||||
- ✅ **深色模式**:夜間閱讀更護眼
|
||||
|
||||
### 📝 內容
|
||||
- ✅ **多層選單**:支援多層導覽
|
||||
- ✅ **閱讀模式**:專注閱讀
|
||||
- ✅ **目錄**:電腦與手機皆支援
|
||||
- ✅ **字數統計**:顯示字數與預估閱讀時間
|
||||
- ✅ **相關文章**:在文章底部推薦相關內容
|
||||
- ✅ **過期提醒**:文章可能過期時提醒讀者
|
||||
- ✅ **簡繁轉換**:在繁體與簡體中文之間切換
|
||||
- ✅ **標籤外掛**:提供多種實用外掛
|
||||
|
||||
### 🔍 搜尋與導覽
|
||||
- ✅ **多種搜尋方式**:Algolia、本機搜尋或 DocSearch
|
||||
- ✅ **內建 404 頁面**:美觀的錯誤頁面
|
||||
- ✅ **PJAX**:流暢的頁面切換
|
||||
|
||||
### 🎨 程式碼展示
|
||||
- ✅ **語法高亮**:內建多種主題(darker、pale night、light、ocean)
|
||||
- ✅ **程式碼區塊工具**:語言標示、摺疊、複製按鈕、自動換行
|
||||
- ✅ **數學公式**:支援 MathJax 與 KaTeX
|
||||
|
||||
### 💬 社群互動
|
||||
- ✅ **多種留言系統**:Disqus、Gitalk、Valine、Waline、Twikoo、Giscus、Artalk 等
|
||||
- ✅ **雙留言系統**:可同時啟用兩套
|
||||
- ✅ **分享**:Share.js 與 AddToAny
|
||||
- ✅ **即時客服**:Chatra、Tidio 或 Crisp
|
||||
|
||||
### 📊 分析與統計
|
||||
- ✅ **瀏覽統計**:不蒜子計數器
|
||||
- ✅ **網站分析**:Google Analytics、百度統計、Cloudflare Analytics、Microsoft Clarity 或 Umami
|
||||
- ✅ **搜尋引擎驗證**:Google 與百度
|
||||
- ✅ **廣告**:Google AdSense 與自訂廣告版位
|
||||
|
||||
### 🎪 視覺效果
|
||||
- ✅ **打字特效**:activate_power_mode 動畫
|
||||
- ✅ **背景特效**:靜態、動態或飄動彩帶,以及 Canvas Nest
|
||||
- ✅ **滑鼠特效**:點擊時顯示煙花、愛心或文字
|
||||
- ✅ **載入動畫**:Preloader 或 pace.js 進度條
|
||||
- ✅ **圖片燈箱**:medium-zoom 或 Fancybox
|
||||
- ✅ **延遲載入**:圖片進入視窗時才載入
|
||||
|
||||
### 🛠️ 進階功能
|
||||
- ✅ **PWA**:漸進式網頁應用
|
||||
- ✅ **複製保護**:停用複製或附加版權聲明
|
||||
- ✅ **主題自訂**:可更換網站配色
|
||||
- ✅ **圖表**:Mermaid 流程圖與 Chart.js 圖表
|
||||
- ✅ **樂譜**:支援 ABCJS 記譜
|
||||
- ✅ **文章系列**:將文章整理成系列
|
||||
- ✅ **instant.page**:預載頁面,加快導覽
|
||||
- ✅ **Snackbar**:優雅的提示通知
|
||||
|
||||
## 🤝 貢獻者
|
||||
|
||||
感謝每一位為 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 趨勢
|
||||
|
||||
[](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 96 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user