This article is translated from ChatGPT.


hexo-theme-butterfly is a theme developed based on hexo-theme-melody.

Installation

If you are in mainland China and have difficulty accessing GitHub

Stable Version [Recommended]

In your Hexo root directory:

1
git clone -b master https://gitee.com/immyw/hexo-theme-butterfly.git themes/butterfly

Dev version

The dev version may have bugs; if you prefer stability, please install the stable version.

If you want to install the latest dev branch, you can:

1
git clone -b dev https://gitee.com/immyw/hexo-theme-butterfly.git themes/butterfly

Upgrade method: In the theme directory, run git pull

Stable Version [Recommended]

In your Hexo root directory:

1
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly

Dev Version

The dev version may have bugs; if you prefer stability, please install the stable version.

If you want to install the latest dev branch, you can:

1
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly

Upgrade method: In the theme directory, run git pull

This method only supports Hexo version 5.0.0 and above.

Installing via npm will not create a theme folder in themes but will create one in node_modules.

In your Hexo root directory:

1
npm install hexo-theme-butterfly

Upgrade method: In the Hexo root directory, run npm update hexo-theme-butterfly

Apply the Theme

Modify the _config.yml in your Hexo root directory to set the theme to butterfly:

1
theme: butterfly

Install Plugins

If you do not have the pug and stylus renderers, please download and install them:

1
npm install hexo-renderer-pug hexo-renderer-stylus --save

Upgrade Suggestions

After upgrading, please visit the Releases page on GitHub to check the update details of the new version.

If there are changes to the _config file, please update your configuration accordingly.

To minimize the inconvenience caused by theme upgrades, please use the following method (recommended but optional).

Create a file named _config.butterfly.yml in the root directory of hexo, and copy the contents of the theme's _config.yml to _config.butterfly.yml.

Note: Copy the _config.yml from the theme, not the _config.yml from hexo.

Note: Do not delete the _config.yml in the theme directory.

Note: From now on, configure in _config.butterfly.yml only.
If you use _config.butterfly.yml, the configurations in the theme's _config.yml will not be effective.

Hexo will automatically merge the configurations from the theme's _config.yml and _config.butterfly.yml. If there are duplicate configurations, the ones in _config.butterfly.yml will take precedence.

butterfly-docs-install-suggestion-1.png

πŸ“‘ Butterfly document - Theme Pages