-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% 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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters