1. 自行安装 nodejs和git
全局安装cnpm淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
2. 自行注册github账号
3.
- Hexo安装
桌面右键鼠标,点击Git Bash Here,输入npm命令即可安装
npm install hexo-cli -g
npm install hexo-deployer-git --save
第一句是安装hexo,第二句是安装hexo部署到git page的deployer,两个都需要安装。
如下图即安装完成。
![](https://img.haomeiwen.com/i4889822/dee1a0cee2b639db.png)
4. 主题安装直通车
5. 常用指令
- 常用插件安装:
npm install hexo-generator-index --save
npm install hexo-generator-archive --save
npm install hexo-generator-category --save
npm install hexo-generator-tag --save
npm install hexo-server --save
npm install hexo-deployer-git --save
npm install hexo-deployer-heroku --save
npm install hexo-deployer-rsync --save
npm install hexo-deployer-openshift --save
npm install hexo-renderer-marked@0.2 --save
npm install hexo-renderer-stylus@0.2 --save
npm install hexo-generator-feed@1 --save
npm install hexo-generator-sitemap@1 --save
- 主题配置完成以后,回到 根目录(即上一篇文章使用Hexo框架自由搭建博客中提到的 Blog 文件夹),按顺序执行命令就OK啦。
$ npm install hexo-deployer-git --save
$ hexo clean && hexo g && hexo d
- 文章发布指令:
$ hexo d -g
-
设置自定义域名
解析域名
解析完后,再回到 GitHub Pages 设置域名
![](https://img.haomeiwen.com/i4889822/50a121846c21c583.png)
![](https://img.haomeiwen.com/i4889822/44b50c735360d7ed.png)
最后就可以打开浏览器访问自己的域名就是博客的内容啦!!
网友评论