-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate the logic of outdated_translation vs lastmod
Signed-off-by: Tom Delmas <[email protected]>
- Loading branch information
Showing
3 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!--googleoff: all--> | ||
{{ $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 }} | ||
<p> | ||
<i> | ||
{{ i18n "old_version" }} | ||
(<time datetime="{{ .Page.Lastmod.Format "2006-01-02" }}">{{ .Page.Lastmod | time.Format $.Site.Params.time_format_default }}</time>) | ||
<a href="{{ .Page.RelPermalink }}">{{ i18n "view_in_english" }}</a> | ||
</i> | ||
</p> | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
<!--googleon: all--> |