June 11, 2016

cryogen based static site on github

Github Pages are a good way to host your own blog. Jekylly is the de-facto standard of achieving this. but being a Clojure guy, i wanted to find something to achieve the same using Clojure. and find i did => Cryogen.

Cryogen does have a "deploying-to-github-pages" documentation. the Cryogen docs suggest that you push the "public" directory to github gh-pages

however, i'd like to store both the source (.md files, images, etc) and the generated static content (.html files) on github. in order to do this, i have a different setup that i'd like to share with you

one time setup steps

  • create cryogen project as shown here
lein new cryogen my-blog
cd my-blog
~/my-blog $ lein ring server
  • add pages/posts to ~/my-blog/resources/templates/md/
  • "lein ring server" will automatically generate static site whenever a new post/page is added/edited
  • add the "resources/templates/public/" to github account as is suggested in the Cryogen docs here
  • add the "resources/templates/md/" to another github account as backup of your blog source

this approach has the following benefits

  • backup blog source (that you can move easily from 1 machine to another)
  • store generated static files that will be served by github pages
  • upgrade cryogen without it conflicting w/ existing source
Tags: cryogen github clojure static-site