Instantly share code, notes, and snippets.

What would you like to do?
# An example Jekyll generator. Utilizes the new plugin system.
# 1. Make a _plugins directory in your jekyll site, and put this class in a file there.
# 2. Upon site generation, version.html will be created in your root destination with
# # the version of Jekyll that generated it
module Jekyll
class VersionReporter < Generator
safe true
def generate(site)["destination"], 'version.html'), 'w') do |f|
def generate_report(site)
"Site generated with Jekyll version: #{Jekyll::VERSION}"

This comment has been minimized.

philcryer commented Oct 15, 2013

This is a plugin I'd like to use, I put it in my _plugins directory, but it doesn't work; although other plugins - rss_generator.rb, sitemap_generator.rb - both work. I'd like to extend this and add a version number I generate when I build the site, which will also be used in the tag when a post_hook checks it into git. Can you tell me if anything has changed with jekyll to break this plugin? Running jekyll with -t (trace) tells me nothing. Thanks


This comment has been minimized.

smileprem commented Oct 25, 2013

Me too having the same problem.. this plugin does not run. :(


This comment has been minimized.

pauldancepowerorg commented Jan 18, 2014

Changing the site.config["destination"] to site.source fixed this for me.


This comment has been minimized.

neikvon commented Dec 30, 2014

create version.html in your root develop folder , fixed.
Jekyll version: 2.5.3


This comment has been minimized.

MertcanGokgoz commented Aug 12, 2016

this plugin does not run for me

jekyll 3.1.6 | Error:  No such file or directory @ rb_sysopen _site/version.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment