Use Hugo's relLangURL filter to fix relative URLs in list shortdocs

Submitted by:	allanjude@
PR:		253013
Review:         https://reviews.freebsd.org/D28344
This commit is contained in:
Sergio Carlavilla Delgado 2021-01-26 13:02:54 +01:00
parent 42b64a1521
commit 4dba695e5d
2 changed files with 2 additions and 2 deletions
documentation/themes/beastie/layouts/shortcodes

View file

@ -14,7 +14,7 @@
{{ if in .path "_index.adoc" }}
{{ $articlePath := replaceRE "/_index.adoc" "" .path }}
{{ $articleName := replaceRE "articles/" "" $articlePath }}
<li><a href="{{ $articlePath }}">{{ $articleName }}</a></li>
<li><a href="{{ $articlePath | relLangURL }}">{{ $articleName }}</a></li>
{{ end }}
{{ end }}
</ul>

View file

@ -14,7 +14,7 @@
{{ if in .path "_index.adoc" }}
{{ $bookPath := replaceRE "/_index.adoc" "" .path }}
{{ $bookName := replaceRE "books/" "" $bookPath }}
<li><a href="{{ $bookPath }}">{{ $bookName }}</a></li>
<li><a href="{{ $bookPath | relLangURL }}">{{ $bookName }}</a></li>
{{ end }}
{{ end }}
</ul>