Create blog with Hexo on Git Page

After several comparison, I choose to use Hexo to build my personal blog. And for simplicity, I decide to use Github Page to host my blog.

Basically, you need to maintain two git repositories. One for Hexo itself, and another for the generated static files. The second is needed as Github Page requires its content to be push to a repository of certain name.

generate static files

1
hexo generate

Copy generated files to the deploy folder (to be pushed to github)

1
2
3
# the first folder is where static files generated 
# You may need to also add the "-n" option to perform a dry run to see the changes in advance.
rsync -avzh --delete --exclude '.git' <SOME_PATH>/blog/public/ <SOME_PATH>/blog_deploy/

rsync usage reference