Using hexo-theme-melody and Travis CI to build a beautiful hexo blog in a fast and with-version-control way.
Do all things on source
branch.
your-username.github.io
and git clone
to your computer.source/CNAME
or change its content to your own custom domain.source/_drafts/
and source/_posts/
folders._config.yml
in the root folder and the source/_data/melody.yml
(Follow the hexo-theme-melody-doc)..travis.yml
and .gitlab-ci.yml
for continuous integration build your blog. See this post for more information.For security, we should not publish our personal API keys on GitHub repo.
GH_TOKEN
GL_TOKEN
(only if you use GitLab)
Algolia search(only if you use Algolia)
See hexo-algoliasearch/lib/algolia.js
You need four environment variables: ALGOLIA_APP_ID
, ALGOLIA_API_KEY
, ALGOLIA_ADMIN_API_KEY
and ALGOLIA_INDEX_NAME
.
Configure them in Travis settings like below:
Write a post
$ hexo new post my-first-post
... writing...
deploy to the origin
./deploy.sh "Added: my first post"
or just
./deploy.sh
which is equivalent to
./deploy.sh "Updated: blog source"