windows环境利用hexo+github搭建个人博客

一、下载安装Git

  下载地址:https://gitforwindows.org/

二、下载安装node.js
  下载地址:https://nodejs.org/en/

三、安装hexo
  利用 npm 命令即可安装。
  1、在任意位置点击鼠标右键,选择Git Bash
  2、输入命令:npm install -g hexo

四、初始化Hexo
  1、创建文件夹
  2、在Hexo文件下,右键运行Git Bash,输入命令:hexo init
  3、获取其他主题
    git clone https://github.com/iissnan/hexo-theme-next.git themes/next
  4、在_config.yml,把theme的值修改成刚下载的next
    theme: next

五、本地浏览博客
  hexo g # hexo generate 生成静态页面至public目录
  hexo s # hexo server #开启预览端口,本地访问

六、部署到Github上
  1、申请Github账号(注意别忘了进行账号邮箱验证)
  2、创建新创库: 用户名.github.io
  3、在_config.yml进行配置
    deploy:
    type: git
    repository: git@github.com:martin1317/martin1317.github.io.git
    branch: master

  4、安装hexo-deployer-git自动部署发布工具
    输入命令:npm instal lhexo-deployer-git --save
  5、发布到Github
    输入命令:hexo clean && hexo g && hexo d

七、常用命令
  hexo new "postName" #新建文章
  hexo new page "pageName" #新建页面
  hexo generate #生成静态页面至public目录
  hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
  hexo deploy #部署到GitHub
  hexo help # 查看帮助
  hexo version #查看Hexo的版本

八、直接创建md格式文件写内容
  前面创建的文件夹source\_posts

原文地址:https://www.jianshu.com/p/189fd945f38f
http://blog.haoji.me/build-blog-website-by-hexo-github.html?from=xa#zhun-bei-gong-zuo