Hey there, so am fairly new to Hugo although not new to static site generation. Still, am finding that I feel like I’m working “against” Hugo rather than with it as if I’m missing something obvious.
What I’m trying to do is let’s say I have a bunch of product pages. Each product page has basically the same template, broken into sections. So that when I generate the site, if I have product A, B, C - for each product A, B, C it will generate a page that has the relevant sections filled in with the content that relates to the respective product.
Reading through the docs, it seems like perhaps a way to go about it would be:
- Create a page template for a product (and I guess have like a base… archetype for this page, is that the right approach?) I feel like there should be a way to create a generic template for the product page, and then for any products that exist, it uses this to be to master page template?
- Create sections for each of the sections on that template? So like, Description, Alerts, Support - whatever…?
- Then, create docs within each section for each product, and tag them with the product name or ID or something so that it knows what to populate each section with per product?
I dunno, this all seems convoluted to me, and am not really understanding the relationship between templates and the content that goes in them? I’ve read through the docs and looked for tutorials, but haven’t found anything that addresses a situation similar to this, but this seems like a really obvious use case for static site generation and that it should be straightforward?
In my head it looks like:
++—> Product Relevant Content for Section 1
- —> Section 2
++ —> Product Relevant Content for Section 2
And then the final site has X number of instances of that Product template, where X is the number of products. I feel like there’s just one piece missing or something to understand how to fit it all together, or like I’m thinking about it not quite right.
Any help much appreciated!