Hello everyone! New Hugo user here
I am struggling to understand how the parent-child relationship between content files is established. I read through the documentation and the board, but I couldn’t find a thorough explanation anywhere.
I am trying to create a simple menu with sub-menus, and I am using the example provided here. However, I cannot manage to get sub-entries, and everything is rendered as part of the main menu. It seems that the {{ if .HasChildren }}
check always fails in the template I am creating, thus I suppose the parent-child relationship between content entries is not correctly established.
At first I was expecting that it would simply be extrapolated from the folder hierarchy, but it doesn’t seem to be the case. Here’s the folder structure I am using:
content [folder]
portfolio [folder]
entry1.md
entry2.md
I am trying to obtain a “portfolio” entry an the “entry1” and “entry2” sub-entries. From the documentation it seems that I have to express such relationship in the frontmatter of each entry (weird, shouldn’t it be straightforward from the folder structure?) and I wrote parent : "portfolio"
in the entries frontmatter. Still, it doesn’t work.
Can someone with a bit more experience please enlighten me on how to properly express such relationship?