From 548fcb9e38409902e12d117c745297e7637a7e67 Mon Sep 17 00:00:00 2001 From: Mantas VilĨinskas Date: Wed, 24 Feb 2021 16:29:44 +0200 Subject: API updates, lastmod, NCMS/default config changes, version to 0.80 --- layouts/affected/list.json | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 layouts/affected/list.json (limited to 'layouts/affected/list.json') 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 }} + ], +} + + + + + -- cgit v1.2.3-70-g09d2