From aa9c2a089b76ee3d2a9196651cfb2d0ea4113c84 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Wed, 14 Jul 2021 13:21:58 +0800 Subject: [PATCH] article-footer --- .../_partial/main/article/article_footer.ejs | 18 +++++++++++++++--- source/css/_layout/partial/article-footer.styl | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/layout/_partial/main/article/article_footer.ejs b/layout/_partial/main/article/article_footer.ejs index 99e38cb..9f09964 100644 --- a/layout/_partial/main/article/article_footer.ejs +++ b/layout/_partial/main/article/article_footer.ejs @@ -1,9 +1,21 @@ <% function layoutDiv() { - if (page.layout == 'wiki' && !page.references) { - return ''; + var el = ''; + var item = []; + if (page.references && page.references.length > 0) { + item.push('references'); + } + if (page.layout !== 'wiki') { + if (theme.article.license && theme.article.license.length > 0) { + item.push('license'); + } + if (theme.article.share && theme.article.share.length > 0) { + item.push('share'); + } + } + if (item.length === 0) { + return el; } - let el = ''; el += '
'; if (page.references && page.references.length > 0) { el += '
'; diff --git a/source/css/_layout/partial/article-footer.styl b/source/css/_layout/partial/article-footer.styl index a570c7a..ce43dec 100644 --- a/source/css/_layout/partial/article-footer.styl +++ b/source/css/_layout/partial/article-footer.styl @@ -4,6 +4,8 @@ background: var(--block) border-radius: $border-block border: 1px solid var(--block-border) + &:empty + display: none .header font-weight: 500 color: var(--text-p2)