Hexo X Github

Build blog with Hexo and Github

In this article, I’m going to talk about how to build your own Blog with hexo and github


Platform: Linux | windows | mac

HexoSitePage

What’s you need:

  1. A github account
  2. nodejs installed
  3. git installed

Step one

Build a repos on Github named by “username.github.io”

Step two

Install hexo on your local pc

1
$ npm install hexo-cli

Execute the following commands on your local pc

1
2
3
4
$ hexo init <Fold_Name>
$ cd <Fold_Name>
$ npm install hexo-deployer-git --save
$ git init

Step three

Then push the local repository to remote repository on Github with the commands

1
2
$ git remote add origin $repos_address
$ git push --set-upstream origin master
Some hexo commands

1. Generate static file

1
$ hexo g(enerate)

2. Start the local server

1
$ hexo s(erver)

3. Deploy your website

1
$ hexo d(eploy)

4. Create a new post

1
$ hexo new [post|page|draft] "Post_Name"

Hexo X Github
https://dtover.github.io/2020/04/19/Hexo-X-Github/
作者
John Doe
发布于
2020年4月19日
许可协议