先从我怎么搭建这个博客开始吧

环境安装

node.js
git

然后在命令行输入如下

1
2
3
4
5
npm install hexo-cli -g
hexo init blog
cd blog
npm install
hexo server

浏览器里打开http://localhost:4000/ 就能看见了

主题安装【可选】

https://material.viosey.com/start/

上传到github

配置github

New repository 名字为 你的github名字.github.io

1
ssh-keygen -t rsa -C "youremail@example.com"

生成id_rsa和id_rsa.pub两个文件

把id_rsa.pub添加到github里面

配置hexo

打开_config.yml
修改如下

1
2
3
4
deploy:
type: git
repo: git@github.com:xx/xx.github.io.git
branch: master

写作

1
hexo new "标题"

然后在source\_posts目录里面找到标题.md
编辑好内容后 执行

1
2
hexo clean
hexo generate

生成静态页面

1
hexo server --debug

进行本地调试

上传

觉得差不多就直接上传吧

1
hexo deploy