From 5a80920562981838d51230961fc02644b86d1149 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Wed, 13 Jul 2022 18:02:03 +0300 Subject: Expose all variables to partials (thanks @jhanos) --- layouts/partials/index/components.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'layouts/partials/index') diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html index 835c523..9b9b082 100644 --- a/layouts/partials/index/components.html +++ b/layouts/partials/index/components.html @@ -43,19 +43,19 @@ {{ $categorySystems := where $systems "category" "=" .name }}
- {{ range $categorySystems }} - {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }} + {{ range $system := $categorySystems }} + {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice $system.name) }} {{ $thisIsNotice := where $activeComponentIssues "Params.severity" "=" "notice" }} {{ $thisIsDisrupted := where $activeComponentIssues "Params.severity" "=" "disrupted" }} {{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }} -- cgit v1.2.3-70-g09d2 From bdd27c6ee3ec7f127cf9bc1e567c7a7a23b16a09 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Wed, 13 Jul 2022 18:38:58 +0300 Subject: Fix #224, some weirdly formatted posts look pinned --- layouts/partials/index/announcements.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'layouts/partials/index') diff --git a/layouts/partials/index/announcements.html b/layouts/partials/index/announcements.html index e33c262..f8f7471 100644 --- a/layouts/partials/index/announcements.html +++ b/layouts/partials/index/announcements.html @@ -1,11 +1,13 @@ -{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} -{{ $active := where $incidents "Params.resolved" "=" false }} -{{ $activeIncidents := where $incidents "Params.informational" "=" false }} -{{ $pinned := where $incidents "Params.pin" "=" true }} +{{ $allPosts := where .Site.RegularPages "Params.section" "issue" }} +{{ $active := where $allPosts "Params.resolved" "=" false }} -{{ if or ($activeIncidents) ($pinned) }} +{{ $informationals := where $allPosts "Params.informational" "=" true }} +{{ $pinned := where $informationals "Params.pin" "=" true }} + + +{{ if or ($active) ($pinned) }}
- {{ range $activeIncidents }} + {{ range $active }}

{{ .Title }} → @@ -19,7 +21,7 @@ {{ end }}

- {{ .Content | safeHTML | truncate 500 "…" }} + {{ .Content | safeHTML | truncate 500 "…" }}


-- cgit v1.2.3-70-g09d2