{{ $pageProseLang := partial "i18n/lang.html" . -}} {{ $siteLang := .Site.Language -}} {{ if ne .Language.Lang "en" -}} {{ if .Params.drifted_from_default -}} {{ with partial "_inline/ot-page-drifted-banner.html" . -}} {{ . -}} {{ end -}} {{ else if ne $siteLang $pageProseLang -}} {{ with partial "_inline/ot-page-not-found-banner.html" . -}}
{{ . }}
{{ end -}} {{ else if false -}} {{ with partial "_inline/ot-page-drifted-banner.html" . -}} {{ . -}} {{ end -}} {{ end -}} {{ end -}} {{ define "partials/_inline/ot-page-drifted-banner.html" }} {{/* Assumption: .Params.drifted_from_default */ -}} {{ $resultsArray := where .Translations "Lang" "en" -}} {{ $defaultLangPage := index $resultsArray 0 -}}

The content of this page may be outdated and some links may be invalid. {{- if and $defaultLangPage .Params.default_lang_commit }} A newer version of this page exists in English.

More information ...

To see the changes to the English page since this page was last updated: visit {{ $compareUrl := printf "%s/compare/%s..%s" .Site.Params.github_repo .Params.default_lang_commit $defaultLangPage.GitInfo.Hash -}} GitHub compare {{ substr .Params.default_lang_commit 0 8 }}..{{ $defaultLangPage.GitInfo.AbbreviatedHash -}} and search for {{ $defLangPath := strings.TrimPrefix (add hugo.WorkingDir "/") $defaultLangPage.File.Filename -}} {{ $defLangPath }}.

{{ else if not $defaultLangPage }} This page no longer has a corresponding English page. {{ end -}}

{{ end -}} {{ define "partials/_inline/ot-page-not-found-banner.html" }} {{ $path := "page-not-translated-msg.md" -}} {{ $args := (dict "path" $path "page" .Page) -}} {{ $page := partial "func/find-include.html" $args -}} {{ with $page -}} {{ .Content }} {{ else -}} {{ $lang := .Page.Language.Lang -}} {{ warnf "_inline/ot-page-not-found-banner: '%s' not found from page %s (%s)" $path .Page.Path $lang -}} {{ end -}} {{ end -}}