Create _index.md inside each folder and sub-folders

Hello there,
I am creating a website with hugo where i have a lot of folders,sub-folders followed by markdown file!
From what i learned surfing through various issues was you need to have a _index.md file for each folder/sub folder and that _index.md file should have front-matter like ‘title’ in order to show it on the web page!

Now is there any way where i can show the nested folders and subfolders without having to create _index.md insides all the folders !I know i can definitely write a gulp task to automatically insert _index.md but i think hugo must be having a way to do it without create _index.md file!

Thanks!

You don’t need it.

  • Hugo will create the root sections, home page etc. even without the “_index.md”
  • For nested sections (e.g. /blog/funny-cats), you only need it in the bottom-most folders. There is no way around that. So /blog/funny/animals/cats/_index.md should create the tree.
1 Like

oh okay! Got it! I tried that but i think its the theme docdock which i am using ,it doesn’t allow you to show content without writing front matter and title in _index.md!
Anyways,thanks a lot!