From 91b1feb471d1529e79b4548a0eafb6b83090a368 Mon Sep 17 00:00:00 2001 From: Robert Riemann Date: Fri, 3 Jun 2016 00:30:32 +0200 Subject: [PATCH] Add Javascript and configs to use Discourse commenting --- _config.yml | 6 ++++-- _includes/comments-providers/discourse.html | 13 +++++++++++++ _includes/comments-providers/scripts.html | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 _includes/comments-providers/discourse.html diff --git a/_config.yml b/_config.yml index 5676f6ff..68181551 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 : "disqus" # false (default), "disqus", "facebook", "google-plus", custom" + provider : # false (default), "disqus", "discourse", "facebook", "google-plus", custom" disqus: - shortname : "minimalmistakes" # https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname- + 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" %}