Site area without autogenerated listing?

Hello,
I’m rather new to Hugo, and am doing test runs on site creation locally to get to grips with things.
Let’s say I have a site with a few files like:

posts/my_first_post.md
posts/another_post.md
posts/evenmore_post.md
about.md

This makes for a site with a structure of
posts/my_first_post/
posts/another_post/
posts/evenmore_post/
about/

And if you view /posts/ you get a listing of all the blog posts in a kind of directory.

Now my question is - what if you wanted to have a non-blogging section or something without a listing? Maybe a static docs directory, maybe standalone feature articles etc.

Something like
posts/my_first_post/
posts/another_post/
posts/evenmore_post/
about/
feature_articles/squares/
feature_articles/pyramids/
round_features/sphere/
round_features/torus/

Assuming the feature articles are built from squares.md,pyramids.md etc.
Is there any way to tell Hugo to not build a listing for a specified subdirectory? Ie I want a visitor to feature_articles or round_features to not see a listing, but perhaps a default page for that section? As far as I can tell putting an _index.md in the directory customises the text that appears for the list, not blocks it.

I’ve looked in the docs but can’t see anything on this topic. Perhaps I missed it?

You can turn off the creation of a Section list with Build Options

Right, so as far as I can tell, there’s not so much a direct way to turn off creating a Section list itself, but if you add

Summary

_build:
list: never

to the front matter of all items in that directory, Hugo won’t find anything to make a list with and thus will not generate it? And if you make an _index.md with front matter including

Summary

cascade:
_build:
list: never

That effectively causes the front matter of everything in the directory to have that list:never applied.
Am I getting this correct?

Yes, this is how it is supposed to work, if you combine it with cascade.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.