This commit is contained in:
Patrick Neff 2019-01-17 21:35:55 +01:00
parent 9668ac1c6b
commit 1e72fd7c0e
3 changed files with 16 additions and 5 deletions

View File

@ -52,6 +52,7 @@ googleAnalytics = "UA-12671637-1"
[[menu.footer]] [[menu.footer]]
identifier = "left" identifier = "left"
weight = -200 weight = -200
url = "#"
[[menu.footer]] [[menu.footer]]
identifier = "copyright" identifier = "copyright"
@ -63,6 +64,7 @@ googleAnalytics = "UA-12671637-1"
[[menu.footer]] [[menu.footer]]
identifier = "mid" identifier = "mid"
weight = -100 weight = -100
url = "#"
[[menu.footer]] [[menu.footer]]
identifier = "kontakt" identifier = "kontakt"
@ -75,6 +77,7 @@ googleAnalytics = "UA-12671637-1"
[[menu.footer]] [[menu.footer]]
identifier = "right" identifier = "right"
weight = 0 weight = 0
url = "#"
[[menu.footer]] [[menu.footer]]
identifier = "sitemap" identifier = "sitemap"

View File

@ -1,4 +1,6 @@
{{ .item }}
{{- $currentPage := .ctx -}} {{- $currentPage := .ctx -}}
{{- $link := .item -}}
{{- if (eq .item.Identifier "copyright") -}} {{- if (eq .item.Identifier "copyright") -}}
<li> <li>
<a href="{{ .item.URL }}"> <a href="{{ .item.URL }}">
@ -7,9 +9,11 @@
</li> </li>
{{- else -}} {{- else -}}
<li class="{{ if $currentPage.HasMenuCurrent .item.Menu .item }}active{{ end }}"> <li class="{{ if $currentPage.HasMenuCurrent .item.Menu .item }}active{{ end }}">
{{- if ne .item.Title "" -}}
<a href="{{ .item.URL }}"> <a href="{{ .item.URL }}">
{{ .item.Pre }} {{ $link.Pre }}
<span>{{ .item.Name }}</span> <span>{{ $link.Name }}</span>
</a> </a>
{{- end -}}
</li> </li>
{{- end -}} {{- end -}}

View File

@ -3,10 +3,14 @@
<ul> <ul>
{{- if .HasChildren -}} {{- if .HasChildren -}}
<li class="{{ if $currentPage.HasMenuCurrent .Menu . }}active{{ end }}"> <li class="{{ if $currentPage.HasMenuCurrent .Menu . }}active{{ end }}">
<a href="{{ .URL }}"> {{- $pre := .Pre -}}
{{ .Pre }} {{- $name := .Name -}}
<span>{{ .Name }}</span> {{- with .URL }}
<a href="{{ . }}">
{{ $pre }}
<span>{{ $name }}</span>
</a> </a>
{{- end -}}
<ul class="sub-menu"> <ul class="sub-menu">
{{- range .Children -}} {{- range .Children -}}
{{ partial "menu-item.html" (dict "item" . "ctx" $currentPage)}} {{ partial "menu-item.html" (dict "item" . "ctx" $currentPage)}}