From eac25471bb6bb7a1bbcf041961e17875f8566ba9 Mon Sep 17 00:00:00 2001 From: razonyang Date: Sun, 16 Jun 2024 12:43:36 +0800 Subject: [PATCH] feat: allow using page store key as cache key by setting `cache_store_key` for hooks --- layouts/partials/hugopress/functions/render-hooks.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/hugopress/functions/render-hooks.html b/layouts/partials/hugopress/functions/render-hooks.html index 0d3095e..8eccb1e 100644 --- a/layouts/partials/hugopress/functions/render-hooks.html +++ b/layouts/partials/hugopress/functions/render-hooks.html @@ -25,6 +25,8 @@ {{- partialCached .partial $ctx (index $page.Params .cache_param_key) }} {{- else if ne .cache_site_param_key nil }} {{- partialCached .partial $ctx (index site.Params .cache_site_param_key) }} + {{- else if ne .cache_store_key nil }} + {{- partialCached .partial $ctx ($page.Store.Get .cache_store_key) }} {{- else }} {{- partialCached .partial $ctx }} {{- end }}