Fix base path logic

This commit is contained in:
Will Faught
2022-09-08 20:16:31 -07:00
parent 675cce4fc7
commit 5b3701fd07

View File

@@ -40,6 +40,9 @@
<ul class="nav nav-pills">
{{ $p := . }}
{{ $basePath := path.Clean (urls.Parse .Site.BaseURL).Path }}
{{ if eq $basePath "/" }}
{{ $basePath = "" }}
{{ end }}
{{ range .Site.Menus.main }}
{{ $pagePath := strings.TrimPrefix $basePath $p.RelPermalink }}
{{ $menuPath := strings.TrimPrefix $basePath .URL }}