aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordumbmoron <log@riseup.net>2023-11-30 22:59:42 +0000
committerdumbmoron <log@riseup.net>2023-12-01 01:52:41 +0000
commit79159ef493beab9eca85b0a8d3ad93abe870f4a1 (patch)
tree7f09d290bbd72e3595007fd1e5521e710abb8fe7
parent72ca0beb8853c3047a9192d2799bb4fd9dfe005a (diff)
index.json: add pinned issues to output
Adds a `pinnedIssues` key to the `index.json` object, which contains issues with `informational` and `pin` set to `true`.
-rw-r--r--layouts/index.json14
1 files changed, 14 insertions, 0 deletions
diff --git a/layouts/index.json b/layouts/index.json
index a7ce134..23b8afa 100644
--- a/layouts/index.json
+++ b/layouts/index.json
@@ -17,6 +17,20 @@
}
{{ end }}
],
+ {{ $informationals := where $incidents "Params.informational" "=" true }}{{ $pinnedIssues := where $informationals "Params.pin" "=" true }}
+ {{ if not $pinnedIssues }}
+ "pinnedIssues": []{{ else }}
+ "pinnedIssues": [{{ range $i, $e := $pinnedIssues }}{{ if $i }},{{ end }}
+ {
+ "is": "issue",
+ "title": "{{ .Title }}",
+ "createdAt": "{{ .Date }}",
+ "lastMod": "{{ .Lastmod }}",
+ "permalink": "{{ .Permalink }}",
+ "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}],
+ "filename": "{{ .File.LogicalName }}"
+ }{{ end }}
+ ]{{ end }},
"systems": [
{{ range $i, $e := .Site.Params.systems }}{{ if $i }},{{ end }}
{