Template formatting

This commit is contained in:
Will Faught
2023-01-10 21:30:40 -08:00
parent 4af9532c74
commit f3c02d6922
3 changed files with 5 additions and 5 deletions

View File

@@ -17,11 +17,11 @@
{{ else }}
{{ $pills = true }}
{{ end }}
<nav class="justify-content-center my-3 nav{{ if $pills }} nav-pills{{ else if $tabs }} nav-tabs{{ end }}">
<nav class="justify-content-center my-3 nav {{ if $pills }} nav-pills {{ else if $tabs }} nav-tabs {{ end }}">
{{ range .Site.Menus.main }}
{{ $pagePath := strings.TrimPrefix $basePath $p.RelPermalink }}
{{ $menuPath := strings.TrimPrefix $basePath .URL }}
{{ $active := or (and (eq $menuPath `/`) (eq $pagePath `/`)) (and (ne $menuPath `/`) (hasPrefix $pagePath $menuPath)) }}
<a href="{{ .URL }}" class="{{ if $active }}active {{ if $links }}link-secondary {{ end }}{{ end }}nav-link"{{ if $active }} aria-current="page"{{ end }}>{{ .Name }}</a>
<a href="{{ .URL }}" class="{{ if $active }} active {{ if $links }} link-secondary {{ end }} {{ end }} nav-link" {{ if $active }} aria-current="page" {{ end }}>{{ .Name }}</a>
{{ end }}
</nav>