Hexo搭建博客小结

Nodejs安装,直接用命令。压缩包软链接创建会失败

1
2
3
4
5
$ sudo apt-get install nodejs & npm
$ node -v
v6.3.1
$ npm -v
4.4.2

配置ssh

1
2
$ git config --global user.name "你的GitHub用户名"
$ git config --global user.email "你的GitHub注册邮箱"

生成ssh密匙 & 添加到github上

1
$ ssh-keygen -t rsa -C "你的GitHub注册邮箱"

验证是否连接成功

1
2
$ ssh -T git@github.com
Hi ynuwm! You've successfully authenticated, but GitHub does not provide shell access.

执行hexo d输入github用户名密码

hexo d 出现错误,找不到命令

1
$ npm install hexo-deployer-git --save

hexo博客部署到github上,冒号后面注意空格

1
2
3
4
5
6
7
8
9
# Deployment 注释
## Docs: https://hexo.io/docs/deployment.html
deploy:
# 类型
type: git
# 仓库
repo: git@github.com:ynuwm/ynuwm.github.io.git
# 分支
branch: master

添加标签页。/sources目录下修改index.md

1
$ hexo new page tags

参考:
https://hexo.io/
http://ibruce.info/
http://volcfamily.cn/
https://notes.wanghao.work/
http://theme-next.iissnan.com/
https://www.waerfa.com/wordmark
https://www.zhihu.com/question/21193762
http://www.cnblogs.com/zhvon/p/5351043.html
http://www.cnblogs.com/zhaoyu1995/p/6239950.html
https://www.zhihu.com/question/24422335/answer/46357100

如果文章对您有用请随意打赏,谢谢支持!
0%