Hexo+github+NexT > 更漂亮的博客

2018-05-23  本文已影响0人  __Gavin__
需要的环境
搭建步骤
1. 如果电脑没有git、node环境
$ sudo apt-get install git-core   // 安装Git
$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh   //安装 Node.js
2. 安装Hexo
$ mkdir hexoBlog
$ npm install hexo-cli -g
3. 初始化Hexo
$ mkdir blog
$ cd blog
$ hexo init 
4. 生成静态网站
$ hexo g    // Generat
5. 本地启动测试
$ hexo s    // server,打开(http://localhost:4000)进行本地测试
6. 创建GitHub仓库
仓库名称:xxx.github.io    // xxx是GitHub账户名称
7. 配置Hexo

打开根目录的_config.yml文件,如下配置:

deploy:
  type: git 
  repository: https://github.com/xxx/xxx.github.io.git
  branch: master
8. 安装git部署工具
$ npm install hexo-deployer-git --save
9. 部署到GitHub
$ hexo d    // 可以访问(xxx.github.io)测试部署结果
10. 绑定域名
主机记录:@    记录类型: A    记录值:192.30.252.153     TTL: 10分钟
主机记录:www  记录类型: A    记录值:192.30.252.154     TTL: 10分钟
$ hexo g 
$ hexo d
11. 安装NexT
$ git clone https://github.com/iissnan/hexo-theme-next themes/next
$ theme: next
$ hexo s -debug
$ hexo g
$ hexo d
12. 发布文章
$ hexo new [layout] "post-name"
$ hexo g    // 生成静态文件。
$ hexo s    // 在本地预览效果。
$ hexo d    // 同步到github。
我的博客地址

欢迎访问:zynlo

上一篇 下一篇

猜你喜欢

热点阅读