From 5b78df294adba3794f751e051fee7ddf0bab8198 Mon Sep 17 00:00:00 2001 From: Lhcfl Date: Mon, 17 Jun 2024 01:37:47 +0800 Subject: [PATCH] chore: update social_links settings --- .github/asserts/anatolo_config.yml | 19 ++++++++++--------- README.md | 2 -- _config.example.yml | 22 ++++++++++++---------- layout/partial/social_links.pug | 19 ++++++++++++++++++- 4 files changed, 40 insertions(+), 22 deletions(-) diff --git a/.github/asserts/anatolo_config.yml b/.github/asserts/anatolo_config.yml index 9131aa2..0a6efc5 100644 --- a/.github/asserts/anatolo_config.yml +++ b/.github/asserts/anatolo_config.yml @@ -39,15 +39,16 @@ footbar: # Social Links # If you want to add more, go to sidebar.pug -github: https://github.com/Lhcfl -mail: lhcfl@outlook.com -zhihu: -QQ: -twitter: -instagram: -rss: -facebook: -weibo: +social: + github: https://github.com/Lhcfl + mail: lhcfl@outlook.com + zhihu: + QQ: + twitter: + instagram: + rss: + facebook: + weibo: # Nav menu menu: diff --git a/README.md b/README.md index a7d6a25..5f3937b 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,6 @@ Anatolo设计极致简约,但麻雀虽小,五脏理应俱全。因此,我 码云功能和一些中国特色功能来自 [Anatole-core](https://github.com/mrcore/hexo-theme-Anatole-Core) - - ## Todo List - 使用基于json的Ajax diff --git a/_config.example.yml b/_config.example.yml index de4dea5..f27297f 100644 --- a/_config.example.yml +++ b/_config.example.yml @@ -41,16 +41,18 @@ footbar: # Social Links -# If you want to add more, go to `social_links.pug` -github: https://github.com/Lhcfl -mail: yourname@example.com -zhihu: -QQ: -twitter: -instagram: -rss: -facebook: -weibo: +# The key is the icon name of font-awesome 6, and the value is a link +# except for mail. +social: + github: https://github.com/Lhcfl + mail: yourname@example.com + zhihu: + qq: + twitter: + instagram: + rss: + facebook: + weibo: # Nav menu menu: diff --git a/layout/partial/social_links.pug b/layout/partial/social_links.pug index d3f4bb2..6fe0636 100644 --- a/layout/partial/social_links.pug +++ b/layout/partial/social_links.pug @@ -1,4 +1,21 @@ ul.social-links + - var socials = Object.fromEntries(Object.entries(theme.social).filter((x) => x[1])); + each link, icon in socials + case icon + when "mail" + li + a(href="mailto:" + link) + i.fa.fa-envelope + when "rss" + li + a(href=link) + i.fa.fa-rss + default + li + a(href=link) + i.fab(class="fa-" + icon) + + //- deprecated if theme.github li a(href=theme.github) @@ -15,7 +32,7 @@ ul.social-links if theme.zhihu li a(href=theme.zhihu) - i.fa.fa-mortar-board + i.fa.fa-zhihu if theme.twitter li a(href=theme.twitter)