diff options
| author | Eltrac <hi@guhub.cn> | 2025-01-09 13:31:11 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-01-09 13:31:11 +0800 |
| commit | accf949f4886a477d85c598211ef773a8021c002 (patch) | |
| tree | ff5b1587788420d4a5547610d76d97482b6c66bf | |
| parent | 27a42e2db163b21f1de3f69c2c10a21545968945 (diff) | |
refactor(theme): footer links in yaml configuration
| -rw-r--r-- | assets/css/components/_footer.scss | 2 | ||||
| -rw-r--r-- | hugo.yaml | 16 | ||||
| -rw-r--r-- | layouts/partials/footer.html | 14 |
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; @@ -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> |
