From 0f6b5271bc639cecea91f68858231a763ce7d879 Mon Sep 17 00:00:00 2001 From: sli1989 Date: Tue, 17 Jul 2018 22:31:37 +0800 Subject: [PATCH 01/10] Fix post-spread invisible in Gemini --- source/css/_schemes/Gemini/index.styl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/css/_schemes/Gemini/index.styl b/source/css/_schemes/Gemini/index.styl index 11c77702b1..cfe5aa9975 100644 --- a/source/css/_schemes/Gemini/index.styl +++ b/source/css/_schemes/Gemini/index.styl @@ -78,7 +78,8 @@ use_seo = hexo-config('seo'); // Post delimiters. .post-eof, .post-spread { - hide(); + margin-top: 0px; + background: white; } // Pagination. From 04fe6cdba87a957ab341a192e450618d9eb1847c Mon Sep 17 00:00:00 2001 From: sli1989 Date: Wed, 18 Jul 2018 15:05:06 +0800 Subject: [PATCH 02/10] Refactor the baidushare within post-widgets --- layout/_macro/baidushare.swig | 57 +++++++++++++++++++ layout/_macro/post.swig | 6 +- layout/post.swig | 2 - source/css/_common/components/post/post.styl | 2 +- .../components/third-party/baidushare.styl | 10 +--- source/css/_schemes/Gemini/index.styl | 3 +- 6 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 layout/_macro/baidushare.swig diff --git a/layout/_macro/baidushare.swig b/layout/_macro/baidushare.swig new file mode 100644 index 0000000000..6be489844e --- /dev/null +++ b/layout/_macro/baidushare.swig @@ -0,0 +1,57 @@ +{% if theme.baidushare.type === "button" %} +
+ + + + + + + + + + +
+ +{% elseif theme.baidushare.type === "slide" %} + +{% endif %} + diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index ba7141fd09..aeae1f4a8e 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -379,7 +379,7 @@ {% endif %} {% if not is_index %} - {% if theme.rating.enable or (theme.vkontakte_api.enable and theme.vkontakte_api.like) or (theme.facebook_sdk.enable and theme.facebook_sdk.like_button) or (theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable) %} + {% if theme.rating.enable or (theme.vkontakte_api.enable and theme.vkontakte_api.like) or (theme.facebook_sdk.enable and theme.facebook_sdk.like_button) or (theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable) or (theme.baidushare and theme.baidushare.type === "button" )%}
{% if theme.rating.enable %}
@@ -403,6 +403,10 @@
{% endif %} + {% if theme.baidushare and theme.baidushare.type === "button" %} + {% include 'baidushare.swig' %} + {% endif %} + {% if theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable %} {% if (theme.vkontakte_api.enable and theme.vkontakte_api.like) or (theme.facebook_sdk.enable and theme.facebook_sdk.like_button) %} diff --git a/layout/post.swig b/layout/post.swig index ddfdddeabb..658d96029f 100644 --- a/layout/post.swig +++ b/layout/post.swig @@ -16,8 +16,6 @@
{% if theme.jiathis %} {% include '_partials/share/jiathis.swig' %} - {% elseif theme.baidushare %} - {% include '_partials/share/baidushare.swig' %} {% elseif theme.add_this_id %} {% include '_partials/share/add-this.swig' %} {% endif %} diff --git a/source/css/_common/components/post/post.styl b/source/css/_common/components/post/post.styl index 9ca7c9be2b..840a6fe85b 100644 --- a/source/css/_common/components/post/post.styl +++ b/source/css/_common/components/post/post.styl @@ -56,6 +56,6 @@ @import "post-gallery"; @import "post-reward" if hexo-config('alipay') or hexo-config('wechatpay') or hexo-config('bitcoin'); @import "post-copyright" if hexo-config('post_copyright.enable'); -@import "post-widgets" if (hexo-config('facebook_sdk.enable') and hexo-config('facebook_sdk.like_button')) or (hexo-config('vkontakte_api.enable') and hexo-config('vkontakte_api.like')) or hexo-config('rating.enable') or (hexo-config('needmoreshare2.enable') and hexo-config('needmoreshare2.postbottom.enable')); +@import "post-widgets" if (hexo-config('facebook_sdk.enable') and hexo-config('facebook_sdk.like_button')) or (hexo-config('vkontakte_api.enable') and hexo-config('vkontakte_api.like')) or hexo-config('rating.enable') or (hexo-config('needmoreshare2.enable') and hexo-config('needmoreshare2.postbottom.enable')) or (hexo-config('baidushare') and hexo-config('baidushare.type === "button"')); @import "post-rtl"; @import "post-reading_progress" if hexo-config('reading_progress.enable'); diff --git a/source/css/_common/components/third-party/baidushare.styl b/source/css/_common/components/third-party/baidushare.styl index fc42b713d4..e67c712e4b 100644 --- a/source/css/_common/components/third-party/baidushare.styl +++ b/source/css/_common/components/third-party/baidushare.styl @@ -1,12 +1,8 @@ -.post-spread { - margin-top: 20px; - text-align: center; -} - .bdshare-slide-button-box a { border: none; } .bdsharebuttonbox { - display: inline-block; - + margin-top: 20px; + display: flex; + justify-content: center; a { border: none; } } diff --git a/source/css/_schemes/Gemini/index.styl b/source/css/_schemes/Gemini/index.styl index cfe5aa9975..11c77702b1 100644 --- a/source/css/_schemes/Gemini/index.styl +++ b/source/css/_schemes/Gemini/index.styl @@ -78,8 +78,7 @@ use_seo = hexo-config('seo'); // Post delimiters. .post-eof, .post-spread { - margin-top: 0px; - background: white; + hide(); } // Pagination. From f937114cce2bb9c8cd0191fff4876b5fd4d7bd9c Mon Sep 17 00:00:00 2001 From: sli1989 Date: Wed, 18 Jul 2018 15:08:59 +0800 Subject: [PATCH 03/10] Remove baidushare.swig --- layout/_partials/share/baidushare.swig | 57 -------------------------- 1 file changed, 57 deletions(-) delete mode 100644 layout/_partials/share/baidushare.swig diff --git a/layout/_partials/share/baidushare.swig b/layout/_partials/share/baidushare.swig deleted file mode 100644 index 6be489844e..0000000000 --- a/layout/_partials/share/baidushare.swig +++ /dev/null @@ -1,57 +0,0 @@ -{% if theme.baidushare.type === "button" %} -
- - - - - - - - - - -
- -{% elseif theme.baidushare.type === "slide" %} - -{% endif %} - From c9ecf2aeefe6b9b030c16c77449591936d1c8bbd Mon Sep 17 00:00:00 2001 From: sli1989 Date: Thu, 19 Jul 2018 16:22:10 +0800 Subject: [PATCH 04/10] Add slide mode support --- layout/_layout.swig | 6 ++++++ layout/_macro/post.swig | 4 +++- layout/{_macro => _partials/share}/baidushare.swig | 0 source/css/_common/components/post/post-widgets.styl | 8 ++++++++ source/css/_common/components/post/post.styl | 2 +- source/css/_common/components/third-party/baidushare.styl | 8 -------- .../css/_common/components/third-party/third-party.styl | 1 - 7 files changed, 18 insertions(+), 11 deletions(-) rename layout/{_macro => _partials/share}/baidushare.swig (100%) delete mode 100644 source/css/_common/components/third-party/baidushare.styl diff --git a/layout/_layout.swig b/layout/_layout.swig index 23019f2fab..fb94ddf855 100644 --- a/layout/_layout.swig +++ b/layout/_layout.swig @@ -80,6 +80,12 @@
{% endif %} + + {% if theme.baidushare and theme.baidushare.type === "slide" %} +
+ {% include '_partials/share/baidushare.swig' %} +
+ {% endif %}
diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index aeae1f4a8e..2148ac5b27 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -404,7 +404,9 @@ {% endif %} {% if theme.baidushare and theme.baidushare.type === "button" %} - {% include 'baidushare.swig' %} +
+ {% include '../_partials/share/baidushare.swig' %} +
{% endif %} {% if theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable %} diff --git a/layout/_macro/baidushare.swig b/layout/_partials/share/baidushare.swig similarity index 100% rename from layout/_macro/baidushare.swig rename to layout/_partials/share/baidushare.swig diff --git a/source/css/_common/components/post/post-widgets.styl b/source/css/_common/components/post/post-widgets.styl index 4914c5a154..c1753f6e80 100644 --- a/source/css/_common/components/post/post-widgets.styl +++ b/source/css/_common/components/post/post-widgets.styl @@ -39,3 +39,11 @@ height: 30px; align-self: center; } + +.bdsharebuttonbox { + margin-top: 20px; + display: flex; + justify-content: center; + a { border: none; } +} +.bdshare-slide-button-box a { border: none; } \ No newline at end of file diff --git a/source/css/_common/components/post/post.styl b/source/css/_common/components/post/post.styl index 840a6fe85b..7ba696ec0a 100644 --- a/source/css/_common/components/post/post.styl +++ b/source/css/_common/components/post/post.styl @@ -56,6 +56,6 @@ @import "post-gallery"; @import "post-reward" if hexo-config('alipay') or hexo-config('wechatpay') or hexo-config('bitcoin'); @import "post-copyright" if hexo-config('post_copyright.enable'); -@import "post-widgets" if (hexo-config('facebook_sdk.enable') and hexo-config('facebook_sdk.like_button')) or (hexo-config('vkontakte_api.enable') and hexo-config('vkontakte_api.like')) or hexo-config('rating.enable') or (hexo-config('needmoreshare2.enable') and hexo-config('needmoreshare2.postbottom.enable')) or (hexo-config('baidushare') and hexo-config('baidushare.type === "button"')); +@import "post-widgets" if (hexo-config('facebook_sdk.enable') and hexo-config('facebook_sdk.like_button')) or (hexo-config('vkontakte_api.enable') and hexo-config('vkontakte_api.like')) or hexo-config('rating.enable') or (hexo-config('needmoreshare2.enable') and hexo-config('needmoreshare2.postbottom.enable')) or hexo-config('baidushare'); @import "post-rtl"; @import "post-reading_progress" if hexo-config('reading_progress.enable'); diff --git a/source/css/_common/components/third-party/baidushare.styl b/source/css/_common/components/third-party/baidushare.styl deleted file mode 100644 index e67c712e4b..0000000000 --- a/source/css/_common/components/third-party/baidushare.styl +++ /dev/null @@ -1,8 +0,0 @@ -.bdshare-slide-button-box a { border: none; } - -.bdsharebuttonbox { - margin-top: 20px; - display: flex; - justify-content: center; - a { border: none; } -} diff --git a/source/css/_common/components/third-party/third-party.styl b/source/css/_common/components/third-party/third-party.styl index 0896976b1a..e7c0c5c257 100644 --- a/source/css/_common/components/third-party/third-party.styl +++ b/source/css/_common/components/third-party/third-party.styl @@ -1,7 +1,6 @@ @import "gitment" if hexo-config('gitment.enable'); @import "jiathis"; @import "han"; -@import "baidushare"; @import "localsearch"; @import "busuanzi-counter"; @import "algolia-search" if hexo-config('algolia_search.enable'); From ed602af4baf75e5f771e5ff49c6951be069ca13b Mon Sep 17 00:00:00 2001 From: sli1989 Date: Thu, 19 Jul 2018 18:58:07 +0800 Subject: [PATCH 05/10] Fix widgets position --- layout/_macro/post.swig | 30 +++++++++++-------- .../_common/components/post/post-widgets.styl | 4 +-- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 2148ac5b27..404a322ee3 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -388,6 +388,9 @@ {% endif %} {% if (theme.vkontakte_api.enable and theme.vkontakte_api.like) or (theme.facebook_sdk.enable and theme.facebook_sdk.like_button) %} + {% if theme.rating.enable %} + + {% endif %} {% include '_scripts/vendors.swig' %} diff --git a/layout/post.swig b/layout/post.swig index 658d96029f..65a6361919 100644 --- a/layout/post.swig +++ b/layout/post.swig @@ -16,8 +16,6 @@
{% if theme.jiathis %} {% include '_partials/share/jiathis.swig' %} - {% elseif theme.add_this_id %} - {% include '_partials/share/add-this.swig' %} {% endif %}
From cfdd0c00970b9aa71fef40de9359450de2670efe Mon Sep 17 00:00:00 2001 From: sli1989 Date: Thu, 19 Jul 2018 20:10:54 +0800 Subject: [PATCH 09/10] Delete jiathis share because of closed officially --- _config.yml | 8 +----- layout/_partials/share/jiathis.swig | 25 ------------------- layout/post.swig | 6 ----- .../components/third-party/jiathis.styl | 10 -------- .../components/third-party/third-party.styl | 1 - 5 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 layout/_partials/share/jiathis.swig delete mode 100644 source/css/_common/components/third-party/jiathis.styl diff --git a/_config.yml b/_config.yml index e4775d96bd..d3de0c0ce9 100644 --- a/_config.yml +++ b/_config.yml @@ -537,13 +537,7 @@ gitment: #baidushare: ## type: button -# Share -# This plugin is more useful in China, make sure you known how to use it. -# And you can find the use guide at official webiste: http://www.jiathis.com/. -# Warning: JiaThis does not support https. -#jiathis: - ##uid: Get this uid from http://www.jiathis.com/ - +# addthis Share, see: https://www.addthis.com/ #add_this_id: # NeedMoreShare2 diff --git a/layout/_partials/share/jiathis.swig b/layout/_partials/share/jiathis.swig deleted file mode 100644 index 325135220a..0000000000 --- a/layout/_partials/share/jiathis.swig +++ /dev/null @@ -1,25 +0,0 @@ - - - - - \ No newline at end of file diff --git a/layout/post.swig b/layout/post.swig index 65a6361919..b778c9c81e 100644 --- a/layout/post.swig +++ b/layout/post.swig @@ -12,12 +12,6 @@
{{ post_template.render(page) }} - -
- {% if theme.jiathis %} - {% include '_partials/share/jiathis.swig' %} - {% endif %} -
{% endblock %} diff --git a/source/css/_common/components/third-party/jiathis.styl b/source/css/_common/components/third-party/jiathis.styl deleted file mode 100644 index d501fb5034..0000000000 --- a/source/css/_common/components/third-party/jiathis.styl +++ /dev/null @@ -1,10 +0,0 @@ -.post-spread { - margin-top: 20px; - text-align: center; -} - -.jiathis_style { - display: inline-block; - - a { border: none; } -} \ No newline at end of file diff --git a/source/css/_common/components/third-party/third-party.styl b/source/css/_common/components/third-party/third-party.styl index e7c0c5c257..cb14c9f4d2 100644 --- a/source/css/_common/components/third-party/third-party.styl +++ b/source/css/_common/components/third-party/third-party.styl @@ -1,5 +1,4 @@ @import "gitment" if hexo-config('gitment.enable'); -@import "jiathis"; @import "han"; @import "localsearch"; @import "busuanzi-counter"; From a6e4ef31b0e32c941b3f83496bca269f5fd40495 Mon Sep 17 00:00:00 2001 From: sli1989 Date: Fri, 20 Jul 2018 11:58:22 +0800 Subject: [PATCH 10/10] Update divider position --- source/css/_common/components/post/post-widgets.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/css/_common/components/post/post-widgets.styl b/source/css/_common/components/post/post-widgets.styl index be265f7118..2b6b18ff9b 100644 --- a/source/css/_common/components/post/post-widgets.styl +++ b/source/css/_common/components/post/post-widgets.styl @@ -8,7 +8,7 @@ align-items: center; .post-meta-divider { - height: 20px; + height: 25px; color: $grey-dark; } }