fix(theme): update the markup and styling of translastions

This commit is contained in:
Bruno Carlin 2025-07-06 14:22:12 +02:00
parent ceb1d7ae03
commit c321629dd2
Signed by: bcarlin
GPG key ID: 8E254EA0FFEB9B6D
4 changed files with 7 additions and 3 deletions

View file

@ -236,7 +236,9 @@ body {
main { main {
.translations { .translations {
text-align: end; text-align: end;
margin-bottom: 0.3em; margin-block-end: 0.3em;
padding-inline-end: 2em;
font-size: 0.9em;
a { a {
text-decoration: none; text-decoration: none;

View file

@ -17,5 +17,6 @@ permalink_section: "Permalink to this section"
tags: Tags tags: Tags
information_icon: Information icon information_icon: Information icon
warning_icon: Warning icon warning_icon: Warning icon
translations: Translations
also_available_in: "Also available in:" also_available_in: "Also available in:"
table_of_contents: "Contents:" table_of_contents: "Contents:"

View file

@ -17,5 +17,6 @@ permalink_section: Permalien vers cette partie
tags: Tags tags: Tags
information_icon: Icône information information_icon: Icône information
warning_icon: Icône attention warning_icon: Icône attention
translations: Traductions
also_available_in: "Également disponible en :" also_available_in: "Également disponible en :"
table_of_contents: "Contenu :" table_of_contents: "Contenu :"

View file

@ -38,12 +38,12 @@
<main> <main>
{{- if .IsTranslated }} {{- if .IsTranslated }}
{{- range .Translations }} {{- range .Translations }}
<div class="translations"> <aside class="translations" aria-label="{{ T `translations` }}">
{{ T `also_available_in` }} {{ T `also_available_in` }}
<a hreflang="{{ .Language.LanguageCode }}" href="{{ .RelPermalink }}" title="{{ .Language.LanguageName }}"> <a hreflang="{{ .Language.LanguageCode }}" href="{{ .RelPermalink }}" title="{{ .Language.LanguageName }}">
{{ if eq .Language.Lang "en" }}🇬🇧{{ else if eq .Language.Lang "fr" }}🇫🇷{{ else }}{{ .Language.LanguageName }}{{ end }} {{ if eq .Language.Lang "en" }}🇬🇧{{ else if eq .Language.Lang "fr" }}🇫🇷{{ else }}{{ .Language.LanguageName }}{{ end }}
</a> </a>
</div> </aside>
{{- end }} {{- end }}
{{- end }} {{- end }}