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