Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Generators specify their output path #89

Open
oluwandabira opened this issue May 26, 2021 · 1 comment
Open

Allow Generators specify their output path #89

oluwandabira opened this issue May 26, 2021 · 1 comment

Comments

@oluwandabira
Copy link
Contributor

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.

@drewknab
Copy link
Contributor

drewknab commented Jun 7, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants