Hello guys,
I have a working recursive menu, but there are two {{ end }} elements that I don’t understand. I can’t remove them - they are required. But I can’t make out - where are their beginnings? Please help. Thanks in advance.
<div class="menu">
<ul>
<li><a href="{{ .Site.BaseURL }}">{{ .Site.Params.home }}</a></li>
{{ range .Site.Menus.header }}
<li>{{ if .HasChildren }}
<a href="{{ .URL }}">{{ .Name }}</a>
<ul>
{{ range .Children }}
<li>
{{ if .HasChildren }}
<a href="{{ .URL }}">{{ .Name }}</a>
<ul>
{{ range .Children }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
{{ else }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
</li>
{{ end }}
{{ end }} <<<=== What is this related to? This is end of what?
</ul>
{{ else }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }} <<<=== What is this related to? This is end of what?
</li>
{{ end }}
</ul>
</div>
...