diff --git a/_config.yml b/_config.yml index 0089a5db77..1a4cb9fcb1 100755 --- a/_config.yml +++ b/_config.yml @@ -202,6 +202,9 @@ pages: # 友链页面配置 friends: layout_scheme: traditional # simple: 简单布局, traditional: 传统布局 + link_block_color: + enable: false #友链块颜色开关,用 color: '颜色' 字段 + unified_font: false # 是否统一友链块文字,true则所有文字都会成黑,false只有 ############################### Article Layout ############################### > start # 文章布局 diff --git a/layout/friends.ejs b/layout/friends.ejs index dcbc6e5a70..ad79b84921 100755 --- a/layout/friends.ejs +++ b/layout/friends.ejs @@ -17,8 +17,15 @@
<% getList(group.items).forEach(function(item){ %> <% if (item.url && item.title) { %> - + + style="<% if (item.color) { %>background-color: <%- item.color %>;<% } %> + <% if (theme.pages.friends.link_block_color.unified_font === true) { %>color: var(--link-color);<% } else { %> + <% if (item.color) { %>color: var(--link-color);<% } %> + <% } %>" + <% } %> + >
<% if (item.avatar) { %> @@ -47,7 +54,14 @@
<% getList(group.items).forEach(function(item){ %> <% if (item.url && item.title) { %> - + + style="<% if (item.color) { %>background-color: <%- item.color %>;<% } %> + <% if (theme.pages.friends.link_block_color.unified_font === true) { %>color: var(--link-color);<% } else { %> + <% if (item.color) { %>color: var(--link-color);<% } %> + <% } %>" + <% } %> + > <%- item.title %> diff --git a/source/css/_first/base_first.styl b/source/css/_first/base_first.styl index f6cb096f60..0708980e21 100644 --- a/source/css/_first/base_first.styl +++ b/source/css/_first/base_first.styl @@ -21,6 +21,7 @@ --color-read-bkg: $color-read-bkg --color-read-post: $color-read-post --color-copyright-bkg: $color-copyright-bkg + --link-color: #00323c * box-sizing: border-box diff --git a/source/css/_first/dark_first.styl b/source/css/_first/dark_first.styl index 4f339ce922..99ee503e48 100644 --- a/source/css/_first/dark_first.styl +++ b/source/css/_first/dark_first.styl @@ -25,6 +25,7 @@ fitst_dark() --color-meta: $color-dark-meta --color-link: $color-dark-link --color-copyright-bkg: $color-dark-copyright-bkg + --link-color:rgb(228, 228, 228) img filter: brightness(convert(hexo-config('color_scheme.dark.brightness'))) !important @@ -75,3 +76,6 @@ if hexo-config('plugins.darkmode.enable') fitst_dark() [color-scheme='dark'] fitst_dark() + .friend-card.color-bk-dark { + filter: brightness(0.8); + }