mirror of
https://github.com/tomfran/typo.git
synced 2025-04-25 13:09:54 +03:00
Fix get_hook function
This commit is contained in:
parent
fe5d64c3c8
commit
3865ee6a19
1 changed files with 2 additions and 6 deletions
|
@ -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 }}
|
Loading…
Add table
Add a link
Reference in a new issue