{{- $expirationReminder := dict "Page" . "Key" "expiration_reminder" | partial "function/param.html" | default dict -}} {{- if $expirationReminder.enable | and (not .Params.password) -}} {{- $daysAgo := div (sub now.Unix .Lastmod.Unix) 86400 }} {{- $reminderThreshold := $expirationReminder.reminder | default 90 }} {{- $warningThreshold := $expirationReminder.warning | default 180 }} {{- $updateTime := .Lastmod }} {{- if gt $daysAgo $reminderThreshold -}} {{- $type := "note" -}} {{- $icon := "fa-pencil-alt" -}} {{- if gt $daysAgo $warningThreshold -}} {{- $type = "warning" -}} {{- $icon = "fa-exclamation-triangle" -}} {{- end -}}
{{ T (printf "admonition.%v" $type) }}
{{- with $updateTime | dateFormat (.Site.Params.date_format | default "2006-01-02") -}} {{- dict "Date" . | T "single.expirationReminder" -}} {{- end -}}
{{- end -}} {{- end -}}