fix(layouts): use the permalink instead of url
This commit is contained in:
parent
29428c692e
commit
eb719c3683
|
@ -18,20 +18,20 @@
|
||||||
<ul class="list-unstyled ms-3">
|
<ul class="list-unstyled ms-3">
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
||||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
|
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
||||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
|
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
|
||||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
|
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
{{ range .Children -}}
|
{{ range .Children -}}
|
||||||
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
||||||
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
{{- $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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
||||||
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
{{- $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 -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
||||||
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
{{- $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 -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -60,4 +60,4 @@
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</li>
|
</li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -18,14 +18,14 @@
|
||||||
{{ range .Children -}}
|
{{ range .Children -}}
|
||||||
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
||||||
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
||||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
|
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
||||||
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
||||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
|
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -33,9 +33,9 @@
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
{{- $active := or ($currentPage.IsMenuCurrent $section .) ($currentPage.HasMenuCurrent $section .) -}}
|
||||||
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
||||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
|
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .Permalink }}">{{ .Name }}</a></li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
Loading…
Reference in New Issue