From 714a656ca805a51cacdc87278f260ba7096f80f7 Mon Sep 17 00:00:00 2001
From: Cell <1024@lruihao.cn>
Date: Fri, 29 Dec 2023 21:26:10 +0800
Subject: [PATCH] :recycle: Refactor: refactor site footer and
params.footer.powered config
---
assets/css/_core/_footer.scss | 4 ---
assets/css/_partials/_icon.scss | 7 +++--
assets/fixit.svg | 1 -
assets/svg/fixit.svg | 11 +++++++
assets/svg/hugo.svg | 13 ++++++++
hugo.toml | 9 +++---
layouts/partials/footer.html | 53 +++++++++++++++++++--------------
7 files changed, 64 insertions(+), 34 deletions(-)
delete mode 100644 assets/fixit.svg
create mode 100644 assets/svg/fixit.svg
create mode 100644 assets/svg/hugo.svg
diff --git a/assets/css/_core/_footer.scss b/assets/css/_core/_footer.scss
index adcd7552..6c97bb53 100644
--- a/assets/css/_core/_footer.scss
+++ b/assets/css/_core/_footer.scss
@@ -20,10 +20,6 @@ footer {
margin-right: 0.25rem;
}
- .fixit-icon {
- top: 0.25em;
- }
-
.animate-icon {
color: #dc143c;
animation: icon-animate 1.33s ease-in-out infinite;
diff --git a/assets/css/_partials/_icon.scss b/assets/css/_partials/_icon.scss
index 8d50ba13..447aed38 100644
--- a/assets/css/_partials/_icon.scss
+++ b/assets/css/_partials/_icon.scss
@@ -17,11 +17,12 @@ img.emoji {
vertical-align: -0.1em;
}
+.hugo-icon,
.fixit-icon {
display: inline-block;
- height: 1.5em;
- width: 1.5em;
- line-height: 1.5em;
+ height: 1.2em;
+ width: 1.2em;
+ line-height: 1.2em;
position: relative;
vertical-align: text-bottom;
}
diff --git a/assets/fixit.svg b/assets/fixit.svg
deleted file mode 100644
index 28f64b1b..00000000
--- a/assets/fixit.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/svg/fixit.svg b/assets/svg/fixit.svg
new file mode 100644
index 00000000..6fdd7222
--- /dev/null
+++ b/assets/svg/fixit.svg
@@ -0,0 +1,11 @@
+
\ No newline at end of file
diff --git a/assets/svg/hugo.svg b/assets/svg/hugo.svg
new file mode 100644
index 00000000..2af8a1fa
--- /dev/null
+++ b/assets/svg/hugo.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/hugo.toml b/hugo.toml
index 83cdd5e9..1e7f789b 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -400,22 +400,23 @@ enableEmoji = true
# FixIt 0.2.17 | CHANGED Custom content (HTML format is supported)
# For advanced use, see parameter `params.customFilePath.footer`
custom = ""
- # whether to show Hugo and theme info
- hugo = true
# whether to show copyright info
copyright = true
# whether to show the author
author = true
# Site creation year
since = ""
- # FixIt 0.2.14 | NEW whether to show total word count of site content
- wordCount = true
# FixIt 0.2.12 | NEW Public network security only in China (HTML format is supported)
gov = ""
# ICP info only in China (HTML format is supported)
icp = ""
# license info (HTML format is supported)
license = ""
+ # FixIt 0.3.0 | NEW whether to show Hugo and theme info
+ [params.footer.powered]
+ enable = true
+ hugoLogo = true
+ themeLogo = true
# FixIt 0.2.17 | CHANGED Site creation time
[params.footer.siteTime]
enable = false
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index bfeddc7b..0588381a 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,27 +1,36 @@
-{{- if ne .Site.Params.footer.enable false -}}
+{{- $footerConfig := .Site.Params.footer -}}
+
+{{- if ne $footerConfig.enable false -}}