Hexo Setup GitHub Pages

Deploy to GitHub Pages

Creating a GitHub Pages site is quite simple. With a GitHub account, a <github-username>.github.io repository could be created.

Once GitHub Pages repository has been successfully created, the next job is to generate static files and deploy them to GitHub Pages reposity to host.

Change _config.yml:

_config.yml
1
2
3
4
5
6
7
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
- type: git
+ type: git
+ repo: https://github.com/comilao/comilao.github.io.git
+ branch: master

Install plugin hexo-deployer-git:

1
npm install hexo-deployer-git

To deploy, run the following commands:

1
hexo g -d

You browser will open and you need to authorize the action in order to deploy generated static files to GitHub Pages repository.