Ensuring permalinks are 'choppable'

I’m new to Hugo, so I’m still figuring a lot of stuff out.

I have this in my config.toml file to make nice URLs for a my blog posts:

  blog = "/blog/:year/:month/:title/"

Works great. An example URL would be http://localhost:1313/blog/2017/11/welcome/.

Now, I want my URLs to be choppable, meaning, I want these URLs to work too:

  • /blog/2017/11/
  • /blog/2017/

I tried to manually create a folder /layouts/blog/2017 and /layouts/blog/2017/11 and put my list.html template there. What’s a recommended best practice to make this work?


That’s useful only if you want a different layout for these list pages.The template under /layouts/_default/list.html controls all list pages. This will not make your content available under the “choppable” URLs you mentioned.

To make these URLs work, you will need to re-organize your content (hint: you need to replicate your permalink as a folder path).

Use the forum search box to find info about Nested Sections. The official Docs have no info about this feature yet. It was introduced in Hugo 0.22 and there is very useful information about Nested Sections in the forum. If you need further assistance ask here.