Replace _ with - in file names

This commit is contained in:
Will Faught
2022-12-12 23:20:23 -08:00
parent e5ab39b3a2
commit b6783d2750
30 changed files with 41 additions and 41 deletions

View File

@@ -0,0 +1,13 @@
{{ $p := . }}
{{ $basePath := path.Clean (urls.Parse .Site.BaseURL).Path }}
{{ if eq $basePath "/" }}
{{ $basePath = "" }}
{{ end }}
<nav class="justify-content-center nav nav-pills py-3">
{{ 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="nav-link{{ if $active }} active{{ end }}"{{ if $active }} aria-current="page"{{ end }}>{{ .Name }}</a>
{{ end }}
</nav>