[solved] How should I implement Product Pages?


I have used hugo to create a small website for my wife’s project. It is http://www.talkingwithrebecca.com/. She makes products that she sells on teachers pay teachers website.

I would like to add her product catalog to her website and I am trying to figure out what’s the best way to do it.

I could use “data” section, but I am not sure if “data” section is meant to handle 100+ items and an ever growing catalog.

Or should I create a custom page type of product type just like there is a blog type.

I certainly expect for each product to have its own single page and being able to search products on google.

I think the proper solution is probably a new page type. I have not spent a lot of time with hugo, so I am not 100% certain.

Thank you

Hugo will have no problem handling 100s of “items” in a data file.


This isn’t possible when it comes to pulling data files. Hugo looks to content files for this functionality.

Yes :smile:

Thank you for quick reply.

Products have a certain amount of structured data about them. How should I handle that?

Shall I create a custom meta data in content pages? Is that even possible?

What’s a good way to handle product specific images? Shall I create a per product carousel of images just like there is a carousel in universal scheme on the root page?

Yes, well…I think so, but I’m not entirely sure what you’re asking. Take a look at archetypes for quick scaffolding of new files with preconfigured metadata (i.e., front matter). You can add as much structured front matter as you’d like to individual content files.

This is really more a design question and is therefore outside of my wheelhouse. It also depends a lot on the type of product you’re selling, and this is a question that is probably better suited for a different forum. Sorry :frowning:

You should include all the structured data in layouts/_default/single.html or whatever directory your theme uses to store the template for individual post pages.

To keep things clean, you will need to specify a parameter on each product post’s frontmatter
e.g. product = "true"

And wrap all the elements that you need for product posts within
{{ if isset .Params "product" }}
html, meta data and structured data
{{ end }}

There are really no limits to what you can achieve with Hugo.

Thank you

I think I got a good picture on how to handle it.

I did some work on product page type and to my surprise was able to get quite far. I can certainly agree with statement that hugo is powerful.

I think the most difficult part was to display a list of items that belong to a tag and of type “blog” and product “material”. While I got it working, I don’t think it is documented and as such is not that obvious.

1 Like

What theme did you use? I really like your theme, you’ve probably added a lot to it. Any chances of making it available?