搭建过程

以下均摘录自知乎

## 准备工作

注意 本文主要针对Windows平台和Hexo 3.x

### 了解Hexo

>A fast, simple & powerful blog framework

Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。
http://hexo.io**

### 安装GIT
[GitHub Windows](GitHub for Windows**)

简单可依赖,安装完成后依据提示操作即可,So Easy

###安装Node.JS
Node.JS

注意 安装完成后添加Path环境变量,使npm命令生效

``` bash
C:\Program Files\nodejs\node_modules\npm
```

### 安装Hexo

配置好GitHub家目录后,双击桌面上的Git Shell,输入npm命令即可安装

``` bash
npm install -g hexo-cli
npm install hexo –save
```

文档**

-–

## Hexo初始化配置

### 创建Hexo文件夹
安装完成后,根据自己喜好建立目录(如E:\kuaipan\GitHub\hexo),进入Git Shell切换到该路径下E:\kuaipan\GitHub\hexo执行以下指令
``` npm
hexo init
```

### 安装Hexo插件

``` bash
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
```

### 本地查看效果
继续执行以下命令,成功后可登录localhost:4000查看效果
``` bash
hexo server
```

### Hexo简写命令
``` bash
hexo n #new
hexo g #generate
hexo s #server
```
-–

## 部署静态网页到GitHub

### 注册设置GitHub

  1. 登录[GitHub](GitHub · Build software better, together.**),注册自定义用户名如wsgzao
  2. 在主页右下角创建New repository,name必须和用户名一致如[http://wsgzao.github.io**](https://link.zhihu.com/?target=http%3A//wsgzao.github.io)
  3. 首次创建耐心等待10分钟左右审核,之后即可访问静态主页如HelloDog**

### 同步内容至GitHub

  1. 下载[GitHub Windows](GitHub for Windows**)
  2. 设置Local pathE:\快盘\GitHub\
  3. 运行Git Shell切换到如E:\快盘\GitHub\hexo路径下
  4. 执行hexo g命令生成public文件夹
  5. 把生成的内容全部拷贝到Local path或其子目录
  6. 运行GitHub确认修改信息后执行右上角的Sync同步
  7. 最后访问主页观察效果

[GitHub Pages**](GitHub Pages**)

-–
## 域名和DNS

### 域名推荐

> GoDaddy makes registering Domain Names fast, simple, and affordable.
【推荐理由】两个字“靠谱”,支持支付宝,附优惠码链接

[Domain Names**](Domain Names**)
[Godaddy Coupon Code**](Godaddy Coupon Code**)

### DNS推荐

>致力于为您提供最稳定、最安全的域名解析服务
【推荐理由】依然是两个字“靠谱”,感谢他们一直以来对于公益的坚持

DNSPod-免费智能DNS解析服务商**

### 设置CNAME

  1. 在Github的网站目录下创建CNAME文件
  2. 填写自己的域名如[http://hellodog.com**](https://link.zhihu.com/?target=http%3A//hellodog.com),保存结束
  3. 登录DNSPod,先添加域名,然后添加记录,设置如下