Cleans up the code sample

- Invalid markup
- Removed extra unecessary classnames to make example clearer
- Consistent tabbing
This commit is contained in:
Oz Ramos 2018-01-19 00:53:27 -08:00 committed by Bjørn Erik Pedersen
parent c231c9bd57
commit 84622e67c8

View File

@ -27,40 +27,35 @@ 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>
<div id="sidebar" class="nav-collapse"> <ul>
<!-- sidebar menu start--> {{ $currentPage := . }}
<ul class="sidebar-menu"> {{ range .Site.Menus.main }}
{{ $currentPage := . }} {{ if .HasChildren }}
{{ range .Site.Menus.main }} <li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
{{ if .HasChildren }} <a href="#">
{{ .Pre }}
<li class="sub-menu{{if $currentPage.HasMenuCurrent "main" . }} active{{end}}"> <span>{{ .Name }}</span>
<a href="javascript:;" class=""> </a>
{{ .Pre }} <ul class="sub-menu">
<span>{{ .Name }}</span> {{ range .Children }}
<span class="menu-arrow arrow_carrot-right"></span> <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
</a> <a href="{{ .URL }}">{{ .Name }}</a>
<ul class="sub"> {{ end }}
{{ range .Children }} </ul>
<li{{if $currentPage.IsMenuCurrent "main" . }} class="active"{{end}}><a href="{{.URL}}"> {{ .Name }} </a> </li> {{else}}
{{ end }} <li>
</ul> <a href="{{.URL}}">
{{else}} {{ .Pre }}
<li> <span>{{ .Name }}</span>
<a href="{{.URL}}"> </a>
{{ .Pre }} {{end}}
<span>{{ .Name }}</span> {{end}}
</a> <li>
{{end}} <a href="#" target="blank">Hardcoded Link 1</a>
</li> <li>
{{end}} <a href="#" target="blank">Hardcoded Link 2</a>
<li> <a href="https://github.com/gohugoio/hugo/issues" target="blank">Questions and Issues</a> </li> </ul>
<li> <a href="#" target="blank">Edit this Page</a> </li>
</ul>
<!-- sidebar menu end-->
</div>
</aside> </aside>
<!--sidebar end-->
{{< /code >}} {{< /code >}}
{{% note "`absLangURL` and `relLangURL`" %}} {{% note "`absLangURL` and `relLangURL`" %}}