aboutsummaryrefslogtreecommitdiff
path: root/layouts/affected/list.json
diff options
context:
space:
mode:
authorMantas Vilčinskas <hi@mnts.lt>2021-04-17 14:18:48 +0300
committerGitHub <noreply@github.com>2021-04-17 14:18:48 +0300
commit18500f7d6fbef6e31d3a319d3ac209cbd00abb06 (patch)
treed0d41a7055f2314a92b6f475ece58506280080f1 /layouts/affected/list.json
parent48f41399bad4317205026933f018ad2c192d8f08 (diff)
parent740f8fe924ecda15de73002f648454cf5612142f (diff)
v5 goes live - #151
Diffstat (limited to 'layouts/affected/list.json')
-rw-r--r--layouts/affected/list.json37
1 files changed, 37 insertions, 0 deletions
diff --git a/layouts/affected/list.json b/layouts/affected/list.json
new file mode 100644
index 0000000..1fde8d1
--- /dev/null
+++ b/layouts/affected/list.json
@@ -0,0 +1,37 @@
+{{ $incidents := .Pages }}{{ $active := where $incidents "Params.resolved" "=" false }}{{ $isNotice := where $active "Params.severity" "=" "notice" }}{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}{{ $isDown := where $active "Params.severity" "=" "down" }}{
+ "is": "system",
+ "title": "{{ .Title }}",
+ "permalink": "{{ .Permalink }}",
+ "status": {{ if $isDown }}"down",{{ else }}{{ if $isDisrupted }}"disrupted",{{ else }}{{ if $isNotice }}"notice",{{ else }}"ok",{{ end }}{{ end }}{{ end }}
+ "pages": [{{ range $i, $e := .Pages }}{{ if $i }},{{ end }}{{ if eq .Section "issues" }}
+ {
+ "is": "issue",
+ "title": "{{ .Title }}",
+ "createdAt": "{{ .Date }}",
+ "lastMod": "{{ .Lastmod }}",
+ "permalink": "{{ .Permalink }}",
+ "severity": "{{ .Params.severity }}",
+ "resolved": {{ if .Params.resolved }}true{{ else }}false{{ end }},
+ "informational": {{ if .Params.informational }}true{{ else }}false{{ end }},
+ "resolvedAt": "{{ .Params.resolvedWhen }}",
+ "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}],
+ "filename": "{{ .File.LogicalName }}"
+ }
+ {{ else }}
+ {
+ "is": "page",
+ "title": "{{ .Title }}",
+ "createdAt": "{{ .Date }}",
+ "lastMod": "{{ .Lastmod }}",
+ "permalink": "{{ .Permalink }}",
+ "filename": "{{ .File.LogicalName }}",
+ "summary": {{ jsonify .Summary }}
+ }
+ {{ end }}{{ end }}
+ ],
+}
+
+
+
+
+