Fix get_hook function

This commit is contained in:
Corné Haasjes 2025-04-01 20:31:57 +02:00
parent fe5d64c3c8
commit 3865ee6a19

View file

@ -9,15 +9,11 @@
{{ $hook := .hook }}
{{ $context := .context }}
{{ $hookName := $hook.Name }}
{{ $hookType := $hook.Type }}
{{ if not (hasSuffix $hook ".html") }}
{{ $hook = printf "%s.html" $hook }}
{{ end }}
{{ $hook_path := path.Join "layouts/partials/hooks" $hook }}
{{ if fileExists $hook_path }}
{{ partial $hook_path $context }}
{{ if fileExists (path.Join "layouts/partials/hooks" $hook) }}
{{ partial (path.Join "hooks" $hook) $context }}
{{ end }}