aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorMantas Vilčinskas <hi@mnts.lt>2023-12-01 14:00:58 +0200
committerGitHub <noreply@github.com>2023-12-01 14:00:58 +0200
commit9bea9303be43331c127b977cc77bcd920d83b0a2 (patch)
treeea276f7770071ba8035796b7fca586966bd412e5 /layouts
parent4552b3595d89f525e13a4ed3ff6ab74adad431b0 (diff)
parent79159ef493beab9eca85b0a8d3ad93abe870f4a1 (diff)
Expose pinned issue(s) in index.json – #296 from dumbmoron/pinned-issues-json
Diffstat (limited to 'layouts')
-rw-r--r--layouts/index.json14
1 files changed, 14 insertions, 0 deletions
diff --git a/layouts/index.json b/layouts/index.json
index 08a75f3..0067dc3 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 }}
{