These instructions summarize how to compile and push your ruhoh blog to gh-pages.
- Add
base_path: REPO
inconfig.yml
, where REPO is the name of your project repo - Run
ruhoh compile
to compile your blog - Switch to your compiled blog:
cd compiled
- Preview your blog locally:
white_castle .
- Add your github username and project repo name to the makefile
- Run
make deploy
The approach taken in the makefile follows the principle that it is not a good idea to put generated files under version control. Here is what the makefile does:
- Switch to the repo subfolder in compiled.
- Initialize a git repository.
- Add all files to the repo
- Commit all files with the message "update blog"
- Push local master to the gh-pages branch of github, forcefully.
- Remove the .git folder.
- Switch back to the root folder.
If you use this makefile, your gh-pages
branch will always be generated fresh and hence will not store any of the history. The idea is to maintain the blog source under version control since the gh-pages
branch can be generated any time.
I definitely agree with this philosophy. It seems many people really do want the cleanless (coolness =P) of a username.github.com domain. So I'd have to agree it would be the best idea for ruhoh to officially support a clean way to push to and host on GitHub -- this is definitely a good start to that.
Thanks!