We’ve got a requirement to render the same markdown to 2 or more different html files.
The basic idea is the main webpage.html is generated as usual, and then we have a print friendly template that will render another.html file.
I can also see this being needed for other types of specific targets like mobile or screen reader layout etc.
Is it possible to do this with Zola as it stands? I can only think of trying to use a taxonomy to try and do this, but this would result in the output being separated and having to coerce the paginator to get what I want.
Ideally I would like to just provide a list of templates in the section.md or page.md and if Zola see’s multiple templates need processing it just loops through them, generating the output to the same directory.
Something like this in my article.md markdown:
template = [“article.html”, “article_print.html”]
With both these templates in the \templates directory as you would expect.
Clearly there might be issues, for example with the slug but in principle is something like this worth including in Zola?
If it ever becomes possible I would expect all the templates to render to the default html path for the content being processed. I.e. the output would render to the same path. The slug conflict is more problematic.
Still not solved completely, I also have the problem of paths being splitted but i found a different way without using taxonomies. I write it here, hoping it can help other people.
I’m keeping two subfolders, which share the same .md files, but they use a different template. In order to not having to keep them in sync manually, the files of the second folder are actually hard links to the ones of the first folder.
Symbolic links seems to be ignored by zola, but it works using hard links.