1. 创建文件夹
2. 右击文件夹选择Git Bash Here
3. $ npm install -g cnpm --registry=https://registry.npm.taobao.org(我使用淘宝NPM镜像,输入以下命令等待安装完成)
4. $ cnpm install -g hexo-cli(与原先的npm完全一样,只是命令改为cnpm,一样等待hexo安装完成)
5. $ cnpm install hexo --save
6. $ hexo -v(验证是否成功)
7. $ hexo init(初始化)
8. $ cnpm install(安装生成器)
9. $ hexo s -g(ok!访问localhost:4000)
接下来就是代码上传Git,我在这里使用的[coding](https://coding.net/)!
使用起来非常简单和GitHup类似,速度相对来说快点!
1. 首先注册账号
2. 创建一个项目(获取到HTTPS路径)
3. 将你的刚刚安装的HEXO文件夹中的 _config.yml文件打开并修改
4. [Hexo配置详解](http://blog.youkuaiyun.com/xuezhisdc/article/details/53130383) 切忌url后面不可为空,每个:后面加空格
5. 最下面的配置别忘记
* deploy:
* type: git
* repository: https://git.coding.net/dengsuzhen/Deng_Blog.git
* branch: master
6. 使用 $ hexo g -d 将文件上传到 coding 上(上你的仓库看一下有没有记录)
7. 设置 Page 服务 ,选择 master!! okok
8. 如有报git错误 执行 (npm install hexo-deployer-git --save)
no.4选择主题
1. 选择一个自己喜欢的 找到Git地址
2. down到你的Hexo文件夹内($ git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia)
3. 在你的 config 文件中找到 theme: 后面的值写为刚刚你设置的
4. 继续上传上去(hexo g -d)记得清除浏览器缓存 在访问
no.5 END
上面咱们一直使用的git小黑窗来执行的,其实是可以使用咱们的cmd来执行,但是必须要配置git的环境变量PATH
还有就是咱们访问使用的localhost:4000,那么是不是不启动就访问不了?
NO! 进入coding 找到Page服务 你会看到 (Coding Pages 已经运行在### 直接复制后面的路径发给你的小伙伴)