From 0d8a6eb42e5782620eaff769e5eb34307c5b16f2 Mon Sep 17 00:00:00 2001 From: Yury Zhauniarovich Date: Tue, 21 Jun 2022 19:15:32 +0300 Subject: [PATCH] fix: pass context to the hook partial (#2749) This commit fixes a bug of the context not being passed to the hook partial. --- wowchemy/layouts/partials/functions/get_hook.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wowchemy/layouts/partials/functions/get_hook.html b/wowchemy/layouts/partials/functions/get_hook.html index c1a0a0e4..5791dfb8 100644 --- a/wowchemy/layouts/partials/functions/get_hook.html +++ b/wowchemy/layouts/partials/functions/get_hook.html @@ -4,12 +4,13 @@ {{ $loaded := false }} {{ $partial_dir := printf "hooks/%s/" .hook }} +{{ $context := .context }} {{ $hook_dir_path := path.Join "layouts/partials" $partial_dir }} {{ if fileExists $hook_dir_path }} {{ range os.ReadDir $hook_dir_path }} {{ if not .IsDir }} {{ $partial_path := path.Join $partial_dir .Name }} - {{ partial $partial_path . }} + {{ partial $partial_path $context }} {{ $loaded = true }} {{ end }} {{ end }}