comments.html 1.6 KB

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