site/layouts: add cluster to partialCached key

When we cache the output of partials we get duplicate elements be-
cause both ISEAL and FSC have "Scope", "Certificate", etc modules.
We need to use the cluster as an extra key for the partial cache
so these don't overlap.

See: https://gohugo.io/functions/partialcached/
This commit is contained in:
2022-02-06 21:30:25 +03:00
parent baa22a7afc
commit 1678ec077e
2 changed files with 17 additions and 8 deletions

View File

@ -33,12 +33,13 @@
{{/* it in the range below. */}}
{{ $context := . }}
{{ .Scratch.Set "cluster" "Fsc" }}
{{ $cluster := "Fsc" }}
{{ .Scratch.Set "cluster" $cluster }}
{{ $modules := slice "Assurance" "Certificate" "Coverage" "Evaluation" "Form" "Scope" "Status" }}
{{ range $modules }}
{{ $module := . }}
{{ $.Scratch.Set "module" $module }}
{{ partialCached "module-elements.html" $context $module }}
{{ partialCached "module-elements.html" $context $cluster $module }}
{{ end }}
<h2 id="download">Download</h2>