Implement pre and post for menus.
https://gohugo.io/content-management/menus/
This commit is contained in:
parent
0a10286c19
commit
21221ad721
@ -3,6 +3,7 @@
|
||||
<nav class="nav nav-bottom"{{- with .Site.Params.aria.menu_bottom }} aria-label="{{ . }}"{{- end }}>
|
||||
<ul>
|
||||
{{- range .Site.Menus.footer }}
|
||||
{{ with .Pre }}{{ . }}{{ end }}
|
||||
<li>
|
||||
{{- if .URL }}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
@ -10,6 +11,7 @@
|
||||
{{ .Name }}
|
||||
{{- end }}
|
||||
</li>
|
||||
{{ with .Post }}{{ . }}{{ end }}
|
||||
{{- end }}
|
||||
{{- with .Site.Home.OutputFormats.Get "RSS" }}
|
||||
<li>
|
||||
|
@ -8,13 +8,15 @@
|
||||
<ul>
|
||||
{{- $curr := . }}
|
||||
{{- range .Site.Menus.main }}
|
||||
{{- if .URL }}
|
||||
{{ with .Pre }}{{ . }}{{ end }}
|
||||
<li{{ with .Params.class }} class="{{ . }}"{{ end }}>
|
||||
{{- if .URL }}
|
||||
<a href="{{ .URL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Name }}</a>
|
||||
{{- else }}
|
||||
<li>{{ .Name }}</li>
|
||||
{{- end }}
|
||||
</li>
|
||||
{{- else }}
|
||||
{{ .Name }}
|
||||
{{- end }}
|
||||
{{ with .Post }}{{ . }}{{ end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
</nav>
|
||||
|
Reference in New Issue
Block a user