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

Hugo like archetypes #67

Open
robertpi opened this issue May 3, 2020 · 4 comments
Open

Hugo like archetypes #67

robertpi opened this issue May 3, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@robertpi
Copy link
Contributor

robertpi commented May 3, 2020

Is your feature request related to a problem? Please describe.
In Hugo archetypes are templates for .md files that will be created in the posts directory. They make it easy not new post, for example helping to structure the url consistently.

Describe the solution you'd like
Command line something like:

fornax newpost "Some thing very interesting" 

template would be kept in "archetypes"

I would be will to implement this, but wanted discuss the solution before starting.

@Krzysztof-Cieslak
Copy link
Member

This is interesting - Fornax itself is just an engine, all generation logic is in loaders and generators. So I'm not sure if it should add any hardcoded file templates - those may work for built-in blog template but may be totally useless when someone customizes their loaders.

A more interesting idea would be giving templates (like our blog template) a possibility of defining items that could be generated. So for example in Saturn repo I could add how-to or explanation item template and then use that in this particular repo.

@Krzysztof-Cieslak Krzysztof-Cieslak added the enhancement New feature or request label May 25, 2020
@drewknab
Copy link
Contributor

drewknab commented Jun 8, 2020

I do believe that’s how it’s implemented in Hugo. The archetypes are basically a file within a template that the cli duplicates. It would also probably be good to introduce an option to do something like fornax new $template

@drewknab drewknab mentioned this issue Jun 12, 2020
@recumbent
Copy link

I've dealt with this using a new-post script which I invoke with dotnet fsi new-post.fsx Some interesting new post - it seems to me that there is value in having a built in template solution if only because I felt the need to roll my own. More so if you want to broaden use

@robertpi
Copy link
Contributor Author

Yeah, seems like having a way for fornax to invoke a script similar to the one @recumbent wrote might be a good way to solve this? Or maybe invoking a script from fsi is good enough and it doesn't need to be put in fornax itself, perhaps just provide a example script with the template?

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

No branches or pull requests

4 participants