README

record the steps of building personal blog using hexo on mac

prepare

dependecies-list

  • git
  • node.js
  • npm
  • hexo

hexo-common-use

  • hexo init [destination] 对指定目录初始化,创建hexo目录,destination须为空目录,为指定则为当前目录
  • hexo new [docname] 新建文章
  • hexo new page [pagename] 新建页面

building

build-hexo

  • hexo初始化,这里建立blog目录: hexo init blog
  • theme目录放置主题,可在github上下载
  • 新建文章:hexo new HelloWorld
  • 生成静态文件:hexo g
  • 生成静态文件后部署:hexo deploy
  • 启动本地服务器:hexo server, 默认情况下为http://localhost:4000
  • 使用新主题时清除缓存文件:hexo clean

deploy-to-github-pages

  • 设置生成github pages
  • github常规配置:ssh等
  • 修改-config.yml,加入github.io信息
  • 安装plug: npm install hexo-deployer-git –save
  • 生成静态文件:hexo d -g

configuration-optimization

-------------The End-------------