-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Background, currently
write_contenthandles minification.- zola follows the pretty url pattern of generating
foo/index.htmlforfoo. So a file generated for/vcards/wikidata/Q136086504.vcfends up creating/vcards/wikidata/Q136086504.vcf/index.htmlviawrite_content
At that that point that write_content is called it only knows the destination it's generating. It doesn't know anything about the input. So in the above example, it sees it is generating an index.html. This means something like .txt and ical generation is all a hack based on the above..
Ideally, the rendering step would handle minifcation, because it knows what template extension is being used. If the template is .html we know to minifiy.
Attached is a patch that proposes we change this, putting magnification into the rendering step. This isolates write_content the IO step.
I will supply a patch to handle this. This will allow you to generate anything with minifiy_html set to true, so long as the page's template is .txt or anything *ml. This may have even been the original design intent of the minification patch.