Fix translation links
Some checks failed
Build demo / build (push) Has been cancelled
Update Nix dependencies / update-nix-deps (push) Has been cancelled

This commit is contained in:
Gabriel Arazas 2024-11-19 12:12:59 +08:00
parent 664e5c3928
commit 143341838d
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 7 additions and 2 deletions

View File

@ -26,6 +26,11 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version
** `$.Site.Author` has been deprecated and instead uses the `$.Site.Params.author` instead.
=== Fixed
* Update translation links template.
== [0.7.1] - 2024-10-28

View File

@ -50,10 +50,10 @@
{{- $langs := slice }}
{{- range .Translations }}
{{- $lang := cond (ne .Language.LanguageName nil) .Language.LanguageName .Lang }}
{{ $lang_links = $lang_links | append (printf "<a href=%s>%s</a>" .RelPermalink $lang) }}
{{ $lang_links = $lang_links | append (printf "<a href=\"%s\">%s</a>" .RelPermalink $lang) }}
{{ $langs = $langs | append $lang }}
{{- end }}
<p data-content-translations="{{ jsonify $langs }}">{{ i18n "available_translations" }}: {{ delimit $lang_links "," (printf " %s " (i18n "and")) }}</p>
<p data-content-translations="{{ jsonify $langs }}">{{ i18n "available_translations" }}: {{ delimit $lang_links "," (printf " %s " (i18n "and")) | safeHTML }}</p>
{{- end }}
</div>
{{ end }}