Content Structure A:
content/
page1.md
page2/
index.md
page3.md
Content Structure B:
content/
page1.md
page2.md
page2/
page3.md
My menu code:
<ul>
{{ $currentPage := . }}
{{ range .Site.Menus.docs }}
<li class="{{if or ($currentPage.IsMenuCurrent "docs" .) ($currentPage.HasMenuCurrent "docs" .) }}menu-active{{end}}">
<a href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
{{ if .HasChildren }}
<ul>
{{ range .Children }}
<li class="{{if ($currentPage.IsMenuCurrent "docs" .)}}menu-active{{end}}">
<a href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
page3.md frontmatter:
---
title: "Page3"
menu:
docs:
title: "Page3"
weight: 10
parent: "Page2"
---
I can only get the menu working as intended (showing sub menus of child pages) with content structure B. But isn’t this incorrect?
Been trying to figure this out with the docs for the past hour. Help is needed.