自己也算是摸爬滚打搭建成功,然后自己再重新安装部署一遍,把完整步骤分享给大家,同时最后有一些连接,如果我的步骤不行,大家可以参考其他人的(这个有点花费时间,大家提前有个心理准备 - _-)
一、第一步:下载安装Git![](http://upload-images.jianshu.io/upload_images/1531909-6e4dd1331b8ee66c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1、Git下载地址
2、安装步骤
![](http://upload-images.jianshu.io/upload_images/1531909-4da9b2db5ad099b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/1531909-44bddccbb0bc44fb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
然后一路默认
二、第二步:下载安装node.js
![](http://upload-images.jianshu.io/upload_images/1531909-acb3ca9d69e0037f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2、安装步骤:一路默认就行(安装路径根据自己需要更改)
三、第三步:安装hexo1、利用 npm 命令即可安装。在任意位置点击鼠标右键,选择Git Bash
![](http://upload-images.jianshu.io/upload_images/1531909-ed306496f5c34312.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2、输入命令:npm install -g hexo
![](http://upload-images.jianshu.io/upload_images/1531909-0b9d56643f6b27cc.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
这里如果地址被“墙”,可以参考这篇文章的“安装Hexo”部分
四、第四步:初始化Hexo1、创建文件夹(我的是在E盘创建的Hexo)
![](http://upload-images.jianshu.io/upload_images/1531909-b4cfc9da3f2063b9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2、在Hexo文件下,右键运行Git Bash,输入命令:hexo init
![](http://upload-images.jianshu.io/upload_images/1531909-f6ae9b7089741c89.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/1531909-d0452912537c03e8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3、在_config.yml,进行基础配置
![](http://upload-images.jianshu.io/upload_images/1531909-cd5743eda172deca.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
其中可以在这里浏览更多主题,然后在Hexo文件夹下 Git Bash
输入命令:git clone https://github.com/iissnan/hexo-theme-nextthemes/next(next为主题名字),来获得更多主题
![](http://upload-images.jianshu.io/upload_images/1531909-c428c38d5b6f608d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/1531909-9e10141923fcdf7a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
4、本地浏览博客
分别输入 如下命令:
hexo g
hexo s
这里有更多hexo常用命令
![](http://upload-images.jianshu.io/upload_images/1531909-0501276ece21c570.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
在浏览器输入:localhost:4000 ,就可以进行访问,效果如下:
![](http://upload-images.jianshu.io/upload_images/1531909-4f9a111a4f87ff63.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
5、写文章
在E:\Hexo\source\_posts文件下,新建.md文件就可以写文章
![](http://upload-images.jianshu.io/upload_images/1531909-f369abde30af73e0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
---
title: 我的博客
---
![](http://upload-images.jianshu.io/upload_images/1531909-a55880ce3bb59600.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/1531909-3b9c7f217892c046.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1、申请Github账号,(注意别忘了进行账号邮箱验证)
2.new repository
![](http://upload-images.jianshu.io/upload_images/1531909-8decffce7d3866b3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/1531909-d3da80e668341305.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
然后点击
![](http://upload-images.jianshu.io/upload_images/1531909-fe29bad673d85f37.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3、在_config.yml进行配置
![](http://upload-images.jianshu.io/upload_images/1531909-d0fc558c749b5569.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
4、安装hexo-deployer-git自动部署发布工具
npm instal lhexo-deployer-git --save
![](http://upload-images.jianshu.io/upload_images/1531909-fb7e657ad2729c88.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
5、发布到Github
输入如下命令:hexo clean && hexo g && hexo d
![](http://upload-images.jianshu.io/upload_images/1531909-72b3c30ffbfb1210.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/1531909-5fdbcdab2249c01e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/1531909-1f99441c5f2e0cfb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/1531909-eeae3f8de4041eff.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
6、测试访问
在浏览器输入:https://yanqiangmiffy.github.io/
![](http://upload-images.jianshu.io/upload_images/1531909-a771d32449cbd5c8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
作者:致Great
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。