Hexo + Butterfly 个人博客

  1. 安装 Hexo

基于nodejs,按照官方文档直接初始化项目,成功后 hexo server 本地查看默认页面

  1. 配置 Github Pages 部署网站

按照 username.github.io 命名格式新建 github repository,配置好 SSH key,在 hexo 项目中的配置文件 _config.yml 中的 deploy 字段下设置 github 代码库地址:

1
2
3
4
5
6
deploy:
type: git
repo:
github:
url: git@github.com:cheliosky/cheliosky.github.io.git
branch: main
  • hexo clean
  • hexo generate
  • hexo deploy

访问 username.github.io 即可预览线上页面

  1. Git 管理网站源码

git init 本地初始化仓库

.gitignore 文件添加忽略 themes/butterfly/.git

github 新建私人仓库,本地源码设置关联

  1. 引入 butterfly 主题

依据官方文档,将 butterfly 源码通过克隆到项目中

修改 _config.yml 中 themes 字段

在项目根目录新建 _config.butterfly.yml 文件并拷贝 themes/butterfly/_config.yml 的内容

5.