This article is translated from ChatGPT.

πŸ¦‹ Butterfly has been updated to 4.10.


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

Installation

Stable Version [Recommended]

Inside your Hexo root directory, run:

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

Dev Version

The dev version may contain bugs. If you prefer stability, please install the stable version

If you want to install a newer dev branch, you can run:

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

Upgrade method: Run git pull in the theme directory.

Stable Version [Recommended]

Inside your Hexo root directory, run:

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

Dev Version

The dev version may contain bugs. If you prefer stability, please install the stable version.

If you want to install a newer dev branch, you can run:

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

Upgrade method: Run git pull in the theme directory.

This method only supports Hexo 5.0.0 and above.

Installing via npm will not generate a theme folder inside the themes directory, instead, it will be generated in the node_modules directory.

Inside your Hexo root directory, run:

1
npm install hexo-theme-butterfly

Upgrade method: Run npm update hexo-theme-butterfly in the Hexo root directory.

Applying the Theme

Modify the _config.yml file in your Hexo root directory and change the theme to butterfly:

1
theme: butterfly

Installing Plugins

If you don't have the Pug and Stylus renderers, download and install them:

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

Upgrade Recommendations

After upgrading, please check the Releases page on GitHub or ζ–‡ζͺ”δΈƒ for the update details of the new version.

There will be a section that indicates the changes to the _config file (if any). Please update your configuration accordingly.

To minimize the inconvenience caused by upgrading the theme, you can follow the following method (recommended, but optional).

Create a file named _config.butterfly.yml in the root directory of your Hexo project and copy the content of the _config.yml file from the theme directory to _config.butterfly.yml. (Note: Copy the _config.yml file from the theme, not from Hexo's root directory).

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

Note: In the future, only make configurations in _config.butterfly.yml.
If you use _config.butterfly.yml, the configuration in the theme's _config.yml file will not take effect.

Hexo will automatically merge the configurations from the _config.yml and _config.butterfly.yml files. If there are conflicting configurations, the ones from _config.butterfly.yml will take precedence.

image-20200805191531090

πŸ“‘ Butterfly document - Theme Pages