Main menu: add pre/post properties support
This commit is contained in:
parent
6204d3ef0d
commit
f184b72d8d
1 changed files with 10 additions and 3 deletions
|
@ -11,8 +11,15 @@
|
|||
<ul id="menu" class="main-nav__list{{ if eq .Site.Params.mainMenuAlignment "right" }} main-nav__list--right{{ end }}">
|
||||
{{- $currentNode := . }}
|
||||
{{- range sort .Site.Menus.main }}
|
||||
{{- $current := (or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .)) }}
|
||||
{{- if .Name }}
|
||||
<li class="main-nav__item{{ if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }} main-nav__item--active{{ end }}">{{ if or ($currentNode.IsMenuCurrent "main" .) ($currentNode.HasMenuCurrent "main" .) }}{{ .Name }}{{ else }}<a class="main-nav__link" href="{{ .URL }}">{{ .Name }}</a>{{ end }}</li>
|
||||
<li class="main-nav__item{{ if $current }} main-nav__item--active{{ end }}">
|
||||
{{ if not $current }}<a class="main-nav__link" href="{{ .URL }}">{{ end }}
|
||||
{{ .Pre }}
|
||||
<span class="main-nav__text">{{ .Name }}</span>
|
||||
{{ .Post }}
|
||||
{{ if not $current }}</a>{{ end }}
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in a new issue