diff options
author | Mantas Vilčinskas <hi@mnts.lt> | 2022-07-13 18:02:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-13 18:02:03 +0300 |
commit | 5a80920562981838d51230961fc02644b86d1149 (patch) | |
tree | 81a4bcc24eb271881a22e8c71d12fba08c75c691 /layouts/partials | |
parent | edfef8162c3a9d796ae67128d3d8c65b4d0784a6 (diff) |
Expose all variables to partials (thanks @jhanos)
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/index/components.html | 16 |
1 files changed, 8 insertions, 8 deletions
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 }} <div class="components"> - {{ 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" }} <div class="component" data-status="{{ if $thisIsDown }}down{{ else }}{{ if $thisIsDisrupted }}disrupted{{ else }}{{ if $thisIsNotice }}notice{{ else }}ok{{ end }}{{ end }}{{ end }}"> - <a href="{{ printf "/affected/%s/" (.name | urlize) | relURL }}" class="no-underline"> - {{ default .name .displayName }} + <a href="{{ printf "/affected/%s/" ($system.name | urlize) | relURL }}" class="no-underline"> + {{ default $system.name $system.displayName }} </a> - {{ with .description }} + {{ with $system.description }} <span class="tooltip tooltip--small"> <span class="faded">(?)</span> @@ -65,7 +65,7 @@ </span> {{ end }} - {{ with .link }} + {{ with $system.link }} <span class="span-icon"> <a href="{{ . }}" class="link-style"> 🔗 @@ -87,9 +87,9 @@ {{ end }}{{ end }}{{ end }} </span> - {{ with .partial }} + {{ with $system.partial }} <div> - {{ partial . . }} + {{ partial . (dict "system" $system "incidents" $incidents) }} </div> {{ end }} </div> |