mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-29 19:52:43 +01:00
12 lines
No EOL
582 B
HTML
12 lines
No EOL
582 B
HTML
{{ if .Get "date" -}}
|
|
{{ $date := .Get "date" }}
|
|
{{ $id := delimit (split (md5 $date) "" | shuffle) "" | printf "cd-%s" -}}
|
|
{{ $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 -}}
|
|
{{ end -}}
|
|
<div id="{{ $id }}"></div>
|
|
{{ end -}} |