Hexo & Theme Usage

Hexo, documentation, troubleshooting, GitHub Issues.

Hexo

Install & Setup

1
$ npm install -g hexo-cli

Initialize

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

File Structure:

1
2
3
4
5
6
7
8
9
10
|-- _config.yml # configuration file for hexo
|-- source
|-- _posts
|-- one_blog.md # blog file
|-- _drafts
|-- one_draft.md # draft file
|-- themes
|-- landscape # default theme
|-- ocean
|-- _config.yml # configuration file for ocean

Create a new post

1
$ hexo new "My New Post" / $ hexo n "My New Post"

More info: Writing

Run server

1
$ hexo server / $ hexo s

More info: Server

Generate static files

1
$ hexo generate / $ hexo g

More info: Generating

Deploy to remote sites

1
$ hexo deploy / $ hexo d

More info: Deployment

Deploy to github

1
$ yarn add hexo-deployer-git

Then, go to hexo’s _config.yml, add this to deploy session:

1
2
3
4
deploy:
type: git
repo: https://github.com/xyshell/xyshell.github.io.git
branch: master

Theme

Install & Setup & Update

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

Modify theme setting in hexo’s _config.yml to ocean:

1
theme: ocean

Further update:

1
2
cd themes/ocean
git pull

Theme Reference

Ocean

https://github.com/zhwangart/hexo-theme-ocean

Minos

https://github.com/ppoffice/hexo-theme-minos