aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2025-01-22 00:41:27 +0100
committerOscar Najera <hi@oscarnajera.com>2025-01-22 00:48:01 +0100
commit110ecfe2b5b9b513a2519a8682a5cf6f2bce78fa (patch)
treef56a91ef284c11f55b1959a121f03807f091d8c5
parentaefe0904492698d2996d59d3f86a0fe9af0f688b (diff)
downloadhugo-minimalist-theme-110ecfe2b5b9b513a2519a8682a5cf6f2bce78fa.tar.gz
hugo-minimalist-theme-110ecfe2b5b9b513a2519a8682a5cf6f2bce78fa.tar.bz2
hugo-minimalist-theme-110ecfe2b5b9b513a2519a8682a5cf6f2bce78fa.zip
Translation meta hreflang
-rw-r--r--i18n/de.yml2
-rw-r--r--i18n/en-shaw.yml2
-rw-r--r--layouts/partials/header.html1
-rw-r--r--layouts/partials/structured-data.html15
4 files changed, 20 insertions, 0 deletions
diff --git a/i18n/de.yml b/i18n/de.yml
index 7113a7f..d2a5de1 100644
--- a/i18n/de.yml
+++ b/i18n/de.yml
@@ -22,6 +22,7 @@ match_found:
_blank: " "
about: รœber mich
author_by: Von
+maybe_look: Vielleicht suchten Sie nach einem dieser Artikel?
minute_read: "min Lesezeit"
next: nรคchste
no_match_found: "Kein Treffer gefunden"
@@ -33,3 +34,4 @@ search_placeholder: "Geben Sie Ihre Suchbegriffe ein"
search_request: "Bitte geben Sie ein Wort oder einen Satz oben ein"
see_all: "alle anzeigen"
translations: รœbersetzungen
+try_search: Nicht da? Versuchen Sie es auf der Suchseite.
diff --git a/i18n/en-shaw.yml b/i18n/en-shaw.yml
index c42630e..40b8abb 100644
--- a/i18n/en-shaw.yml
+++ b/i18n/en-shaw.yml
@@ -22,6 +22,7 @@ match_found:
_blank: " "
about: ๐‘ฉ๐‘š๐‘ฌ๐‘‘
author_by: ๐‘š๐‘ฒ
+maybe_look: ๐‘๐‘ผ๐‘ฃ๐‘จ๐‘๐‘• ๐‘ฟ ๐‘ข๐‘ป ๐‘ค๐‘ซ๐‘’๐‘ฆ๐‘™ ๐‘“ ๐‘ข๐‘ณ๐‘ฏ ๐‘ ๐‘ž๐‘ฐ๐‘Ÿ?
minute_read: "๐‘ฅ๐‘ฐ๐‘ฏ ๐‘ฎ๐‘ฐ๐‘›"
next: "๐‘ฏ๐‘ง๐‘’๐‘•๐‘‘"
no_match_found: "๐‘ฏ๐‘ด ๐‘ฅ๐‘จ๐‘— ๐‘“๐‘ฌ๐‘ฏ๐‘›"
@@ -33,3 +34,4 @@ search_placeholder: "๐‘ฎ๐‘ฒ๐‘‘ ๐‘˜๐‘น ๐‘•๐‘ป๐‘— ๐‘‘๐‘ป๐‘ฅ๐‘Ÿ"
search_request: "๐‘๐‘ค๐‘ฐ๐‘Ÿ ๐‘ง๐‘ฏ๐‘‘๐‘ผ ๐‘ฉ ๐‘ข๐‘ป๐‘› ๐‘น ๐‘“๐‘ฎ๐‘ฑ๐‘Ÿ ๐‘ฉ๐‘š๐‘ณ๐‘"
see_all: "๐‘•๐‘ฐ ๐‘ท๐‘ค"
translations: ๐‘‘๐‘ฎ๐‘จ๐‘ฏ๐‘•๐‘ค๐‘ฑ๐‘–๐‘ฉ๐‘ฏ๐‘Ÿ
+try_search: ๐‘ฏ๐‘ช๐‘‘ ๐‘ž๐‘บ? ๐‘‘๐‘ฎ๐‘ฒ ๐‘ฟ๐‘Ÿ๐‘ฆ๐‘™ ๐‘ž ๐‘•๐‘ป๐‘— ๐‘๐‘ฑ๐‘ก.
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index f3c929a..fce67da 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -39,6 +39,7 @@
name="lang"
class="mr-2 p-1 text-center border border-black-20 rounded-md bg-white text-black"
onchange="self.location=options[selectedIndex].value"
+ aria-label="Page language"
>
<option value="{{ .Permalink }}">
{{ .Language.Lang }}
diff --git a/layouts/partials/structured-data.html b/layouts/partials/structured-data.html
index eb42277..8b59734 100644
--- a/layouts/partials/structured-data.html
+++ b/layouts/partials/structured-data.html
@@ -78,6 +78,21 @@
{{ end }}
{{ end }}
+{{ if .IsTranslated }}
+ {{ range .Translations }}
+ <link
+ rel="alternate"
+ hreflang="{{ .Language.Lang }}"
+ href="{{ .Permalink }}"
+ />
+ {{ end }}
+ <link
+ rel="alternate"
+ hreflang="{{ .Language.Lang }}"
+ href="{{ .Permalink }}"
+ />
+{{ end }}
+
{{- /* If it is part of a series, link to related articles */}}
{{- $permalink := .Permalink }}
{{- $siteSeries := .Site.Taxonomies.series }}