Format templates

This commit is contained in:
Will Faught
2023-02-05 19:51:09 -08:00
parent 038b48bfc2
commit 469d6ee893
12 changed files with 44 additions and 9 deletions

View File

@@ -31,6 +31,7 @@
{{ $pagepath := strings.TrimPrefix $basepath $.RelPermalink }}
{{ $menupath := strings.TrimPrefix $basepath .URL }}
{{ $active := or (and (eq $menupath "/") (eq $pagepath "/")) (and (ne $menupath "/") (hasPrefix $pagepath $menupath)) }}
<a {{ if $active }} aria-current="page" {{ end }} class="{{ if $active }} active {{ if $links }} link-secondary {{ end }} {{ end }} nav-link" href="{{ .URL | safeURL }}">{{ .Name }}</a>
{{ end }}
</div>