{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} {{ $active := where $incidents "Params.resolved" "=" false }} {{ $isNotice := where $active "Params.severity" "=" "notice" }} {{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} {{ $isDown := where $active "Params.severity" "=" "down" }}

{{ .Title }}

{{ if .Site.Params.dateFormat }} {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }}

{{ range .Params.Affected }} {{ . }} {{ end }}

{{ if .Params.informational }} {{ else if .Params.Resolved }} {{ $t := (time .Params.ResolvedWhen) }} {{ $timeDiff := (sub $t.Unix .Date.Unix) }} {{ $diffInMin := (div $timeDiff 60) }} {{ if lt $timeDiff 60 }}
{{ T "resolved" }} {{ T "inUnderAMinute" }}.
{{ else }} {{ if gt $timeDiff 3600 }}
{{ T "resolvedAfter" }} {{ $minutesForCalc := (mod $diffInMin 60) }} {{ div (sub $diffInMin $minutesForCalc) 60 }}h {{ $minutesForCalc }}m {{ T "ofDowntime" }}. {{ if .Site.Params.dateFormat }} {{ dateFormat .Site.Params.dateFormat .Params.resolvedWhen }} {{ else }} {{ dateFormat "January 2, 2006 at 3:04 PM" .Params.resolvedWhen }} {{ end }}
{{ else }}
{{ T "resolvedAfter" }} {{ $secsForCalc := (mod $timeDiff 60) }} {{ div (sub $timeDiff $secsForCalc) 60 }}m {{ T "ofDowntime" }}. {{ if .Site.Params.dateFormat }} {{ dateFormat .Site.Params.dateFormat .Params.resolvedWhen }} {{ else }} {{ dateFormat "January 2, 2006 at 3:04 PM" .Params.resolvedWhen }} {{ end }}
{{ end }} {{ end }} {{ else }} {{ if eq .Params.severity "down" }} ■ {{ else if eq .Params.severity "disrupted" }} ▲ {{ else }} ◆ {{ end }} {{ T "downtimeOngoing" }} {{ end }}
{{ .Content }}