Activate home menu for root pages

master
Will Faught 6 months ago
parent be6f3381fa
commit 976732efd5

@ -53,7 +53,7 @@
{{ range . }} {{ range . }}
{{ $menupath := strings.TrimPrefix $basepath .URL }} {{ $menupath := strings.TrimPrefix $basepath .URL }}
{{ $home := and (eq $menupath "/") (eq $pagepath "/") }} {{ $home := and (eq $menupath "/") (eq $page.Section "") }}
{{ $menuprefix := and (ne $menupath "/") (hasPrefix $pagepath $menupath) }} {{ $menuprefix := and (ne $menupath "/") (hasPrefix $pagepath $menupath) }}
{{ $sectionprefix := and (ne $menupath "/") (hasPrefix $menupath (printf "/%s/" $page.Section)) }} {{ $sectionprefix := and (ne $menupath "/") (hasPrefix $menupath (printf "/%s/" $page.Section)) }}
@ -115,7 +115,7 @@
{{ range $ordered }} {{ range $ordered }}
{{ $menupath := strings.TrimPrefix $basepath .RelPermalink }} {{ $menupath := strings.TrimPrefix $basepath .RelPermalink }}
{{ $home := and (eq $menupath "/") (eq $pagepath "/") }} {{ $home := and (eq $menupath "/") (eq $page.Section "") }}
{{ $menuprefix := and (ne $menupath "/") (hasPrefix $pagepath $menupath) }} {{ $menuprefix := and (ne $menupath "/") (hasPrefix $pagepath $menupath) }}
{{ $sectionprefix := and (ne $menupath "/") (hasPrefix $menupath (printf "/%s/" $page.Section)) }} {{ $sectionprefix := and (ne $menupath "/") (hasPrefix $menupath (printf "/%s/" $page.Section)) }}

Loading…
Cancel
Save