Permalink
Browse files

show the comment number

  • Loading branch information...
1 parent 68e9ce4 commit 6a7f1a6f5ae298a8f6effd2ccfa79ec31d659eb8 @microud committed May 14, 2016
Showing with 26 additions and 9 deletions.
  1. +3 −5 next-mist/default.hbs
  2. +20 −1 next-mist/index.hbs
  3. +2 −2 next-mist/post.hbs
  4. +1 −1 next-pisces/post.hbs
@@ -34,12 +34,10 @@
scheme: 'Mist',
sidebar: {"position":"right","display":"post"},
fancybox: true,
- motion: true //,
- // duoshuo: {
- // userId: 4141040,
- // author: ''
- //}
+ motion: true
};
+
+ var duoshuo_name = "xknow";
</script>
</head>
View
@@ -10,7 +10,7 @@
</h1>
<div class="post-meta">
<span class="post-time">
- <span class="post-meta-item-icon"></span>
+ <span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i></span>
<span class="post-meta-item-text">发表于</span>
<time>{{date format='YYYY-MM-DD'}}</time>
</span>
@@ -23,6 +23,11 @@
{{/if}}
</span>
</span>
+ <span class="post-comments-count">&nbsp; | &nbsp;
+ <a href="{{url}}#comments" itemprop="discussionUrl">
+ <span class="post-comments-count ds-thread-count" data-thread-key="{{id}}" itemprop="commentsCount"></span>
+ </a>
+ </span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
@@ -49,3 +54,17 @@
{{> sidebar}}
</div>
</aside>
+ <script type="text/javascript">
+ // $(".post-comments-count").each(function(){
+ // var duoshuo_data = $.getJSON("http://api.duoshuo.com/threads/counts.json?short_name=" + duoshuo_name + "&threads=" + $(this).attr("data-thread-key"));
+//
+ // if(duoshuo_data['comments'] == 0) {
+ // $(this).html("暂无评论");
+ /// }else {
+ // $(this).html(duoshuo_data['comments'] + "条评论")
+// /}
+
+// });
+
+
+ </script>
View
@@ -25,7 +25,7 @@
</span>
<span class="post-comments-count">&nbsp; | &nbsp;
<a href="#comments" itemprop="discussionUrl">
- <span class="post-comments-count ds-thread-count" data-thread-key="" itemprop="commentsCount"></span>
+ <span class="post-comments-count ds-thread-count" data-thread-key="{{id}}" itemprop="commentsCount"></span>
</a>
</span>
<!--
@@ -53,7 +53,7 @@
<!-- 用多说通用代码的<script></script>包裹部分替换到下面的脚本 -->
<script type="text/javascript">
/* 或者只替换下面的short_name为自己的 */
- var duoshuoQuery = {short_name:"xknow"};
+ var duoshuoQuery = {short_name:duoshuo_name};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
@@ -54,7 +54,7 @@
<!-- 用多说通用代码的<script></script>包裹部分替换到下面的脚本 -->
<script type="text/javascript">
/* 或者只替换下面的short_name为自己的 */
- var duoshuoQuery = {short_name:"xknow"};
+ var duoshuoQuery = {short_name:duoshuo_short};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;

0 comments on commit 6a7f1a6

Please sign in to comment.