Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add yungentie comment plugin support. #1301

Merged
merged 3 commits into from
Dec 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ mathjax:
# Hypercomments
#hypercomments_id:

# Gentie productKey
#gentie_productKey:

# Baidu Share
# Available value:
# button | slide
Expand Down
7 changes: 7 additions & 0 deletions layout/_macro/post.swig
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@
</span>
</span>
<!--/noindex-->
{% elseif is_post() and theme.gentie_productKey %}
<span class="post-comments-count">
<span class="post-meta-divider">|</span>
<a class="cloud-tie-join-count" href="{{ url_for(post.path) }}#comments" itemprop="discussionUrl">
<span class="post-comments-count join-count" itemprop="commentCount"></span>
</a>
</span>
{% endif %}
{% endif %}

Expand Down
2 changes: 2 additions & 0 deletions layout/_partials/comments.swig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
</div>
{% elseif theme.hypercomments_id %}
<div id="hypercomments_widget"></div>
{% elseif theme.gentie_productKey %}
<div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
{% endif %}
</div>
{% endif %}
1 change: 1 addition & 0 deletions layout/_scripts/third-party/comments.swig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% include './comments/duoshuo.swig' %}
{% include './comments/disqus.swig' %}
{% include './comments/hypercomments.swig' %}
{% include './comments/gentie.swig' %}
16 changes: 16 additions & 0 deletions layout/_scripts/third-party/comments/gentie.swig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% if not (theme.duoshuo and theme.duoshuo.shortname) and not theme.duoshuo_shortname and not theme.disqus_shortname and not theme.hypercomments_id %}

{% if theme.gentie_productKey %}
{% set gentie_productKey = theme.gentie_productKey %}
<script>
var cloudTieConfig = {
url: document.location.href,
sourceId: "",
productKey: "{{gentie_productKey}}",
target: "cloud-tie-wrapper"
};
</script>
<script src="https://img1.ws.126.net/f2e/tie/yun/sdk/loader.js"></script>
{% endif %}

{% endif %}
15 changes: 15 additions & 0 deletions source/css/_common/components/third-party/gentie.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.cloud-tie-wrapper {
img {
display: inline-block;
}

.total-txt {
font-size: 1em !important;
}
}

.cloud-tie-join-count .join-count {
color: #555 !important;
font-size: inherit !important;
margin: 0 !important;
}
5 changes: 3 additions & 2 deletions source/css/_common/components/third-party/third-party.styl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "duoshuo";
@import "gentie";
@import "jiathis";
@import "baidushare";
@import "localsearch";
@import "busuanzi-counter"
@import "algolia-search" if hexo-config('algolia_search.enable')
@import "busuanzi-counter";
@import "algolia-search" if hexo-config('algolia_search.enable');