forked from drowl87/hextra_mirror
fix: sidebar more menu item link with multilingual (#594)
* sidebar: fix more menu item with multilingual Fixes #593 Correctly parses multilingual URL in sidebar, particularly if lang code follows a nested sub directory. For instance, GH pages hosting where the baseurl might be of the format `https://<USERNAME>.github.io/<REPO>/`. * Update sidebar.html --------- Co-authored-by: Xin <xin@imfing.com>
This commit is contained in:
parent
662d9202dc
commit
6a2f11d780
@ -144,7 +144,13 @@
|
|||||||
<span class="hx-cursor-default">{{ $name }}</span>
|
<span class="hx-cursor-default">{{ $name }}</span>
|
||||||
</li>
|
</li>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<li>{{ template "sidebar-item-link" dict "active" false "title" $name "link" (.URL | relLangURL) }}</li>
|
{{- $link := .URL -}}
|
||||||
|
{{- with .PageRef -}}
|
||||||
|
{{- if hasPrefix . "/" -}}
|
||||||
|
{{- $link = relLangURL (strings.TrimPrefix "/" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
<li>{{ template "sidebar-item-link" dict "active" false "title" $name "link" $link }}</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user