Skip to content

Refactor the share tools within post-widgets#357

Merged
sli1989 merged 10 commits intotheme-next:masterfrom
sli1989:Gemini-post-spread
Jul 20, 2018
Merged

Refactor the share tools within post-widgets#357
sli1989 merged 10 commits intotheme-next:masterfrom
sli1989:Gemini-post-spread

Conversation

@sli1989
Copy link
Collaborator

@sli1989 sli1989 commented Jul 17, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes have been added (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs have been added / updated (for bug fixes / features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

.post-spread {
hide();
}

Issue Number(s): #356

What is the new behavior?

  • Remove the baidushare to the post-widgets like rating, like, needmoreshare2.

1
1_2
4
4_2

  • Remove the addthis share to container_class in _layout.swig.
  • Delete the jiathis share for officially closed on April 30, 2018.

How to use?

In NexT _config.yml:

...

Does this PR introduce a breaking change?

  • Yes.
  • No.

Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em.. Can we add baidu share not to .post-spread but to .post-widgets? Here all social widgets like FB / VK / Raiting.

@sli1989
Copy link
Collaborator Author

sli1989 commented Jul 17, 2018

There seems strange, the bottom line of post-block first displayed and then vanished.

ok, tomorrow look around.

.post-spread {
margin-top: 20px;
text-align: center;
}

@sli1989 sli1989 changed the title Fix post-spread invisible in Gemini Refactor the baidushare within post-widgets Jul 18, 2018
Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, test with all other widgets if it's possible.

{% endif %}

{% if theme.baidushare and theme.baidushare.type === "button" %}
{% include 'baidushare.swig' %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to rename from partials to macro here. Macro use {% macro render(name) %} (example), partials just included in other templates without any variables.

{% 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) %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need divider here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

baidushare.swig provides the <div class="bdsharebuttonbox">, still need?

<div class="bdsharebuttonbox">
<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
<a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a>
<a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
<a href="#" class="bds_tieba" data-cmd="tieba" title="分享到百度贴吧"></a>
<a href="#" class="bds_twi" data-cmd="twi" title="分享到Twitter"></a>
<a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a>
<a href="#" class="bds_more" data-cmd="more"></a>
<a class="bds_count" data-cmd="count"></a>
</div>

.bdsharebuttonbox {
display: inline-block;

margin-top: 20px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this styles to .post-widgets maybe?

layout/post.swig Outdated
@@ -16,8 +16,6 @@
<div class="post-spread">
{% if theme.jiathis %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to do same with jiathis?

layout/post.swig Outdated
{% include '_partials/share/jiathis.swig' %}
{% elseif theme.baidushare %}
{% include '_partials/share/baidushare.swig' %}
{% elseif theme.add_this_id %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to do same with add-this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, to be continued. ING

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jiathis and add-this will do in other pr.
How this looks now?

@sli1989 sli1989 changed the title Refactor the baidushare within post-widgets Refactor the share tools within post-widgets Jul 19, 2018
@sli1989 sli1989 added this to the v6.4.0 milestone Jul 19, 2018
@sli1989 sli1989 merged commit 62f69af into theme-next:master Jul 20, 2018
@sli1989 sli1989 deleted the Gemini-post-spread branch July 20, 2018 07:48
Jona-lee pushed a commit to Jona-lee/hexo-theme-next that referenced this pull request Oct 10, 2018
* Fix post-spread invisible in Gemini

* Refactor the baidushare within post-widgets

* Remove baidushare.swig

* Add slide mode support

* Fix widgets position

* Fix bdshare slide display logic

* Fix bdshare slide display logic

* Move add-this to _layout

* Delete jiathis share because of closed officially

* Update divider position
tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
* Fix post-spread invisible in Gemini

* Refactor the baidushare within post-widgets

* Remove baidushare.swig

* Add slide mode support

* Fix widgets position

* Fix bdshare slide display logic

* Fix bdshare slide display logic

* Move add-this to _layout

* Delete jiathis share because of closed officially

* Update divider position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants