fix(layouts): use the permalink instead of url

This commit is contained in:
James Elliott
2022-03-21 10:50:32 +11:00
parent 29428c692e
commit eb719c3683
3 changed files with 12 additions and 12 deletions

View File

@ -33,7 +33,7 @@
{{ range .Children -}}
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
<li><a class="docs-link rounded{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
<li><a class="docs-link rounded{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li>
{{ end -}}
</ul>
</div>
@ -42,7 +42,7 @@
{{ else -}}
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
<li><a class="docs-link rounded{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
<li><a class="docs-link rounded{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li>
{{ end -}}
{{ end -}}
</ul>
@ -52,7 +52,7 @@
{{ else -}}
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
<li><a class="docs-link rounded{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
<li><a class="docs-link rounded{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li>
{{ end -}}
{{ end -}}
</ul>
@ -60,4 +60,4 @@
{{ end -}}
</li>
{{ end -}}
</ul>
</ul>