Gittu's Blog

Yet another octopress blog

Site Version Plugin for Jekyll/octopress

| Comments

Disclaimer: I dont know ruby. Not even know how to print hello world. So dont blame me for using bash [tongue-out]

Check my site's footer. You'll see a site version ####. What is it ? Its just a fancy jekyll plugin i created that shows a version based on git commit. Everytime you add a new commit to your site source, the version increases.


Q: Why need it ?

A: It looks cool. It gives me internal peace of mind. Moreover If you publish your site in places like github pages, from version you can check if your site is deployed yet.

Installation

  1. Get getversion.rb and place it in your plugins folder.
  2. Now open any layout and add {% get_version %} in it. Example: I added it in my _includes/custom/footer.html

    <span class="credit">site version {% get_version %}</span>
    
  3. Since it works based on git, you need a git tag to generate a version number. If you dont have any git-tag yet, create a new tag. Note that tag name will be used as prefix in the version. To create a tag named MySite

    git tag -a MySite
    
  4. Now regenerate your site using rake generate and you are done.

Let me know how much you like this plugin [smile]

Comments