1、下载安装Githtml
下载地址:https://gitforwindows.org/node
2、下载安装node.js
下载地址:https://nodejs.org/en/git
3、安装hexo
利用 npm 命令便可安装。
一、在任意位置点击鼠标右键,选择Git Bash
二、输入命令:npm install -g hexogithub
4、初始化Hexo
一、建立文件夹
二、在Hexo文件下,右键运行Git Bash,输入命令:hexo init
三、获取其余主题
git clone https://github.com/iissnan/hexo-theme-next.git themes/next
四、在_config.yml,把theme的值修改为刚下载的next
theme: nextweb
5、本地浏览博客
hexo g # hexo generate 生成静态页面至public目录
hexo s # hexo server #开启预览端口,本地访问npm
6、部署到Github上
一、申请Github帐号(注意别忘了进行帐号邮箱验证)
二、建立新创库: 用户名.github.io
三、在_config.yml进行配置
deploy:
type: git
repository: git@github.com:martin1317/martin1317.github.io.git
branch: masterwindows
四、安装hexo-deployer-git自动部署发布工具
输入命令:npm instal lhexo-deployer-git --save
五、发布到Github
输入命令:hexo clean && hexo g && hexo dhexo
7、经常使用命令
hexo new "postName" #新建文章
hexo new page "pageName" #新建页面
hexo generate #生成静态页面至public目录
hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy #部署到GitHub
hexo help # 查看帮助
hexo version #查看Hexo的版本工具
8、直接建立md格式文件写内容
前面建立的文件夹\source\_postspost
原文地址:https://www.jianshu.com/p/189fd945f38f
http://blog.haoji.me/build-blog-website-by-hexo-github.html?from=xa#zhun-bei-gong-zuo