~xdavidwu/xdavidwu.link

d9acba2a9e118949d549ad9e02939cf1ae3c68ce — Michael Rose 8 years ago 0b57806 + ab15503
Merge branch 'feature/discourse-comments' into develop
M _config.yml => _config.yml +3 -1
@@ 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                :

A _includes/comments-providers/discourse.html => _includes/comments-providers/discourse.html +14 -0
@@ 0,0 1,14 @@
{% if site.comments.discourse.server %}
{% include base_path %}
{% capture canonical %}{{ base_path }}{% 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 %}
\ No newline at end of file

M _includes/comments-providers/disqus.html => _includes/comments-providers/disqus.html +1 -1
@@ 19,4 19,4 @@
  	}());
  </script>
  <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% endif %}
{% endif %}
\ No newline at end of file

M _includes/comments-providers/google-plus.html => _includes/comments-providers/google-plus.html +1 -1
@@ 1,2 1,2 @@
<script async type="text/javascript" src="//apis.google.com/js/plusone.js?callback=gpcb"></script>
<noscript>Please enable JavaScript to view the <a href="https://plus.google.com/">comments powered by Google+.</a></noscript>
<noscript>Please enable JavaScript to view the <a href="https://plus.google.com/">comments powered by Google+.</a></noscript>
\ No newline at end of file

M _includes/comments-providers/scripts.html => _includes/comments-providers/scripts.html +2 -0
@@ 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" %}