From b46ab43626cf826aa1051b9a745925fe6b701260 Mon Sep 17 00:00:00 2001 From: Robb Shecter Date: Mon, 29 Jan 2024 13:50:54 -0700 Subject: [PATCH] Add hreflang links to HTML HEAD --- layouts/_default/baseof.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 52e7e67..d63e0a8 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -7,6 +7,19 @@ {{ block "title" . }}{{ with .Params.Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }} + + {{/* + Multilingual site support + See: https://developers.google.com/search/docs/specialty/international/localized-versions + */}} + {{ with .AllTranslations }} + {{ range . }} + {{ if not (eq .Lang $.Page.Lang) }} + + {{ end }} + {{ end }} + {{ end }} + {{ hugo.Generator }} {{/* NOTE: For Production make sure you add `HUGO_ENV="production"` before your build command */}} {{ $production := eq (getenv "HUGO_ENV") "production" | or (eq site.Params.env "production") }}