Simplify expressions

master
Will Faught 2 years ago
parent b0222685bb
commit 98bcb377d1

@ -36,9 +36,9 @@
<ul class="align-items-center flex-column flex-{{ $breakpoint }}-row justify-content-center nav {{ if $pills }} nav-pills {{ else if $tabs }} nav-tabs {{ else if $underline }} nav-underline {{ end }}">
{{ range . }}
{{ $menupath := strings.TrimPrefix $basepath .URL }}
{{ $home := (and (eq $menupath "/") (eq $pagepath "/")) }}
{{ $menuprefix := (and (ne $menupath "/") (hasPrefix $pagepath $menupath)) }}
{{ $sectionprefix := (and (ne $menupath "/") (hasPrefix $menupath (printf "/%s/" $page.Section))) }}
{{ $home := and (eq $menupath "/") (eq $pagepath "/") }}
{{ $menuprefix := and (ne $menupath "/") (hasPrefix $pagepath $menupath) }}
{{ $sectionprefix := and (ne $menupath "/") (hasPrefix $menupath (printf "/%s/" $page.Section)) }}
{{ $active := or $home $menuprefix $sectionprefix }}
<li class="nav-item {{ if .Children }} dropdown {{ end }}">

Loading…
Cancel
Save