From 3a888c41c44dfd5a0a817eb0eeec74955c480086 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Tue, 3 Jan 2023 15:07:40 +0800 Subject: [PATCH] :bug: Fix: can not disable `params.footer.siteTime` --- config.toml | 1 + docs | 2 +- layouts/partials/assets.html | 6 ++++-- layouts/partials/footer.html | 18 ++++++++++-------- .../partials/init/detection-deprecated.html | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/config.toml b/config.toml index 581e3208..f47a40f7 100644 --- a/config.toml +++ b/config.toml @@ -181,6 +181,7 @@ license = 'CC BY-NC 4.0' # FixIt 0.2.17 | CHANGED Site creation time [params.footer.siteTime] + enable = false animate = true icon = "fa-solid fa-heartbeat" pre = "" diff --git a/docs b/docs index cb80c07b..7337263a 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit cb80c07b28ea21a1c9fcc4b25d634a5fb78c5232 +Subproject commit 7337263a886d4f34799d9f1b1854d49dd8a28dd6 diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index b4db2a76..54afc38f 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -232,8 +232,10 @@ {{- end -}} {{- /* Site creation time */ -}} -{{- with .Site.Params.footer.siteTime.value -}} - {{- $config = dict "siteTime" . | merge $config -}} +{{- if .Site.Params.footer.siteTime.enable -}} + {{- with .Site.Params.footer.siteTime.value -}} + {{- $config = dict "siteTime" . | merge $config -}} + {{- end -}} {{- end -}} {{- /* PWA */ -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 8669d986..1392d068 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -44,15 +44,17 @@ {{- end -}} - {{- if .Site.Params.footer.siteTime.value | or .Site.Params.footer.wordCount -}} + {{- if .Site.Params.footer.siteTime.enable | or .Site.Params.footer.wordCount -}}
{{- end -}} diff --git a/layouts/partials/init/detection-deprecated.html b/layouts/partials/init/detection-deprecated.html index aca01415..ff85a0cc 100644 --- a/layouts/partials/init/detection-deprecated.html +++ b/layouts/partials/init/detection-deprecated.html @@ -12,7 +12,7 @@ {{- $warns = $warns | append "The parameter `autoBookmark` is deprecated since v0.2.17, use `page.autoBookmark` instead." -}} {{- end -}} {{- with .Site.Params.footer.siteTime -}} - {{- if gt (len .) 4 -}} + {{- if gt (len .) 5 -}} {{- $errors = $errors | append "The parameter `footer.siteTime` has changed to an array since v0.2.17. Please correct the format!" -}} {{- end -}} {{- end -}}