Creating a projects list

I have a Hugo blog, showing a list of blog posts. I want to add a projects listing page. I created a data/projects directory and added my projects as .yaml files. I created a partial template for each of them. I know I can use

{{ range $.Site.Data.projects }}
{{ partial “project.html” . }}
{{ end }}

to render all the projects. My question is, how do I define a template for a URL say /projects that will use this snippet?

I imagine I have to create something like projects.html and put it in the layout folder of my current theme, but how do I tell Hugo do to use this template to render content requested at /projects ?

You could create a /projects/ folder in your /content/. Hugo will take this as a new section. Then in your layouts/partials/sections/projects.html file, you can put your list template logic from above. At least, I think this is what you’re asking for.

This does not seem to be working, getting a 404 message.

So the trick is not only to create a content/projects directory but to also but any .md file there so the section gets generated.

Then I had to put the template into themes{theme}\layouts\section as projects.html.

Ah, sorry. I was assuming the md files for each of the projects would go in there as well. Glad you figured it out.