From df678dfde2ee55aa35847de96aa82b80a0b832f5 Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 8 Mar 2022 18:00:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=AF=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E7=89=88=E6=AC=8A=E6=A8=A1=E5=A1=8A=E7=9A=84=E4=BD=9C?= =?UTF-8?q?=E8=80=85=E8=B6=85=E9=8F=88=E6=8E=A5=20feat:=20=E6=AD=B8?= =?UTF-8?q?=E6=AA=94=E9=A0=81=E9=9D=A2=E7=9A=84=E5=81=B4=E9=82=8A=E6=AC=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=9A=B1=E8=97=8F=20improvement:=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0social-share=20cdn=20=E7=89=88=E6=9C=AC=20improvement:?= =?UTF-8?q?=20=E8=AA=BF=E6=95=B4=E5=88=86=E4=BA=AB=E6=8C=89=E9=88=95?= =?UTF-8?q?=E5=B0=8E=E8=87=B4=E7=9A=84=E9=96=93=E8=B7=9D=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=20improvement:=20html/css=20=E5=84=AA=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/stale.yml | 2 +- _config.yml | 2 + layout/includes/layout.pug | 1 + layout/includes/post/post-copyright.pug | 8 ++-- layout/includes/sidebar.pug | 25 +++++------ .../comments/facebook_comments.pug | 2 +- layout/includes/widget/card_author.pug | 25 +++++------ scripts/events/config.js | 4 +- source/css/_global/function.styl | 2 +- source/css/_layout/aside.styl | 41 +++++++++++-------- source/css/_layout/post.styl | 7 +++- source/css/_layout/sidebar.styl | 18 +------- 12 files changed, 63 insertions(+), 74 deletions(-) diff --git a/.github/stale.yml b/.github/stale.yml index 2d74a9c..ff7578d 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -10,7 +10,7 @@ exemptLabels: - enhancement - documentation # Label to use when marking an issue as stale -staleLabel: wontfix +staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had diff --git a/_config.yml b/_config.yml index 7aa9218..3fea2ad 100644 --- a/_config.yml +++ b/_config.yml @@ -183,6 +183,7 @@ toc: post_copyright: enable: true decode: false + author_href: license: CC BY-NC-SA 4.0 license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/ @@ -616,6 +617,7 @@ aside: button: true mobile: true # display on mobile position: right # left or right + archives: true card_author: enable: true description: diff --git a/layout/includes/layout.pug b/layout/includes/layout.pug index 5245cce..aabce94 100644 --- a/layout/includes/layout.pug +++ b/layout/includes/layout.pug @@ -1,4 +1,5 @@ - var htmlClassHideAside = theme.aside.enable && theme.aside.hide ? 'hide-aside' : '' +- page.aside = is_archive() ? theme.aside.archives : page.aside - var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : '' - var pageType = is_post() ? 'post' : 'page' diff --git a/layout/includes/post/post-copyright.pug b/layout/includes/post/post-copyright.pug index dfa346d..8c7ca03 100644 --- a/layout/includes/post/post-copyright.pug +++ b/layout/includes/post/post-copyright.pug @@ -1,8 +1,8 @@ if theme.post_copyright.enable && page.copyright !== false - - let author = page.copyright_author ? page.copyright_author : config.author - - let authorHref = page.copyright_author_href ? page.copyright_author_href : `mailto:${config.email}` - - let url = page.copyright_url ? page.copyright_url : page.permalink - - let info = page.copyright_info ? page.copyright_info : _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title) + - let author = page.copyright_author || config.author + - let authorHref = page.copyright_author_href || theme.post_copyright.author_href || config.url + - let url = page.copyright_url || page.permalink + - let info = page.copyright_info || _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title) .post-copyright .post-copyright__author span.post-copyright-meta= _p('post.copyright.author') + ": " diff --git a/layout/includes/sidebar.pug b/layout/includes/sidebar.pug index 45a97ee..11bddf8 100644 --- a/layout/includes/sidebar.pug +++ b/layout/includes/sidebar.pug @@ -3,21 +3,16 @@ #sidebar-menus .avatar-img.is-center img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.error_img.flink}'` alt="avatar") - .site-data.is-center - .data-item - a(href=url_for(config.archive_dir) + '/') - .headline= _p('aside.articles') - .length-num= site.posts.length - - .data-item - a(href=url_for(config.tag_dir) + '/' ) - .headline= _p('aside.tags') - .length-num= site.tags.length - - .data-item - a(href=url_for(config.category_dir) + '/') - .headline= _p('aside.categories') - .length-num= site.categories.length + .sidebar-site-data.site-data.is-center + a(href=url_for(config.archive_dir) + '/') + .headline= _p('aside.articles') + .length-num= site.posts.length + a(href=url_for(config.tag_dir) + '/' ) + .headline= _p('aside.tags') + .length-num= site.tags.length + a(href=url_for(config.category_dir) + '/') + .headline= _p('aside.categories') + .length-num= site.categories.length hr !=partial('includes/header/menu_item', {}, {cache: true}) diff --git a/layout/includes/third-party/comments/facebook_comments.pug b/layout/includes/third-party/comments/facebook_comments.pug index c1ae68d..64879b0 100644 --- a/layout/includes/third-party/comments/facebook_comments.pug +++ b/layout/includes/third-party/comments/facebook_comments.pug @@ -7,7 +7,7 @@ script. if (typeof FB === 'object') FB.XFBML.parse() else { let ele = document.createElement('script') - ele.setAttribute('src','https://connect.facebook.net/!{theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v13.0&autoLogAppEvents=1') + ele.setAttribute('src','https://connect.facebook.net/!{theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v13.0&appId=!{theme.facebook_comments.app_id}&autoLogAppEvents=1') ele.setAttribute('async', 'true') ele.setAttribute('defer', 'true') ele.setAttribute('crossorigin', 'anonymous') diff --git a/layout/includes/widget/card_author.pug b/layout/includes/widget/card_author.pug index 0fa860a..de71edb 100644 --- a/layout/includes/widget/card_author.pug +++ b/layout/includes/widget/card_author.pug @@ -6,21 +6,16 @@ if theme.aside.card_author.enable .author-info__name= config.author .author-info__description!= theme.aside.card_author.description || config.description - .card-info-data.is-center - .card-info-data-item - a(href=url_for(config.archive_dir) + '/') - .headline= _p('aside.articles') - .length-num= site.posts.length - - .card-info-data-item - a(href=url_for(config.tag_dir) + '/') - .headline= _p('aside.tags') - .length-num= site.tags.length - - .card-info-data-item - a(href=url_for(config.category_dir) + '/') - .headline= _p('aside.categories') - .length-num= site.categories.length + .card-info-data.site-data.is-center + a(href=url_for(config.archive_dir) + '/') + .headline= _p('aside.articles') + .length-num= site.posts.length + a(href=url_for(config.tag_dir) + '/') + .headline= _p('aside.tags') + .length-num= site.tags.length + a(href=url_for(config.category_dir) + '/') + .headline= _p('aside.categories') + .length-num= site.categories.length if theme.aside.card_author.button.enable a#card-info-btn(href=theme.aside.card_author.button.link) diff --git a/scripts/events/config.js b/scripts/events/config.js index c324033..3f2a807 100644 --- a/scripts/events/config.js +++ b/scripts/events/config.js @@ -80,7 +80,7 @@ hexo.extend.filter.register('before_generate', () => { local: '/js/lib/disqusjs/disqusjs.css' }, twikoo: { - cdn: 'https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js', + cdn: 'https://cdn.jsdelivr.net/npm/twikoo@1/dist/twikoo.all.min.js', local: '/js/lib/twikoo/twikoo.all.min.js' }, waline: { @@ -88,7 +88,7 @@ hexo.extend.filter.register('before_generate', () => { local: '/js/lib/waline/Waline.min.js' }, sharejs: { - cdn: 'https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js', + cdn: 'https://cdn.jsdelivr.net/gh/overtrue/share.js@master/dist/js/social-share.min.js', local: '/js/lib/social-share.js/dist/social-share.min.js' }, sharejs_css: { diff --git a/source/css/_global/function.styl b/source/css/_global/function.styl index 7bc8d56..cf79eab 100644 --- a/source/css/_global/function.styl +++ b/source/css/_global/function.styl @@ -131,7 +131,7 @@ if hexo-config('enter_transitions') &.open for i in 1 2 3 4 > :nth-child({i}) - animation: sidebarItem (i / 5) s + animation: sidebarItem (i / 5)s .scroll-down-effects animation: scroll-down-effect 1.5s infinite diff --git a/source/css/_layout/aside.styl b/source/css/_layout/aside.styl index abb48b4..bc1675a 100644 --- a/source/css/_layout/aside.styl +++ b/source/css/_layout/aside.styl @@ -38,24 +38,7 @@ margin-top: -.42em .card-info-data - display: table margin: 14px 0 4px - width: 100% - table-layout: fixed - - & > .card-info-data-item - display: table-cell - - a - .headline - @extend .limit-one-line - color: var(--font-color) - font-size: 1em - - .length-num - margin-top: -.42em - color: var(--text-highlight-color) - font-size: 1.4em .card-info-social-icons margin: 6px 0 -6px @@ -340,6 +323,30 @@ &:hover transform: rotate(360deg) +.site-data + display: table + width: 100% + table-layout: fixed + + & > a + display: table-cell + + div + transition: all .3s + + &:hover + div + color: $theme-color !important + + .headline + @extend .limit-one-line + color: var(--font-color) + + .length-num + margin-top: -.32em + color: var(--text-highlight-color) + font-size: 1.4em + @keyframes more-btn-move 0%, 100% diff --git a/source/css/_layout/post.styl b/source/css/_layout/post.styl index e301801..aebae8d 100644 --- a/source/css/_layout/post.styl +++ b/source/css/_layout/post.styl @@ -152,6 +152,11 @@ beautify() #post .tag_share + &:after + display: block + clear: both + content: '' + .post-meta &__tag-list display: inline-block @@ -174,7 +179,7 @@ beautify() .post_share display: inline-block float: right - margin: 8px 0 20px + margin: 8px 0 0 width: fit-content .social-share diff --git a/source/css/_layout/sidebar.styl b/source/css/_layout/sidebar.styl index d557980..2e38ee8 100644 --- a/source/css/_layout/sidebar.styl +++ b/source/css/_layout/sidebar.styl @@ -25,24 +25,8 @@ & > .avatar-img margin: 20px auto - .site-data - display: table + .sidebar-site-data padding: 0 10px - width: 100% - table-layout: fixed - - .data-item - display: table-cell - - & > a > div - @extend .limit-one-line - - .length-num - color: var(--text-highlight-color) - font-size: 1.28em - - .headline - color: var(--font-color) hr margin: 20px auto