Hello all, I am trying to create a website using Hugo that has a collapsible navigation bar that mimics a structure similar to this:
- Getting Started
- Building an App
Is it possible to dynamically generate the sub-directories? Or do I have to hard code for each group?
I am following this example to render my indexes:
<ul>
{{ range $indexname, $index := .Site.Indexes }}
<li><a href="/{{ $indexname | urlize }}">{{ $indexname }}</a>
<ul>
{{ range $key, $value := $index }}
<li> {{ $key }} </li>
<ul>
{{ range $value.Pages }}
<li hugo-nav="{{ .RelPermalink}}"><a href="{{ .Permalink}}"> {{ .LinkTitle }} </a> </li>
{{ end }}
</ul>
{{ end }}
</ul>
</li>
{{ end }}
</ul>