Hey Jekyll folks.
We're trying to integrate a build process that compiles less files into CSS.
What we came up with is to add a step into the Jekyll::Site class.
# Special build process, the Makefile uses `lessc <file.less> <output.css>`
system("make build", :chdir => self.config['destination'], :out => :err)
We use Jekyll to generate the Less files themselves (looping through a list of icons). Because of this we have to wait until after the write method is called.
What we have works, but it would be great to have a more "blessed" approach to this. I was going to write a plugin to do it but couldn't figure out how to wait until after the files were written.
Is there a better way?
For example, if I could write a plugin and do this it would fill me with joy:
# Do build stuff here
Whoops click happy
Heyo! This is a splendid idea. The extra code would behave as normal plugins and not be executed on GitHub Pages, but there is no reason we should force anyone to monkey-patch Site#process to implement a build feature.
I'd love to get the thoughts of the venerable @mattr-, @benbalter, and @dhcole.
I'm cool with this. I was just reading about hook methods in Sandi Metz's POODR book and was thinking something like this would be useful
How would you envision it? Should plugins have access directly or should plugin authors have to monkey-patch a method intentionally left blank? It would cool if plugins could just hand us procs or something:
We should also come up with a way for plugins in a gemfile to be picked up rather than requiring that something be placed in plugins/.
👍 for something like Jekyll.after_build
Jekyll 3.0 is entirely hook-based, so this will work once that's finished.