Fix Hugo compatibility: handle nil File objects in footer
This commit is contained in:
parent
288932b4af
commit
165c7593a9
@ -37,9 +37,14 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
{{ $footer := print "_footer." .Lang }}
|
{{ $footer := print "_footer." .Lang }}
|
||||||
{{ range where .Site.Pages "File.BaseFileName" $footer }}
|
{{ $found := false }}
|
||||||
|
{{ range .Site.Pages }}
|
||||||
|
{{ if and .File (eq .File.BaseFileName $footer) }}
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
{{else}}
|
{{ $found = true }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if not $found }}
|
||||||
{{ if .Site.GetPage "page" "_footer.md" }}
|
{{ if .Site.GetPage "page" "_footer.md" }}
|
||||||
{{(.Site.GetPage "page" "_footer.md").Content}}
|
{{(.Site.GetPage "page" "_footer.md").Content}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user