0

Does jekyll build provide a hook which I can use to gzip each .html file in the _site directory? I'd like to have a corresponding example.html.gz file to an example.html file.

I would write a wrapper script in case there is no hook. I just want to be sure to make it in the cleanest way possible.

wintermeyer
  • 8,178
  • 8
  • 39
  • 85

1 Answers1

1

There is no hook in jekyll build. The only way to generate additional content is to write a generator plugin.

If your goal is to serve the gzipped version of you pages, you must know that github pages already serves gzipped html, css and js.

David Jacquel
  • 51,670
  • 6
  • 121
  • 147
  • http://jekyllrb.com/docs/plugins/#generators says "Generators run after Jekyll has made an inventory of the existing content, and before the site is generated." So I can't use it for this. – wintermeyer Aug 28 '14 at 17:10
  • 1
    Of course you can. The inventory is in memory and all pages datas are available. You just have to loop in the collection, get the rendered content, gzip and save your page.html.gzip. That's less than 20 lines of code. – David Jacquel Aug 28 '14 at 22:52