From f6f7d0cd97d17e17ce628f7914d6f3c9c18827fa Mon Sep 17 00:00:00 2001 From: Robert Riemann Date: Fri, 3 Jun 2016 00:30:32 +0200 Subject: [PATCH] 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 --- _config.yml | 4 +++- _includes/comments-providers/discourse.html | 13 +++++++++++++ _includes/comments-providers/scripts.html | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 _includes/comments-providers/discourse.html diff --git a/_config.yml b/_config.yml index d3932ea6..01346491 100644 --- a/_config.yml +++ b/_config.yml @@ -18,9 +18,11 @@ teaser : # filename of teaser fallback teaser image placed in # breadcrumbs : false # true, false (default) words_per_minute : 200 comments: - provider : # false (default), "disqus", "facebook", "google-plus", custom" + provider : # false (default), "disqus", "discourse", "facebook", "google-plus", custom" disqus: shortname : # https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname- + discourse: + server : # https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963 , e.g.: meta.discourse.org facebook: # https://developers.facebook.com/docs/plugins/comments appid : diff --git a/_includes/comments-providers/discourse.html b/_includes/comments-providers/discourse.html new file mode 100644 index 00000000..1dbcaced --- /dev/null +++ b/_includes/comments-providers/discourse.html @@ -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 %} + + +{% endif %} diff --git a/_includes/comments-providers/scripts.html b/_includes/comments-providers/scripts.html index df699fc5..0da90c5d 100644 --- a/_includes/comments-providers/scripts.html +++ b/_includes/comments-providers/scripts.html @@ -3,6 +3,8 @@ {% case site.comments.provider %} {% when "disqus" %} {% include /comments-providers/disqus.html %} +{% when "discourse" %} + {% include /comments-providers/discourse.html %} {% when "facebook" %} {% include /comments-providers/facebook.html %} {% when "google-plus" %}