how to build your own blog website

Quick Start

Init Hexo Project

Hexo is a fast, easy blog framework

1
2
3
4
5
$ npm install hexo-cli -g
$ mkdir myblog
$ cd myblog
$ hexo init
$ npm install

Init Github page

1
2
3
Create a repository with username.github.io
Clone, add, commit , push your changes
Fire up a browser and go https://username.github.io

More info: Writing

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

Delpoy project to github

1
$ npm install hexo-deployer-git --save

Edit the _config.yml

1
2
3
4
5
deploy:
type: git
repo: https://github.com/username/username.github.io
branch: [branch]
message: [message]

Run delpoy command, then you can visit https://username.github.io

1
$ hexo deploy

More info: Deployment