Fornax
Fornax copied to clipboard
Allow Generators specify their output path
Is your feature request related to a problem? Please describe.
Currently only MultipleId Generators are to be able to specify their output path while other generators have no idea where Fornax will actually put their output because the mapper is defined outside their scope.
Describe the solution you'd like
Add a new GeneratorOutput : GeneratorSpecified (or replace Custom with it) that allows use of generators with signature SiteContents -> string -> string -> string * string . Similar logic to MultipleFiles but with just one file.
Describe alternatives you've considered
Using MultipleFiles but with only one element.
Additional context
This issue came about when I wanted to add a bit of localization and discovered that I couldn't just add a file like say posts/post.md with a front matter containing lang : en and then have the generator output a file en/posts/post.html.
Sure I could just define a Custom mapper to do that but that's just duplicating loader logic into the config.
I'm not sure I see the reason to place this logic in the generator rather than in a custom handler in the config? I'm also not sure what you mean when you say you'd be copying loader logic?