0%

Hexo tutorial

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Prepare environment

Install hexo

1
$ npm install -g hexo-cli

Initialize hexo blog

1
2
3
4
# if you don't given the <floder> parameter,the blog will initialize at current floder.
$ hexo init <floder>
# install npm dependencies
$ npm install

Install necessary plugin

1
2
# The plugin can transfer chinese title to Pingyin when you generate static post files.
$ npm i hexo-permalink-pinyin --save

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server # or hexo s

More info: Server

Generate static files

1
$ hexo generate # or hexo g

More info: Generating

Deploy to github pages service

  • Configuration the github repository
1
2
3
4
deploy:
type: git
repo: #youre github repository
branch: master # deploy branch
  • Deploy
1
2
3
4
# install git deploy plugin
$ npm install hexo-deployer-git --save
# deploy
$ hexo deploy #or hexo d

More info: Deployment