Getting Started with Hexo Theme Butterfly
2025-05-28
Docs
10 min read
Getting Started with Hexo Theme Butterfly
欢迎使用 Butterfly 主题!这是一个功能强大且美观的 Hexo 主题。
安装步骤
1. 安装 Hexo
首先,确保您已经安装了 Node.js,然后全局安装 Hexo:
npm install -g hexo-cli
2. 创建 Hexo 博客
hexo init my-blog cd my-blog npm install
3. 安装 Butterfly 主题
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
4. 配置主题
在 _config.yml 文件中设置主题:
theme: butterfly
配置说明
基本信息配置
title: Your Blog Title subtitle: Your Blog Subtitle description: Your Blog Description keywords: keyword1, keyword2 author: Your Name
主题配置
Butterfly 主题提供了丰富的配置选项,您可以在 themes/butterfly/_config.yml 中进行配置。
开始写作
创建您的第一篇文章:
hexo new post "My First Post"
然后编辑 source/_posts/My-First-Post.md 文件。
部署
部署到 GitHub Pages
npm install hexo-deployer-git --save
在 _config.yml 中配置:
deploy: type: git repo: https://github.com/yourusername/yourusername.github.io.git branch: main
然后运行:
hexo clean hexo generate hexo deploy
总结
现在您已经了解了如何开始使用 Butterfly 主题。更多详细信息,请查看官方文档。