From 493ec60029d2a5104d8802631e6d56fb563a16c3 Mon Sep 17 00:00:00 2001 From: Nicolas MASSE Date: Thu, 20 Jun 2024 16:54:50 +0200 Subject: [PATCH] fix lang detection in page metadata --- layouts/partials/lang-detection.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layouts/partials/lang-detection.html b/layouts/partials/lang-detection.html index d7de209..a196a20 100644 --- a/layouts/partials/lang-detection.html +++ b/layouts/partials/lang-detection.html @@ -1,7 +1,9 @@ {{ if and .IsTranslated (eq .Lang "fr") }} - - {{ if (index .AllTranslations 0).File }} - {{ if eq (index .AllTranslations 0).File.UniqueID (index .AllTranslations 1).File.UniqueID }} + + {{ if and (index .AllTranslations 0).File (index .AllTranslations 1).File }} + {{ $file0 := readFile (index .AllTranslations 0).File.Filename }} + {{ $file1 := readFile (index .AllTranslations 1).File.Filename }} + {{ if eq (sha256 $file0) (sha256 $file1) }} {{ .Scratch.Set "en_article_in_fr_site" true }} {{ end }} {{ else }}