From 430d4115f27eaff8b1792bc47a35048e16be4ffc Mon Sep 17 00:00:00 2001 From: Younsung Lee Date: Thu, 12 Dec 2024 00:28:58 +0900 Subject: [PATCH] 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 --- layouts/partials/footer.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 3b9522e..b4474fc 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -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." }}