summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-01-09 13:31:11 +0800
committerEltrac <hi@guhub.cn>2025-01-09 13:31:11 +0800
commitdeb6fe038a42fc829394359008a69c47c2738f7d (patch)
treebec5a4672fa7b31cb820dbb6cd37c4c582985b0e
parent2be142d7aa72545b0527112f8843e14ca22ca22d (diff)
refactor(theme): footer links in yaml configuration
Former-commit-id: accf949f4886a477d85c598211ef773a8021c002
-rw-r--r--assets/css/components/_footer.scss2
-rw-r--r--hugo.yaml16
-rw-r--r--layouts/partials/footer.html14
3 files changed, 24 insertions, 8 deletions
diff --git a/assets/css/components/_footer.scss b/assets/css/components/_footer.scss
index 0b78faf2..b41c0a98 100644
--- a/assets/css/components/_footer.scss
+++ b/assets/css/components/_footer.scss
@@ -38,7 +38,7 @@
li {
display: inline-flex;
align-items: center;
- img {
+ img, svg {
height: 1rem;
width: auto;
display: inline-block;
diff --git a/hugo.yaml b/hugo.yaml
index 4f63bcd0..94389ee9 100644
--- a/hugo.yaml
+++ b/hugo.yaml
@@ -54,6 +54,22 @@ params:
link: /categories/稻草人周刊/
cover: https://image.guhub.cn/uPic/2025/01/%E7%A8%BB%E8%8D%89%E4%BA%BA%E5%91%A8%E5%88%8A.jpeg
description: 个人化的信息整合,每周一更新
+ footerLinks:
+ textLinks:
+ - name: Home
+ link: https://www.guhub.cn/
+ - name: Ultralime
+ link: https://www.ultrali.me
+ iconLinks:
+ - name: GitHub
+ link: https://github.com/BigCoke233/geek-death-project
+ icon: https://image.guhub.cn/uPic/2025/01/NqL5b5.png
+ - name: BLOGS·CN
+ link: https://blogscn.fun/
+ icon: https://photo.xiangming.site/img/blogscn_icon.png
+ - name: Travelling
+ link: https://www.travellings.cn/go.html
+ icon: https://www.travellings.cn/assets/favicon.png
services:
rss:
limit: 10
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index e57dba35..d5baa527 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -10,16 +10,16 @@
</section>
<section id="footer-links">
<ul class="footer-navigation">
- <li><a href="https://www.guhub.cn/">Home</a></li>
- <li><a href="https://www.ultrali.me">Ultralime</a></li>
+ {{ range .Site.Params.footerLinks.textLinks }}
+ <li><a href="{{ .link }}">{{ .name }}</a></li>
+ {{ end }}
</ul>
<ul class="footer-navigation">
- <li><a href="https://www.travellings.cn/go.html" target="_blank">
- <img src="https://www.travellings.cn/assets/favicon.png">
- </a></li>
- <li><a href="https://blogscn.fun/" title="BLOGS·CN" target="_blank">
- <img src="https://photo.xiangming.site/img/blogscn_icon.png">
+ {{ range .Site.Params.footerLinks.iconLinks }}
+ <li><a href="{{ .link }}" title="{{ .name }}" target="_blank">
+ <img src="{{ .icon }}" />
</a></li>
+ {{ end }}
</ul>
</section>
</footer>