Fornax icon indicating copy to clipboard operation
Fornax copied to clipboard

Allow Generators specify their output path

Open oluwandabira opened this issue 4 years ago • 1 comments

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.

oluwandabira avatar May 26 '21 15:05 oluwandabira

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?

drewknab avatar Jun 07 '21 15:06 drewknab