mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-12-04 21:36:06 +08:00
Compare commits
No files matched your search
+1
-1
@@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
|
|||||||
issuehunt: # Replace with a single IssueHunt username
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
otechie: # Replace with a single Otechie username
|
otechie: # Replace with a single Otechie username
|
||||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||||
custom: ['https://buy.stripe.com/3cs6rP6YA91sbbG5kk','https://jsd.012700.xyz/gh/jerryc127/CDN/Photo/wechat.jpg'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
custom: ['https://buy.stripe.com/3cs6rP6YA91sbbG5kk'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
@@ -1,19 +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:
|
||||||
|
contents: read
|
||||||
|
id-token: write # OIDC 必須
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
# Setup .npmrc file to publish to npm
|
- uses: actions/setup-node@v4
|
||||||
- uses: actions/setup-node@v1
|
with:
|
||||||
with:
|
node-version: '24' # trusted publishing 需要 >= 22.14
|
||||||
node-version: '12.x'
|
- run: npm install -g npm@latest
|
||||||
registry-url: 'https://registry.npmjs.org'
|
- run: npm install
|
||||||
- run: npm install
|
- name: Publish
|
||||||
- run: npm publish
|
run: |
|
||||||
env:
|
echo "repo=$GITHUB_REPOSITORY"
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
npm publish --access public
|
||||||
@@ -1,117 +1,260 @@
|
|||||||
<div align="right">
|
<div align="right">
|
||||||
<a title="Chinese" href="/README_CN.md">中文</a>
|
<a title="繁體中文" href="./README_CN.md">繁體中文</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
<img src="./source/img/butterfly-icon.png" width="150" height="150" />
|
<img src="./source/img/butterfly-icon.png" width="150" height="150" alt="Butterfly Logo" />
|
||||||
|
|
||||||
# hexo-theme-butterfly
|
# hexo-theme-butterfly
|
||||||
|
|
||||||

|
A modern, elegant, and feature-rich theme for Hexo
|
||||||

|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|

|
||||||
📢 Demo: [Butterfly](https://butterfly.js.org/) / [CrazyWong](https://blog.crazywong.com/)
|

|
||||||
|

|
||||||
📖 Docs: [English](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/) / [Chinese](https://butterfly.js.org/posts/21cfbf15/)
|
|
||||||
|
📢 **Demo**: [Official Site](https://butterfly.js.org/) | [CrazyWong's Blog](https://blog.crazywong.com/)
|
||||||

|
|
||||||
|
📖 **Documentation**: [English](https://butterfly.js.org/en/posts/butterfly-docs-en-get-started/) | [中文文檔](https://butterfly.js.org/posts/21cfbf15/)
|
||||||
</div>
|
|
||||||
|

|
||||||
---
|
|
||||||
|
</div>
|
||||||
## 💻 Installation
|
|
||||||
|
---
|
||||||
### GIT
|
|
||||||
|
## 📑 Table of Contents
|
||||||
> If you are in Mainland China, you can download in [Gitee](https://gitee.com/immyw/hexo-theme-butterfly.git)
|
|
||||||
|
- [Requirements](#requirements)
|
||||||
Stable branch [recommend]:
|
- [Quick Start](#quick-start)
|
||||||
|
- [Upgrade](#upgrade)
|
||||||
```
|
- [Theme Features](#theme-features)
|
||||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
- [Screenshots](#screenshots)
|
||||||
```
|
- [Get Help & Support](#get-help)
|
||||||
|
- [License](#license)
|
||||||
Dev branch:
|
|
||||||
|
<a id="requirements"></a>
|
||||||
```
|
|
||||||
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
## 📋 Requirements
|
||||||
```
|
|
||||||
|
- **Hexo**: 5.3.0 or later
|
||||||
### NPM
|
- **Node.js**: 18 or later (`hexo-util` 4.x requires it)
|
||||||
|
- **Git**: only needed for Git installs
|
||||||
> It supports Hexo 5.0.0 or later
|
|
||||||
|
<a id="quick-start"></a>
|
||||||
In Hexo site root directory
|
|
||||||
|
## 🚀 Quick Start
|
||||||
```powershell
|
|
||||||
npm i hexo-theme-butterfly
|
### 💾 Installation
|
||||||
```
|
|
||||||
|
#### Option 1: Git (Recommended)
|
||||||
## ⚙ Configuration
|
|
||||||
|
> 💡 **Tip**: If GitHub access is slow from mainland China, use the [Gitee mirror](https://gitee.com/immyw/hexo-theme-butterfly.git).
|
||||||
Set theme in the hexo work folder's root config file `_config.yml`:
|
|
||||||
|
Run the following in your Hexo blog root:
|
||||||
> theme: butterfly
|
|
||||||
|
```bash
|
||||||
If you don't have pug & stylus renderer, try this:
|
# Stable release (recommended)
|
||||||
|
git clone -b master --depth 1 https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||||
> npm install hexo-renderer-pug hexo-renderer-stylus
|
```
|
||||||
|
|
||||||
## 🎉 Features
|
```bash
|
||||||
|
# Development branch (early access to new features)
|
||||||
- [x] Card UI Design
|
git clone -b dev --depth 1 https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||||
- [x] Rounded Design/Squared Design
|
```
|
||||||
- [X] Support sub-menu
|
|
||||||
- [x] Two-column layout
|
> 📁 If `themes/butterfly` already exists, remove or rename it first; `git clone` will fail if the target folder isn't empty.
|
||||||
- [x] Responsive Web Design
|
|
||||||
- [x] Dark Mode
|
#### Option 2: npm
|
||||||
- [x] Pjax
|
|
||||||
- [x] Read Mode
|
```bash
|
||||||
- [x] Conversion between Traditional and Simplified Chinese
|
npm install hexo-theme-butterfly
|
||||||
- [X] TOC catalog is available for both computers and mobile phones
|
```
|
||||||
- [X] Built-in Syntax Highlighting Themes (darker/pale night/light/ocean), also support customization
|
|
||||||
- [X] Code Blocks (Display code language/close or expand Code Blocks/Copy Button/word wrap)
|
> ⚠️ **Note**: npm doesn't create a folder under `themes/`; the theme goes into `node_modules/` instead.
|
||||||
- [X] Disable copy/Add a Copyright Notice to the Copied Text
|
|
||||||
- [X] Search (Algolia Search/Local Search)
|
### ⚙️ Enable & Configure
|
||||||
- [x] Mathjax and Katex
|
|
||||||
- [x] Built-in 404 page
|
1. **Enable the theme**: set it in the `_config.yml` at your Hexo root:
|
||||||
- [x] WordCount
|
|
||||||
- [x] Related articles
|
```yaml
|
||||||
- [x] Displays outdated notice for a post
|
theme: butterfly
|
||||||
- [x] Share (Sharejs/Addtoany)
|
```
|
||||||
- [X] Comment (Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/artalk)
|
|
||||||
- [x] Multiple Comment System Support
|
2. **Copy the theme config** (recommended, so upgrades don't overwrite your settings):
|
||||||
- [x] Online Chats (Chatra/Tidio/Crisp)
|
|
||||||
- [x] Web analytics
|
```bash
|
||||||
- [x] Google AdSense
|
# Git install
|
||||||
- [x] Webmaster Verification
|
cp themes/butterfly/_config.yml _config.butterfly.yml
|
||||||
- [x] Change website colour scheme
|
|
||||||
- [x] Typewriter Effect: activate_power_mode
|
# npm install
|
||||||
- [x] Background effects (Canvas ribbon/canvas_ribbon_piao/canvas_nest)
|
cp node_modules/hexo-theme-butterfly/_config.yml _config.butterfly.yml
|
||||||
- [x] Mouse click effects (Fireworks/Heart/Text)
|
```
|
||||||
- [x] Preloader/Loading Animation/pace.js
|
|
||||||
- [x] Busuanzi visitor counter
|
> 💡 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.
|
||||||
- [x] Medium Zoom/Fancybox
|
>
|
||||||
- [x] Mermaid
|
> ⚠️ 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.
|
||||||
- [x] Chart.js
|
|
||||||
- [x] Justified Gallery
|
3. **Install the renderers and preview locally**:
|
||||||
- [x] Lazyload images
|
|
||||||
- [x] Instantpage/Snackbar notification toast/PWA......
|
```bash
|
||||||
|
npm install hexo-renderer-pug hexo-renderer-stylus --save
|
||||||
## ✨ Contributors
|
hexo clean && hexo s
|
||||||
|
```
|
||||||
<a href="https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors">
|
|
||||||
<img src="https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly" />
|
<a id="upgrade"></a>
|
||||||
</a>
|
|
||||||
|
## 🔄 Upgrade
|
||||||
## 📷 Screenshots
|
|
||||||
|
**Git install**
|
||||||

|
|
||||||

|
```bash
|
||||||

|
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
|
||||||
|
|
||||||
|
> 💡 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.
|
||||||
|
|
||||||
|
### 🎨 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
|
||||||
|
- ✅ **Multiple search options** — Algolia, local search, or DocSearch
|
||||||
|
- ✅ **Built-in 404 page** — A polished error page
|
||||||
|
- ✅ **PJAX** — Smooth page transitions
|
||||||
|
|
||||||
|
### 🎨 Code Display
|
||||||
|
- ✅ **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
|
||||||
|
- ✅ **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
|
||||||
|
- ✅ **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
|
||||||
|
- ✅ **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
|
||||||
|
- ✅ **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 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 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?** → [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 help? Contributions of every kind are welcome:
|
||||||
|
|
||||||
|
- **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).
|
||||||
|
|
||||||
|
## 🙏 Acknowledgments
|
||||||
|
|
||||||
|
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 everyone who has contributed to Butterfly — your support keeps the theme moving forward.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
**✨ If you find this theme useful, please give it a ⭐ star! ✨**
|
||||||
|
</div>
|
||||||
Loaded 3 of 114 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user