diff --git a/_config.yml b/_config.yml index b3c34a7a42..1a85ffe2c4 100644 --- a/_config.yml +++ b/_config.yml @@ -622,6 +622,24 @@ gitalk: # Go to https://www.addthis.com/dashboard to customize your tools. #add_this_id: +# Likely Share +# See: https://ilyabirman.net/projects/likely/ +# Likely supports four looks, nine social networks, any button text +# You are free to modify the text value and order of any network +likely: + enable: false + look: normal # available values: normal, light, small, big + networks: + twitter: Tweet + facebook: Share + linkedin: Link + gplus: Plus + vkontakte: Share + odnoklassniki: Class + telegram: Send + whatsapp: Send + pinterest: Pin + # NeedMoreShare2 # Dependencies: https://github.com/theme-next/theme-next-needmoreshare2 # See: https://github.com/revir/need-more-share2, https://github.com/DzmVasileusky/needShareButton @@ -1110,6 +1128,14 @@ vendors: gitalk_css: md5: + # likely + # See: https://github.com/ilyabirman/Likely + # Example: + # likely_js: //cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.js + # likely_css: //cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.css + likely_js: + likely_css: + # Assets css: css js: js diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 9f897061b9..6e29f9d631 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -369,7 +369,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) or (theme.baidushare and theme.baidushare.type === "button") %} + {% 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.likely.enable or (theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable) or (theme.baidushare and theme.baidushare.type === "button") %}
{% if theme.rating.enable %}
@@ -396,14 +396,14 @@
{% endif %} - {% if (theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable) or (theme.baidushare.type === "button") %} + {% if theme.likely.enable or (theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable) or (theme.baidushare.type === "button") %} {% 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) %} | {% endif %}
- {% if theme.baidushare.type === "button" %} + {% if theme.likely.enable %}
- {% include '../_partials/share/baidushare.swig' %} + {% include '../_partials/share/likely.swig' %}
{% endif %} {% if theme.needmoreshare2.enable and theme.needmoreshare2.postbottom.enable %} @@ -413,6 +413,11 @@
{% endif %} + {% if theme.baidushare.type === "button" %} +
+ {% include '../_partials/share/baidushare.swig' %} +
+ {% endif %}
{% endif %} diff --git a/layout/_partials/share/likely.swig b/layout/_partials/share/likely.swig new file mode 100644 index 0000000000..272fec348d --- /dev/null +++ b/layout/_partials/share/likely.swig @@ -0,0 +1,23 @@ +{% set likely_js_url = '//cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.js' %} +{% if theme.vendors.likely_js %} + {% set likely_js_url = theme.vendors.likely_js %} +{% endif %} + + +{% set likely_css_url = '//cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.css' %} +{% if theme.vendors.likely_css %} + {% set likely_css_url = theme.vendors.likely_css %} +{% endif %} + + +{% if theme.likely.look == 'normal' %} + {% set likely_look = 'likely' %} +{% else %} + {% set likely_look = 'likely likely-' + theme.likely.look %} +{% endif %} + +
+ {% for x in theme.likely.networks %} +
{{ x }}
+ {% endfor %} +
diff --git a/source/css/_common/components/post/post.styl b/source/css/_common/components/post/post.styl index 9817f48f7d..d9f8b79d6e 100644 --- a/source/css/_common/components/post/post.styl +++ b/source/css/_common/components/post/post.styl @@ -61,6 +61,6 @@ @import "post-gallery"; @import "post-reward" if hexo-config('reward.alipay') or hexo-config('reward.wechatpay') or hexo-config('reward.bitcoin'); @import "post-copyright" if hexo-config('creative_commons.post'); -@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-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('likely.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');