comments.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {% macro comments(article) %}
  2. {% if DISQUS_SITENAME and SITEURL and article.status != 'draft' %}
  3. <section>
  4. {% if article.comments_intro %}
  5. <p id="comment-message">{{ article.comments_intro }} </p>
  6. {% elif COMMENTS_INTRO %}
  7. <p id="comment-message">{{ COMMENTS_INTRO }} </p>
  8. {% endif %}
  9. <div class="accordion" id="accordion2">
  10. <div class="accordion-group">
  11. <div class="accordion-heading">
  12. <a class="accordion-toggle disqus-comment-count" data-toggle="collapse" data-parent="#accordion2"
  13. {% if article.disqus_identifier %}
  14. data-disqus-identifier="{{ article.disqus_identifier }}"
  15. {% endif %}
  16. href="{{ SITEURL }}/{{ article.url }}#disqus_thread">
  17. Comments
  18. </a>
  19. </div>
  20. <div id="disqus_thread" class="accordion-body collapse">
  21. <div class="accordion-inner">
  22. <div class="comments">
  23. {% from 'disqus_scripts.html' import disqus_comments_script with context %}
  24. {{ disqus_comments_script(article) }}
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </section>
  31. {% endif %}
  32. {% endmacro %}
  33. {% macro comments_script(article) %}
  34. {% if DISQUS_SITENAME and SITEURL and article.status != 'draft' %}
  35. {% from 'disqus_scripts.html' import disqus_misc_scripts with context %}
  36. {{ disqus_misc_scripts() }}
  37. {% endif %}
  38. {% endmacro %}