Hexo部署博客备忘

1.node.js部署

下载安装包,安装
完成后,打开cmd窗口 输入:
node -v
npm -v
出现标识 成功安装node.js

永久设置淘宝源
npm config set registry http://registry.npm.taobao.org/

2.git部署

下载Git 官方地址为:https://git-scm.com/download/win

选择组件

选择使用命令行环境

以下三步默认,直接点击下一步

安装完成后检验是否成功

回到电脑桌面,鼠标右击如果看到有两个git单词则安装成功

3.hexo部署

官方文档

1
npm install -g hexo-cli

先创建 E:\hexo #
进入cd
初始化博客目录

1
2
3
4
5
6
7
8
9
10
11
hexo init ruozedatablog

npm install

hexo clean #清理缓存

hexo g #生成静态文件

hexo s #启动服务器

hexo clean && hexo g && hexo s

http://localhost:4000/

4.github

注册 英文名称简约 好记 高大尚
https://github.com/join?source=header-home 注册

1
2
3
4
5
6
7
8
ssh-keygen -t rsa -b 4096 -C "zxcwangqi@163.com"
#settings进入ssh 点击generate ssh ,选generate new ssh
cd /c/Users/Administrator/.ssh/id_rsa.pub #注意Administrator是本地电脑名称
# 在github上设置新的ssh,将上述文件拷入ssh的key中建立连接
ssh -T git@github.com # 第一次执行 是需要输入yes

git config --global user.name "wangqi1994"
git config --global user.email "zxcwangqi@163.com"

https://github.com/wangqi1994/wangqi1994.github.io
名字需要一致

5.hexo部署github

window—>github

1
2
3
4
5
6
7
8
9
10
11
npm install hexo-deployer-git --save

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: git@github.com:wangqi1994/wangqi1994.github.io.git
branch: master


hexo clean && hexo deploy # 应该会出现 github的登录窗口 输入账号密码登录

6.换个高大尚的主题

https://github.com/JoeyBling/hexo-theme-yilia-plus

cd ./themes/
git clone –depth=1 https://github.com/JoeyBling/hexo-theme-yilia-plus.git ./yilia-plus

修改hexo根目录下的 _config.yml
theme: yilia-plus

部署推
hexo clean && hexo deploy

_config.yml修改你直接的地址

1
2
3
4
5
6
7
8
9
10
11
12
13
deploy:
type: git
repo: git@github.com:wangqi1994/wangqi1994.github.io.git
branch: master


Push hexo blog html to local :
hexo clean && hexo generate && hexo server
open web: http://localhost:4000

Push hexo blog html to github :
hexo clean && hexo deploy
open web: https://wangqi1994.github.io

Markdown语法学习
http://markdown.xiaoshujiang.com/

  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2017-2021 WANG Qi
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信