fix(partials): Footer rendering bug (#33)
* conditional rendering: render footer if `layouts/footer.md` exists and has content; fallback if empty or missing * Resolved #33 * Caused by a0684e5add17d66d951b691c747981f1c32f91da
This commit is contained in:
parent
54b49193a0
commit
430d4115f2
@ -1,8 +1,9 @@
|
||||
{{ if site.Params.theme_config.isShowFooter }}
|
||||
{{ with resources.Get "layouts/footer.md" }}
|
||||
{{ .Content | markdownify }}
|
||||
{{ $footerContent := readFile "layouts/footer.md" }}
|
||||
{{ if and $footerContent (ne $footerContent "") }}
|
||||
{{ $footerContent | markdownify }}
|
||||
{{ else }}
|
||||
{{ warnf "layouts/footer.md file is not found, fallback to the default copyright" }}
|
||||
{{ warnf "layouts/footer.md file is not found or empty. Falling back to default footer." }}
|
||||
<footer class="site-footer">
|
||||
<p>© {{ now.Format "2006" }} {{ site.Title }}</p>
|
||||
</footer>
|
||||
|
Loading…
x
Reference in New Issue
Block a user