bdkjones / Kit

The Kit Compiler, as implemented in CodeKit
77 stars 6 forks source link

Kit: Import entire folder? #18

Open treyseals opened 6 years ago

treyseals commented 6 years ago

Is it possible to import an entire folder or html files ala <!-- @import "includes/*" --> like SCSS?

This would be extremely helpful for templated systems that have variable # of includes / files.

bdkjones commented 6 years ago

It’s not currently possible to do glob imports in Kit. It’s not possible in strict Sass either; the official language spec rejected the idea because of all the problems it can introduce. It’s only available as a Sass plugin (which CodeKit implements). I’m not opposed to the idea, but I’d have to implement it

Sent from my iPhone

On Jan 23, 2018, at 12:54, Jeff Seals notifications@github.com wrote:

Is it possible to import an entire folder or html files ala like SCSS?

This would be extremely helpful for templated systems that have variable # of includes / files.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

treyseals commented 6 years ago

That would be awesome @bdkjones . For now, I've setup a hook that produces the desired result, but a CodeKit implementation would be perfect.

Path from project root contains: ".inc.kit"

input_folder=$CK_INPUT_PATH
input_folder=${input_folder%/*}/*.kit

output_folder=$CK_OUTPUT_PATH
output_folder=${output_folder%/includes*}/inc_compiled.html

cat $input_folder > $output_folder