diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 9c9b0c5c26..30cc9fd41c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -85,6 +85,8 @@ {{- if.Page.Params.show_lastmod -}} {{- partial "lastmod" . -}} {{- end -}} + + {{- partial "outdated_translation" . -}} {{- $scratch := newScratch -}} {{- $lang := .Page.Language.Lang -}} diff --git a/layouts/partials/lastmod.html b/layouts/partials/lastmod.html index 725831d244..e703f5dc6c 100644 --- a/layouts/partials/lastmod.html +++ b/layouts/partials/lastmod.html @@ -7,25 +7,4 @@ {{ if eq .Page.Section "docs" }} | {{ i18n "see_all_doc" }}{{ end }}
- -{{ $curpage := .Page }} -{{ if and (ne $curpage.Language.Lang "en") (not .Page.Params.untranslated) }} -{{/* If we are not in English we search for the English version */}} -{{ range $curpage.Translations }} - {{ if eq "en" .Language.Lang }} - {{ if .Page.Lastmod }} - {{/* To compare the Lastmod with the current translation */}} - {{ if ne $curpage.Lastmod .Page.Lastmod }} -- - {{ i18n "old_version" }} - () - {{ i18n "view_in_english" }} - -
- {{ end }} - {{ end }} - {{ end }} -{{ end }} -{{ end }} diff --git a/layouts/partials/outdated_translation.html b/layouts/partials/outdated_translation.html new file mode 100644 index 0000000000..27c7e1efc2 --- /dev/null +++ b/layouts/partials/outdated_translation.html @@ -0,0 +1,22 @@ + +{{ $curpage := .Page }} +{{ if and (ne $curpage.Language.Lang "en") (not .Page.Params.untranslated) }} +{{/* If we are not in English we search for the English version */}} +{{ range $curpage.Translations }} + {{ if eq "en" .Language.Lang }} + {{ if .Page.Lastmod }} + {{/* To compare the Lastmod with the current translation */}} + {{ if ne $curpage.Lastmod .Page.Lastmod }} ++ + {{ i18n "old_version" }} + () + {{ i18n "view_in_english" }} + +
+ {{ end }} + {{ end }} + {{ end }} +{{ end }} +{{ end }} +