From 10d834fdab933a8e379541386790287233d9e949 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sun, 30 Oct 2022 21:23:26 +0800 Subject: [PATCH] sidebar timeline --- _data/links.yml | 2 +- _data/widgets.yml | 4 +++- layout/_partial/sidebar/widgets/timeline.ejs | 4 ++-- source/css/_layout/tag-plugins/timeline.styl | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/_data/links.yml b/_data/links.yml index d6f2061..a943f02 100644 --- a/_data/links.yml +++ b/_data/links.yml @@ -1,4 +1,4 @@ - +# 不要直接在这里写,要复制到 blog/source/_data/links.yml 位置 '示例': - title: XAOXUU avatar: https://bu.dusays.com/2021/09/24/2f74810ceb3d3.png diff --git a/_data/widgets.yml b/_data/widgets.yml index 1296f71..0e16f9a 100644 --- a/_data/widgets.yml +++ b/_data/widgets.yml @@ -67,4 +67,6 @@ timeline: layout: timeline title: 近期动态 api: # https://api.github.com/repos/xaoxuu/hexo-theme-stellar/issues - user: + user: # 默认显示所有人的数据,设置名称可过滤为仅显示某人的数据,多个名称用英文逗号隔开,不要加空格 + type: # 默认不用写,如果是友链朋友圈数据请写 fcircle + limit: # 默认通过 api 上增加 per_page 来设置,如果是友链朋友圈,可通过这个设置数量 diff --git a/layout/_partial/sidebar/widgets/timeline.ejs b/layout/_partial/sidebar/widgets/timeline.ejs index e04866d..08b6019 100644 --- a/layout/_partial/sidebar/widgets/timeline.ejs +++ b/layout/_partial/sidebar/widgets/timeline.ejs @@ -11,8 +11,8 @@ function layoutDiv() { el += ''; } el += '
'; - el += '
{ + el += '
{ if (item[key]) { el += ' ' + key + '="' + item[key] + '"'; } diff --git a/source/css/_layout/tag-plugins/timeline.styl b/source/css/_layout/tag-plugins/timeline.styl index 4dbe6e3..c9a096b 100644 --- a/source/css/_layout/tag-plugins/timeline.styl +++ b/source/css/_layout/tag-plugins/timeline.styl @@ -120,6 +120,7 @@ span color: inherit a.body + display: block color: var(--text-p1) trans2: transform box-shadow line-height: 1.25