Include Template Path in hydrogen.routes.js
See original GitHub issueIs your feature request related to a problem? Please describe.
I really like what hydrogen does. I’m looking to build a simple static site without client side rendering and there just aren’t options that will take a list of paths, data, and a template and render it to an HTML file.
Hydrogen is the closest things I’ve seen, the only thing it lacks is the ability to explicitly define the template to use… instead it falls back to _index.js in the folder of the routes defined in hydrogen.routes.js.
While this solution works, it doesn’t allow the user to use two different templates within the same folder of their site structure.
Such as having both /contact and /about.
Describe the solution you’d like Reading over how getPages.ts works, I believe it should be doable to allow users to explicitly define the template to use.
Something such as would work well:
{
path: "/blogs/setting-up-a-service-worker",
data: {
post: 2
}
template: "/path/to/template/"
}
This would allow the user to define their entire site in the hydrogen.routes.js file and then just worry about templates.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
I ended up deciding to roll my own solution to fix the specific use case I have. Thanks.
@nickreese Thanks for the clarification! That fits with what I was thinking as well. I will add this feature to the board for a future release 😄
Currently, I am planning on rebuilding Hydrogen for modularity