diff --git a/layouts/partials/hooks/head-end.html b/layouts/partials/hooks/head-end.html
index e69de29bb2..e77c7d3475 100644
--- a/layouts/partials/hooks/head-end.html
+++ b/layouts/partials/hooks/head-end.html
@@ -0,0 +1,26 @@
+{{ with .Params.canonical_url -}}
+
+
+
+{{- else -}}
+
+ {{ $canonicalURL := .Permalink -}}
+
+ {{ $defaultLang := "en" -}}
+ {{ if and (ne .Language.Lang $defaultLang) .File -}}
+
+ {{ $pagePath := strings.TrimPrefix (add hugo.WorkingDir "/content/") .File.Filename -}}
+ {{ if hasPrefix $pagePath $defaultLang -}}
+
+
+
+ {{ $translationPages := where .Translations "Lang" $defaultLang -}}
+ {{ $translation := index $translationPages 0 -}}
+ {{ with $translation -}}
+ {{ $canonicalURL = .Permalink -}}
+ {{ end -}}
+ {{ end -}}
+ {{ end -}}
+
+
+{{- end -}}
\ No newline at end of file