Merge pull request #34 from younsl/main

fix(partials): Footer rendering bug (#33)
This commit is contained in:
Hanwen Guo 2025-01-11 23:22:27 -07:00 committed by GitHub
commit 1bf2f17c57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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>&copy; {{ now.Format "2006" }} {{ site.Title }}</p>
</footer>