mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
fix: pass context to the hook partial (#2749)
This commit fixes a bug of the context not being passed to the hook partial.
This commit is contained in:
parent
f347d63546
commit
0d8a6eb42e
1 changed files with 2 additions and 1 deletions
|
@ -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 }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue