一. 在github上先创建2个库
二. 设置frontEnd_blog项目
- 点击Settings
- 在GitHub Pages 下,点击 Choose a theme,随便选择一个主题
- 然后在GitHub Pages 下会看到:
Your site is published at https://sww1230.github.io/frontEnd_blog/
设置完毕后你就可以通过 username.github.io(username为你的用户名访问你的博客了)
三. 上传并配置hexo_blog
安装hexo
1
2
3
4
5
6
7
8npm install hexo-cli -g
hexo init hexo_blog
cd hexo_blog
npm install
hexo g #生成或 hexo generate
hexo s #启动本地服务器 或者 hexo server,这一步之后就可以通过http://localhost:4000 查看了
hexo new "文章名" #新建文章
hexo new page "页面名" #新建页面修改_config.yml
1
2
3
4
5
6
7
8
9
10title: frontEnd_blog
subtitle: 前端技术积累沉淀
author: wenwu.shang
url: https://sww1230.github.io/
root: /frontEnd_blog/
deploy:
type: git
repo: https://github.com/sww1230/frontEnd_blog.git
branch: master编译hexo_blog部署至frontEnd_blog
1
hexo d
上传代码至hexo_blog库
1
2
3
4
5git init
git remote add origin https://github.com/sww1230/hexo_blog.git
git add .
git commit -m 'update'
git push