File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
layouts/partials/hugopress/functions Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 19
19
{{- partialCached .partial $ctx (index (apply (slice 0) .cache_key) 0) }}
20
20
{{- else if ne .cache_param_key nil }}
21
21
{{- partialCached .partial $ctx (index $page.Params .cache_param_key) }}
22
+ {{- else if ne .cache_site_param_key nil }}
23
+ {{- partialCached .partial $ctx (index site.Params .cache_site_param_key) }}
22
24
{{- else }}
23
25
{{- partialCached .partial $ctx }}
24
26
{{- end }}
Original file line number Diff line number Diff line change 26
26
"module" $moduleName
27
27
"partial" $partial)
28
28
}}
29
+ {{/* Transform cache keys only once. */}}
30
+ {{- range slice "cache_param_key" "cache_site_param_key" }}
31
+ {{- $cacheKey := . }}
32
+ {{- with index $option $cacheKey }}
33
+ {{- $option = merge $option (dict $cacheKey (split . ".")) }}
34
+ {{- end }}
35
+ {{- end }}
29
36
{{- $hooks.Add $name (slice $option) }}
30
37
{{- end }}
31
38
{{- end }}
You can’t perform that action at this time.
0 commit comments