I feel like I’m missing something simple. I have a slug setup for my posts like /posts/:year/:slug which works great. I can easily override the template used by the post in layouts/posts/single.html. The problem I cannot seem to figure out is how to create a template for the :year element. At the moment /posts/:year results in a generated 404.
I tried creating a year taxonomy to see if I could do it that way, but that did not seem to work either.
Again, just looking to create the template for /posts/:year and ideally use it to iterate over posts created during that year.
That worked! I didn’t even need to add any content in _index.md for it to start working, simply creating the files was enough for Hugo to render the page.