From 90b31903ef854c9eed917ea6b523fff465c48e7a Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Fri, 19 Nov 2021 22:59:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=8B=E9=93=BE=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/_partial/sidebar/index.ejs | 1 - scripts/tags/friends.js | 3 +++ source/css/_layout/tag-plugins/friends.styl | 3 ++- source/css/_layout/tag-plugins/sites.styl | 4 ++-- source/css/_layout/tag-plugins/timeline.styl | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/layout/_partial/sidebar/index.ejs b/layout/_partial/sidebar/index.ejs index 65ee1c8..e2a4680 100755 --- a/layout/_partial/sidebar/index.ejs +++ b/layout/_partial/sidebar/index.ejs @@ -15,7 +15,6 @@ if (page.sidebar == undefined) { } else if (page.layout == 'page') { page.sidebar = theme.sidebar.widget_layout.page; } else { - console.log('page.layout: ', page.layout); page.sidebar = []; } } diff --git a/scripts/tags/friends.js b/scripts/tags/friends.js index 95fd66b..4e99263 100644 --- a/scripts/tags/friends.js +++ b/scripts/tags/friends.js @@ -58,6 +58,9 @@ hexo.extend.tag.register('friends', function(args) { } if (groupId in friends) { let group = friends[groupId]; + if ((typeof group == 'object') && group.constructor == Array) { + group = {items: group}; + } if (group.title || group.description) { el += groupHeader(group); } diff --git a/source/css/_layout/tag-plugins/friends.styl b/source/css/_layout/tag-plugins/friends.styl index 8a66bdd..9ef08ae 100644 --- a/source/css/_layout/tag-plugins/friends.styl +++ b/source/css/_layout/tag-plugins/friends.styl @@ -13,7 +13,8 @@ display: flex flex-wrap: wrap align-items: stretch - margin-bottom: 2rem + &+.group-header + margin-top: 2rem .friendsjs-wrap display: block .loading-wrap diff --git a/source/css/_layout/tag-plugins/sites.styl b/source/css/_layout/tag-plugins/sites.styl index 6886e24..a67c45e 100644 --- a/source/css/_layout/tag-plugins/sites.styl +++ b/source/css/_layout/tag-plugins/sites.styl @@ -9,7 +9,8 @@ font-weight: 500 .group-body width: 100% - margin-bottom: 2rem + &+.group-header + margin-top: 2rem .sitesjs-wrap display: block .loading-wrap @@ -29,7 +30,6 @@ grid-template-columns: repeat(auto-fill, "calc((100% - 2 * %s) / 3)" % 1rem) @media screen and (max-width: $device-mobile) grid-template-columns: repeat(auto-fill, "calc((100% - 1 * %s) / 2)" % 1rem) - margin-bottom: 2rem .sites-wrap .group-body .site-card .card-link width: 100% diff --git a/source/css/_layout/tag-plugins/timeline.styl b/source/css/_layout/tag-plugins/timeline.styl index e97e402..5d21615 100644 --- a/source/css/_layout/tag-plugins/timeline.styl +++ b/source/css/_layout/tag-plugins/timeline.styl @@ -18,7 +18,7 @@ display: flex flex-direction: column align-items: flex-start - max-width: 100% + max-width: 'calc(100% - %s)' % 1rem >.header, >.body max-width: @max-width &[highlight] .header:before