vjeantet / hugo-theme-docdock

Declination of @matcornic Learn theme to Hugo
https://docdock.netlify.com/
MIT License
583 stars 316 forks source link

Create _index.md inside each folder and sub-folders #141

Closed bhutiyakishan1 closed 5 years ago

bhutiyakishan1 commented 6 years ago

Hi there, I dont know if its an issue or not,it might be a simple question to you but i have been trying to figure out since a day ! I am using your theme and i have a lot of folders and subfolders,now i came to realize that in order to show the content on webpage,you need to have _index.md inside every folder...and i literally have more than 100 folders! Is there a way to solve it without having to create _index.md for every folder? Thanks!

eyoder commented 6 years ago

You can rename one of the existing files in each folder to _index.md. Just choose the file you want to be the “landing” page for each folder. The tradeoff is that you’ll lose the automatically-generated Content section list.

bhutiyakishan1 commented 6 years ago

@eyoder @vjeantet i mean how do i show the name of all files on sidebar as heirarchy without having to put title on front matter of each file and _index.md on each folder?Is there a way that it can create its own heirarchy based on the folder's /subfolder's name on the sidebar?

eyoder commented 6 years ago

As far as I know, you need the title in the frontmatter - that's what will appear in the menu. If you want to see a demo of the Content section list, see: https://aventurine.netlify.com/. The repo is here: https://github.com/eyoder/aventurine (apologies - just updated the site to have the test/_index.md files)

eyoder commented 6 years ago

Apologies - I just broke it...I'll have to pick this up later.

Pilskalns commented 5 years ago

Hi,

Sounds like the issues is not really in the theme itself. The content structure is a requirement by design from the Hugo.

You could use some scripting language/shell/PS/cmd to copy those files, even as pre-processing before build, if that's the case.