使用Github Page和Hexo搭建个人博客

我的博客

1. 自行安装 nodejs和git

全局安装cnpm淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org

2. 自行注册github账号

3.

  1. Hexo安装
    桌面右键鼠标,点击Git Bash Here,输入npm命令即可安装
npm install hexo-cli -g
npm install hexo-deployer-git --save

第一句是安装hexo,第二句是安装hexo部署到git page的deployer,两个都需要安装。

如下图即安装完成。


image.png

详细教程直通车->

4. 主题安装直通车

5. 常用指令

  1. 常用插件安装:
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

  1. 主题配置完成以后,回到 根目录(即上一篇文章使用Hexo框架自由搭建博客中提到的 Blog 文件夹),按顺序执行命令就OK啦。
$ npm install hexo-deployer-git --save  
$ hexo clean && hexo g && hexo d

  1. 文章发布指令:
$ hexo d -g 
  1. 设置自定义域名


    解析域名

解析完后,再回到 GitHub Pages 设置域名

如下图:
设置
写域名保存

最后就可以打开浏览器访问自己的域名就是博客的内容啦!!

6. Hexo官网文档直通车

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容