2019-08-24 13:32:41 +02:00
|
|
|
{{ if .Get "date" -}}
|
|
|
|
{{ $date := .Get "date" }}
|
2019-11-23 18:10:17 +01:00
|
|
|
{{ $id := delimit (split (md5 $date) "" | shuffle) "" | printf "countdown-%s" -}}
|
2019-08-24 13:32:41 +02:00
|
|
|
{{ $defaultPattern := printf "%%D %s %%H %s %%M %s %%S %s" (T "day") (T "hour") (T "minute") (T "second") }}
|
|
|
|
{{ $new := dict $id (dict "date" $date "pattern" (.Get "pattern" | default $defaultPattern)) }}
|
|
|
|
{{ with .Page.Scratch.Get "countdownMap" -}}
|
|
|
|
{{ .Page.Scratch.Set "countdownMap" (merge . $new) -}}
|
|
|
|
{{ else -}}
|
|
|
|
{{ .Page.Scratch.Set "countdownMap" $new -}}
|
2019-08-18 19:36:52 +02:00
|
|
|
{{ end -}}
|
2020-01-29 17:54:03 +01:00
|
|
|
<div id="{{ $id }}" style={{ .Get "style" | safeCSS }}></div>
|
2019-08-24 13:32:41 +02:00
|
|
|
{{ end -}}
|