1). 安装Node
2). 安装Git
3). 注册码云
4). 安装Hexo
npm install hexo-cli -g

图1.png
5). 在一个空文件夹中初始化hexo
hexo init

图2.png
6). 生成静态页面
hexo g

图3.png
7). 启动本地服务
hexo s

图4.png
浏览器输入:http://localhost:4000/
查看
8). 在码云中创建项目

图5.png
9). 获取仓库地址链接
https://gitee.com/mazaiting/blog.git

图6.png
10). 修改配置项目根目录_config.yml 文件,修改deploy的值

图7.png
11). 配置用户名和邮箱
git config --global user.name空格+你的码云的名字
git config --global user.email空格+你的码云的邮箱
12). 安装hexo-deployer-git
npm install hexo-deployer-git --save

图8.png
13). 一键部署
hexo deploy

图9.png
运行后报错,然后执行命令
npm install hexo --save
,运行完成后再执行
hexo deploy

图10.png
执行成功后:

图11.png
14). 码云文件

图12.png
15). 使用免费域名
在项目首页 -> 服务 -> Gitee Pages

图13.png
-
进入后页面如下图,接下来要先对绑定手机号,点击下方的蓝色设置
图14.png -
如果已绑定手机号则为该页面,则直接点击启动即可
图15.png
16). 部署成功
成功后界面如下,登陆https://mazaiting.gitee.io/blog
即可访问

图16.png
17). 问题
此时访问https://mazaiting.gitee.io/blog
,会没有样式

图17.png
解决方法:在_config.yml中,修改
root: /
为
root: /<项目名>/
(此处默认为
root: /
), 然后重新部署。

图18.png