Skip to content

Commit

Permalink
Add support for giscus comments (alshedivat#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demi-wlw authored Mar 11, 2023
1 parent 1992113 commit 740f6e3
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,11 @@ <h1 class="post-title">{{ page.title }}</h1>
{{ content }}
</article>

{%- if site.related_blog_posts.enabled -%}
{%- if page.related_posts == null or page.related_posts -%}
{% include related_posts.html %}
{%- endif %}
{%- endif %}

{%- if site.disqus_shortname and page.comments -%}
<div id="disqus_thread" style="max-width: {{ site.max_width }}; margin: 0 auto"></div>
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_shortname }}';
var disqus_identifier = '{{ page.id }}';
var disqus_title = {{ page.title | jsonify }};
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{%- if site.disqus_shortname and page.disqus_comments -%}
{% include disqus.html %}
{%- endif %}
{%- if site.giscus.repo and page.giscus_comments -%}
{% include giscus.html %}
{%- endif -%}

</div>

0 comments on commit 740f6e3

Please sign in to comment.