Move invariant out of loop

master
Will Faught 2 years ago
parent 2692c9a92d
commit cee4e94255

@ -9,6 +9,8 @@
{{ $basepath = "" }}
{{ end }}
{{ $pagepath := strings.TrimPrefix $basepath $page.RelPermalink }}
{{ with $page.Param "paige.menu.style" }}
{{ if eq . "links" }}
{{ $links = true }}
@ -28,7 +30,6 @@
<div class="collapse justify-content-center mt-3 mt-{{ $breakpoint }}-0 navbar-collapse" id="paige-menu-toggler">
<div class="align-items-center flex-column flex-{{ $breakpoint }}-row justify-content-center nav {{ if $pills }} nav-pills {{ end }}">
{{ range site.Menus.main }}
{{ $pagepath := strings.TrimPrefix $basepath $page.RelPermalink }}
{{ $menupath := strings.TrimPrefix $basepath .URL }}
{{ $home := (and (eq $menupath "/") (eq $pagepath "/")) }}
{{ $menuprefix := (and (ne $menupath "/") (hasPrefix $pagepath $menupath)) }}

Loading…
Cancel
Save