use variables instead of scratches which became possible by Hugo 0.49
parent
f5f055d1cf
commit
720e3cb99e
|
@ -1,13 +1,13 @@
|
||||||
{{ $.Scratch.Set "langext" "" }}
|
{{ $langext := "" }}
|
||||||
{{ if or (eq .Lang "de") (eq .Lang "fr") (eq .Lang "it") (eq .Lang "pt") (eq .Lang "ru") }}
|
{{ if or (eq .Lang "de") (eq .Lang "fr") (eq .Lang "it") (eq .Lang "pt") (eq .Lang "ru") }}
|
||||||
{{ $.Scratch.Add "langext" (printf "_%s" .Lang) }}
|
{{ $langext = (printf "_%s" .Lang) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<center>
|
<center>
|
||||||
<video controls="controls" poster="/img/poster.jpg" crossorigin="crossorigin" width="100%">
|
<video controls="controls" poster="/img/poster.jpg" crossorigin="crossorigin" width="100%">
|
||||||
<source src="https://download.fsfe.org/videos/pmpc/pmpc{{$.Scratch.Get "langext"}}_desktop.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' media="screen and (min-device-width:1000px)" />
|
<source src="https://download.fsfe.org/videos/pmpc/pmpc{{$langext}}_desktop.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' media="screen and (min-device-width:1000px)" />
|
||||||
<source src="https://download.fsfe.org/videos/pmpc/pmpc{{$.Scratch.Get "langext"}}_desktop.webm" type='video/webm; codecs="vp9, opus"' media="screen and (min-device-width:1000px)" />
|
<source src="https://download.fsfe.org/videos/pmpc/pmpc{{$langext}}_desktop.webm" type='video/webm; codecs="vp9, opus"' media="screen and (min-device-width:1000px)" />
|
||||||
<source src="https://download.fsfe.org/videos/pmpc/pmpc{{$.Scratch.Get "langext"}}_mobile.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' media="screen and (max-device-width:999px)" />
|
<source src="https://download.fsfe.org/videos/pmpc/pmpc{{$langext}}_mobile.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' media="screen and (max-device-width:999px)" />
|
||||||
<source src="https://download.fsfe.org/videos/pmpc/pmpc{{$.Scratch.Get "langext"}}_mobile.webm" type='video/webm; codecs="vp9, opus"' media="screen and (max-device-width:999px)" />
|
<source src="https://download.fsfe.org/videos/pmpc/pmpc{{$langext}}_mobile.webm" type='video/webm; codecs="vp9, opus"' media="screen and (max-device-width:999px)" />
|
||||||
|
|
||||||
<track src="https://publiccode.eu/video-subs/webvtt/pmpc_en.vtt" kind="subtitles" srclang="en" label="English">
|
<track src="https://publiccode.eu/video-subs/webvtt/pmpc_en.vtt" kind="subtitles" srclang="en" label="English">
|
||||||
<track src="https://publiccode.eu/video-subs/webvtt/pmpc_de.vtt" kind="subtitles" srclang="de" label="Deutsch">
|
<track src="https://publiccode.eu/video-subs/webvtt/pmpc_de.vtt" kind="subtitles" srclang="de" label="Deutsch">
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
{{- $.Scratch.Set "allgood" true -}} <!-- "allgood" will say whether all translations are fine -->
|
{{- $allgood := true -}} <!-- "allgood" will say whether all translations are fine -->
|
||||||
{{- range .Site.Pages -}} <!-- range through all pages -->
|
{{- range .Site.Pages -}} <!-- range through all pages -->
|
||||||
{{- $.Scratch.Set "uptodate" true -}} <!-- reset uptodate var -->
|
{{- $uptodate := true -}} <!-- reset uptodate var -->
|
||||||
{{- $main_date := .Lastmod -}} <!-- last modification date of EN file -->
|
{{- $main_date := .Lastmod -}} <!-- last modification date of EN file -->
|
||||||
{{- range .Translations -}} <!-- range through all translations of .Page -->
|
{{- range .Translations -}} <!-- range through all translations of .Page -->
|
||||||
{{- if and (.IsTranslated) (.IsPage) -}}
|
{{- if and (.IsTranslated) (.IsPage) -}}
|
||||||
{{- $i18n_date := .Lastmod -}}
|
{{- $i18n_date := .Lastmod -}}
|
||||||
{{- if ($main_date.After $i18n_date) -}} <!-- EN .Lastmod is newer than .Lastmod of translation -->
|
{{- if ($main_date.After $i18n_date) -}} <!-- EN .Lastmod is newer than .Lastmod of translation -->
|
||||||
{{- $.Scratch.Set "uptodate" false -}} <!-- at least one translation failed -->
|
{{- $uptodate = false -}} <!-- at least one translation failed -->
|
||||||
{{- $.Scratch.Set "allgood" false -}} <!-- at least one translation failed -->
|
{{- $allgood = false -}} <!-- at least one translation failed -->
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if eq ($.Scratch.Get "uptodate") false }} <!-- if at least one translation failed -->
|
{{- if eq $uptodate false }} <!-- if at least one translation failed -->
|
||||||
<h3><a href="{{ .Permalink }}">{{ .File.Path }}</a></h3>
|
<h3><a href="{{ .Permalink }}">{{ .File.Path }}</a></h3>
|
||||||
<table class="transstatus">
|
<table class="transstatus">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
|
@ -42,6 +42,6 @@
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if eq ($.Scratch.Get "allgood") true -}}
|
{{- if eq $allgood true -}}
|
||||||
<p style="text-align:center;">Everything is up to date! 👍</p>
|
<p style="text-align:center;">Everything is up to date! 👍</p>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
Loading…
Reference in New Issue