Skip to content

Commit

Permalink
feat: add the cache_param_key parameter to cache partials by page par…
Browse files Browse the repository at this point in the history
…ams (#50)
  • Loading branch information
razonyang authored May 30, 2024
1 parent 1e41958 commit fc51904
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion layouts/partials/hugopress/functions/render-hooks.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
{{- warnf "[hugopress] [%s] rendering hook: %q." .module .name }}
{{- end }}
{{- if .cacheable }}
{{- partialCached .partial $ctx }}
{{- if ne .cache_param_key "" }}
{{- partialCached .partial $ctx (index $page.Params .cache_param_key) }}
{{- else }}
{{- partialCached .partial $ctx }}
{{- end }}
{{- else }}
{{- partial .partial $ctx }}
{{- end }}
Expand Down

0 comments on commit fc51904

Please sign in to comment.