Hexo Blog

Hexo 博客的搭建

参考:

安装前提

  • Node.js
  • git

npm install -g hexo-cli

建站

1
2
3
$ hexo init <folder>
$ cd <folder>
$ npm install

配置

__config.yml
详细配置

nexT主题安装

1
$ git clone https://github.com/theme-next/hexo-theme-next themes/next

theme: next

1
2
# 启动本地服务器,预览
$ hexo s

部署

1
2
3
4
5
6
7
# 推送到 dev远程分支
$ git push origin dev

$ git checkout -b branch-name origin/branch-name

# 删除分支
$ git branch -d (branchname)

__config.yml
部署到主分支

1
2
3
4
5
deploy:
type: git
# repo: https://gh_token@github.com/Scott-feng/scott-feng.github.io.git
repo: git@github.com:Scott-feng/scott-feng.github.io.git
branch: master

1
2
3
$ hexo clean 
$ hexo g
$ hexo d