I’m new to Hugo and Hugo Templates.
I’m trying to learn how to make templates in hugo for NetlifyCMS.
I’ve set up NetlifyCMS to create some md files with data in the frontmatter. If I visit the url which I expect my template to load on, I get a different template.
My question:
Is there an easy way to find which template is currently being used? By showing the template name or location in the frontend somehow? How do people generally debug routing / template problems?
I don’t fully understand how to change the templates to show their locations, so I think I will give that a miss for now. If I can get one template to work, I will be able to follow the docs.
I’ve tried everything I can think of to get a template to show for my gallery content, and nothing works.
My gallery content is in /site/gallery not /site/content/gallery/, could that be the problem?
I can understand how templates work in general by looking at examples, but I can’t find any definitive rules for the way I have my gallery collection.
I’d be so grateful if you could have a peek at my repo above and could let me know where I need to place a template and what I need to call it to get it to load at this url: domain.com/gallery/gallery1/ or domain.com/gallery1 .
Hi Rik,
I looked at your repo. I’ve no experience with Netlify but I could see your site with hugo server. Good, that you’re working with Tachyons.
If you want to see which template is used just make a temporary remark in all templates like <h1>This is template gallery.html</>. If you want to dedicate a specific template to a page you can use Front Matter. I described this in my post My experiences with Hugo's template lookup order in the different layout variants.