diff options
author | Mantas Vilčinskas <hi@mnts.lt> | 2021-04-17 14:18:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 14:18:48 +0300 |
commit | 18500f7d6fbef6e31d3a319d3ac209cbd00abb06 (patch) | |
tree | d0d41a7055f2314a92b6f475ece58506280080f1 /layouts/index.json | |
parent | 48f41399bad4317205026933f018ad2c192d8f08 (diff) | |
parent | 740f8fe924ecda15de73002f648454cf5612142f (diff) |
v5 goes live - #151
Diffstat (limited to 'layouts/index.json')
-rw-r--r-- | layouts/index.json | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/layouts/index.json b/layouts/index.json index 5c47558..9834cec 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,20 +1,14 @@ -{{ $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" }} -{ +{{ $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" }}{ "is": "index", - "cStateVersion": "4.4", - "apiVersion": "1.0.0", + "cStateVersion": "5.0", + "apiVersion": "2.0", "title": "{{ .Site.Title }}", "languageCodeHTML": "{{ .Site.LanguageCode }}", "languageCode": "{{ T "languageCode" }}", "baseURL": "{{ .Site.BaseURL }}", "description": "{{ .Site.Params.Description }}", - "logo": "{{ .Site.Params.logo | absURL }}", - "categories": [ - {{ range $i, $e := .Site.Params.categories }}{{ if $i }},{{ end }} + "summaryStatus": {{ if $isDown }}"down",{{ else }}{{ if $isDisrupted }}"disrupted",{{ else }}{{ if $isNotice }}"notice",{{ else }}"ok",{{ end }}{{ end }}{{ end }} + "categories": [{{ range $i, $e := .Site.Params.categories }}{{ if $i }},{{ end }} { "name": "{{ .name }}",{{ if .description }} "description": "{{ .description }}",{{ end }} @@ -28,32 +22,48 @@ { "name": "{{ .name }}",{{ if .description }} "description": "{{ .description }}",{{ end }} - "category": "{{ .category }}" + "category": "{{ .category }}", + {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }}{{ $thisIsNotice := where $activeComponentIssues "Params.severity" "=" "notice" }}{{ $thisIsDisrupted := where $activeComponentIssues "Params.severity" "=" "disrupted" }}{{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }} + "status": {{ if $thisIsDown }}"down"{{ else }}{{ if $thisIsDisrupted }}"disrupted"{{ else }}{{ if $thisIsNotice }}"notice"{{ else }}"ok"{{ end }}{{ end }}{{ end }}, + {{ if not $activeComponentIssues }} + "unresolvedIssues": [] + {{ else }} + "unresolvedIssues": [{{ range $i, $e := $activeComponentIssues }}{{ if $i }},{{ end }} + { + "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 }}" + } + {{ end }} + ]{{ end }} + }{{ end }} + ], + {{ if .Site.Params.customTabs }} + "tabs": [{{ range $i, $e := .Site.Params.customTabs }}{{ if $i }},{{ end }} + { + "name": "{{ .name }}", + "link": "{{ .description }}" } {{ end }} - ], - + ],{{ end }} "buildDate": "{{ now.Format "2006-01-02" }}", "buildTime": "{{ now.Format "15:04" }}", "buildTimezone": "{{ now.Format "MST" }}", - "summaryStatus":{{ if $isDown }} - "down", - {{ else }} - {{ if $isDisrupted }} - "disrupted", - {{ else }} - {{ if $isNotice }} - "notice", - {{ else }} - "ok", - {{ end }}{{ end }}{{ end }} "colorBrand": "{{ .Site.Params.Brand }}", "colorOk": "{{ .Site.Params.Ok }}", "colorDisrupted": "{{ .Site.Params.Disrupted }}", "colorDown": "{{ .Site.Params.Down }}", "colorNotice": "{{ .Site.Params.Notice }}", "alwaysKeepBrandColor": "{{ .Site.Params.alwaysKeepBrandColor }}", - + "logo": "{{ .Site.Params.logo | absURL }}", "googleAnalytics": "{{ .Site.Params.googleAnalytics }}" } |