Skip to content

Commit

Permalink
feat(comments): replace disqus_identifier with comment_id
Browse files Browse the repository at this point in the history
Disqus is not the only comment provider. We plan to add more comment providers.
Others too have the feature of providing custom id for the comments. Therefore, it does not make
sense to use disqus_identifier for them. comment_id variable can be used with any comment service.
  • Loading branch information
talha131 committed Jun 30, 2019
1 parent 0f146cd commit 3aa4e24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion templates/_includes/comments.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle disqus-comment-count" data-toggle="collapse" data-parent="#accordion2"
{% if article.disqus_identifier %}
{% if article.comment_id %}
data-disqus-identifier="{{ article.comment_id }}"
{% elif article.disqus_identifier %}
data-disqus-identifier="{{ article.disqus_identifier }}"
{% endif %}
href="{{ SITEURL }}/{{ article.url }}#disqus_thread",
Expand Down
4 changes: 3 additions & 1 deletion templates/_includes/disqus_scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ DISQUS_SITENAME }}';
{% if article.disqus_identifier %}
{% if article.comment_id %}
var disqus_identifier = '{{ article.comment_id }}';
{% elif article.disqus_identifier %}
var disqus_identifier = '{{ article.disqus_identifier }}';
{% else %}
var disqus_identifier = '{{ SITEURL }}/{{ article.url }}';
Expand Down

0 comments on commit 3aa4e24

Please sign in to comment.