Merge branch 'develop'. Fixed Disqus commenting.
						commit
						d101ba2b84
					
				@ -0,0 +1,15 @@
 | 
			
		||||
<div id="disqus_thread" class="mw8 center"></div>
 | 
			
		||||
<script>
 | 
			
		||||
var disqus_config = function () {
 | 
			
		||||
  this.page.url = "{{ disqus_url }}";
 | 
			
		||||
  this.page.identifier = "{{ disqus_identifier }}";
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
(function() { // DON'T EDIT BELOW THIS LINE
 | 
			
		||||
var d = document, s = d.createElement('script');
 | 
			
		||||
s.src = 'https://datasketch-io.disqus.com/embed.js';
 | 
			
		||||
s.setAttribute('data-timestamp', +new Date());
 | 
			
		||||
(d.head || d.body).appendChild(s);
 | 
			
		||||
})();
 | 
			
		||||
</script>
 | 
			
		||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
 | 
			
		||||
@ -0,0 +1,17 @@
 | 
			
		||||
from django.template import Library
 | 
			
		||||
from django.conf import settings
 | 
			
		||||
 | 
			
		||||
register = Library()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@register.inclusion_tag("blog/disqus.html", takes_context=True)
 | 
			
		||||
def show_comments(context):
 | 
			
		||||
    if not settings.COMMENTING:
 | 
			
		||||
        return {}
 | 
			
		||||
 | 
			
		||||
    new_context = {
 | 
			
		||||
        "disqus_url": context["request"].get_raw_uri(),
 | 
			
		||||
        "disqus_identifier": context["post"].slug
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return new_context
 | 
			
		||||
@ -1,7 +0,0 @@
 | 
			
		||||
from django.conf import settings
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def commenting(context):
 | 
			
		||||
    """Template context processor used to check if a COMMENTING setting is True"""
 | 
			
		||||
    return {"commenting": settings.COMMENTING}
 | 
			
		||||
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue