vjeantet / hugo-theme-docdock

Declination of @matcornic Learn theme to Hugo

Home Page:https://docdock.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create _index.md inside each folder and sub-folders

bhutiyakishan1 opened this issue · comments

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!

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.

@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?

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)

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

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.