{{- $params := .Scratch.Get "params" -}} {{- $expirationReminder := $params.expirationReminder | default dict -}} {{- if $expirationReminder.enable -}} {{- $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 .Site.Params.dateformat | default "2006-01-02" | $updateTime.Format -}} {{- dict "Date" . | T "single.expirationReminder" -}} {{- end -}}
{{- end -}} {{- end -}}