mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-13 13:05:52 -04:00
Add missing closing tags for li in menu template example
Also: - "blank" -> "_blank" in target - Re-indent whole snippet for consistency - Do "{{ foo }}" instead of "{{foo}}" for consistency
This commit is contained in:
parent
f462b620f3
commit
000fed94e4
@ -28,34 +28,39 @@ The following is an example:
|
|||||||
{{< code file="layouts/partials/sidebar.html" download="sidebar.html" >}}
|
{{< code file="layouts/partials/sidebar.html" download="sidebar.html" >}}
|
||||||
<!-- sidebar start -->
|
<!-- sidebar start -->
|
||||||
<aside>
|
<aside>
|
||||||
<ul>
|
<ul>
|
||||||
{{ $currentPage := . }}
|
{{ $currentPage := . }}
|
||||||
{{ range .Site.Menus.main }}
|
{{ range .Site.Menus.main }}
|
||||||
{{ if .HasChildren }}
|
{{ if .HasChildren }}
|
||||||
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
|
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
|
||||||
<a href="#">
|
<a href="#">
|
||||||
{{ .Pre }}
|
{{ .Pre }}
|
||||||
<span>{{ .Name }}</span>
|
<span>{{ .Name }}</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="sub-menu">
|
</li>
|
||||||
{{ range .Children }}
|
<ul class="sub-menu">
|
||||||
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
{{ range .Children }}
|
||||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
||||||
|
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
{{ else }}
|
||||||
|
<li>
|
||||||
|
<a href="{{ .URL }}">
|
||||||
|
{{ .Pre }}
|
||||||
|
<span>{{ .Name }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
{{ end }}
|
||||||
{{else}}
|
|
||||||
<li>
|
<li>
|
||||||
<a href="{{.URL}}">
|
<a href="#" target="_blank">Hardcoded Link 1</a>
|
||||||
{{ .Pre }}
|
</li>
|
||||||
<span>{{ .Name }}</span>
|
<li>
|
||||||
</a>
|
<a href="#" target="_blank">Hardcoded Link 2</a>
|
||||||
{{end}}
|
</li>
|
||||||
{{end}}
|
</ul>
|
||||||
<li>
|
|
||||||
<a href="#" target="blank">Hardcoded Link 1</a>
|
|
||||||
<li>
|
|
||||||
<a href="#" target="blank">Hardcoded Link 2</a>
|
|
||||||
</ul>
|
|
||||||
</aside>
|
</aside>
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user