Steps
- node.js&&git
- $ npm install -g hexo
- hexo init//(some folder ,for example:D:/hexo)
npm install
Local Test:
hexo generate
hexo server
then u can goto http://localhost:4000 - have a github id ,and new a repository(like this youName.github.io )
- 编辑_config.yml(在D:\hexo下)
deploy:
type: github
type: git //我用这个
repository: https://github.com/youName/youName.github.io.git
repository: git@github.com:youName/youName.github.io.git //我用的这个
branch: master
注意::后面一定加个空格!
5.
$ npm install hexo-deployer-git –save
hexo generate
hexo deploy
参照:https://hexo.io/docs/deployment.html
最新版的hexo貌似要在第一次hexo d的之前,要有npm install hexo-deployer-git –save
6.
goto:https://yourName.github.io
it works!hah~
7.
some benefits
hexo g == hexo generate
hexo d == hexo deploy
hexo s == hexo server
hexo n == hexo new - clone themes
进入hexo官网,预览自己想要的主题, https://github.com/hexojs/hexo/wiki/Themes
for example:
D:/hexo/themes ,git bash
git clone https://github.com/hexojs/hexo-theme-light.git
cd themes/light
git pull