hacks-guide-minimal-mistake.../_includes/comments-providers/discourse.html
Robert Riemann f6f7d0cd97 javascript to embed comments from discourse forum
The comment system can be changed to embed topics from the Discourse
forum software: http://discourse.org/

More details: https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963
2016-06-03 00:34:14 +02:00

14 lines
849 B
HTML

{% if site.comments.discourse.server %}
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
<script type="text/javascript">
DiscourseEmbed = { discourseUrl: '//{{ site.comments.discourse.server }}/',
discourseEmbedUrl: '{{ canonical }}' };
(function () {
var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
})();
</script>
<noscript>Please enable JavaScript to view the comments powered by [Discourse](http://forum.beta-europe.org/c/beta/website).</a></noscript>
{% endif %}