---
整体过程很简单,需要修改的地方(样式)全看个人,我只把必须修改的地方列在下面
---
使用了hexo和butterfly主题
## 下载hexo(根目录cmd)
``` js
npm install hexo -g
查看版本
hexo version
```
## 初始化博客项目(搭建项目的位置cmd)
会创建一个myblog的文件夹
``` js
hexo init myblog
```
## 安装相关依赖(项目内cmd)
``` js
npm insatll
```
## 启动服务
``` js
hexo serve
```
## 连接github仓库(根目录)
``` js
git config --global user.name "xxxxxx"
git config --global user.email "xxxxxxx"
```
### 注意:创建项目时一定要写成https://username.github.io这种,比如我这个填的是heyfriendis.github.io
## 配置文件(项目内)
``` js
__config.yml 目录下修改deploy
deploy:
type: 'git' //提交方式
repo: 'https://github.com/heyfriendis/heyfriendis.github.io' //仓库http地址
branch: main //提交分支
# Site
title: Welcome my friends
subtitle: ''
description: ''
keywords:
author: heyfriendis
language: zh-CN
timezone: ''
url: https://heyfriendis.github.io //url内的配置
```
## 安装提交插件
``` js
npm install hexo-deployer-git --save
```
## 提交
#### 清理缓存
``` js
hexo clean
```
#### 生成文件
``` js
hexo g
```
#### 提交
``` js
hexo d
```
## 下载butterfly主题
``` js
npm i hexo-theme-butterfly
```
在_config下修改theme: theme: butterfly
## 下载运行需要的依赖
``` js
npm install hexo-renderer-pug hexo-renderer-stylus --save
```
## 404访问页面
```
打开node_modules下的hexo-butterfly配置文件
把config.yml复制下来
到主文件夹创建_config.butterfly.yml中黏贴
搜索404把配置改为true
```
如果想要更加详细的修改,请访问官方文档:https://butterfly.js.org/