Jekyll - How to approach asset processing (minification, spriting...)
Posted
by
Gromix
on Stack Overflow
See other posts from Stack Overflow
or by Gromix
Published on 2011-06-26T01:32:39Z
Indexed on
2011/06/26
8:22 UTC
Read the original article
Hit count: 338
I recently switched to Jekyll and I find the conversion pipeline works really well. However I'm stuck on which approach to take when the process is many inputs to one output (ex: concatenating CSS files, creating image sprites...)
I know several tools that can do it, that can be called either from the command line or in Ruby code directly. For ex:
My current solution is a few Jekyll plugins that call these tools. However, it has the following problems:
1. SASS files should be processed, then concatenated/minified
SASS->CSS is a Converter, and the concatenation is a Generator run on the output. Unfortunately generators are run first, which means the concatenation is always a step behind (I have to run the build twice)
2. Jekyll does not know about the source/output relationship
With converters, when I run Jekyll in server mode, if I change a SASS file it automatically runs the conversion to CSS. When dealing with concatenation/spriting, I haven't found a way to do the same. I end up having to run a "normal" Jekyll build (not server auto) to update the concatenated files and sprites.
Thanks for any ideas!
© Stack Overflow or respective owner