carpentries / carpentries-hugo-theme

Hugo theme to be used for The Carpentries website
MIT License
0 stars 0 forks source link

How does Hugo handle sections without _index or index file? #25

Closed maneesha closed 3 weeks ago

maneesha commented 1 month ago

Example Carpentries site build from this repo.

Some folders have an _index.md file. Some folders do not, but an index page gets generated anyways.

Example: workshops folder has _index.md. As expected, this renders to this page. However, host folder does not have an index page, and it renders to a blank page called Hosts (plural).

regisphilibert commented 1 month ago

By default, any root folder beneath /content with children md is considered a section and generate a landing page for that section. Title is infered from the directory name. (by pluralizing it)

Adding a _index.md in the folder allow to add some front-matter information to the section's landing page, like your own title for example.

maneesha commented 1 month ago

@regisphilibert is it possible to disable that behavior so a landing page is not automatically generated?

regisphilibert commented 3 weeks ago

You're going to have to create a _index.md in the concerned directory with the following:

_build:
  render: never
  list: never
maneesha commented 3 weeks ago

Thanks!