Disqus script loads when needed. Fixes #9

This commit is contained in:
Felipe M 2018-03-24 16:14:42 +01:00
parent a7e52f578d
commit 4ab4f63d64
Signed by: fmartingr
GPG key ID: 716BC147715E716F
4 changed files with 21 additions and 8 deletions

View file

@ -1,6 +1,7 @@
{% extends "blog/_base.html" %}
{% from "macros/blog.html" import render_blog_post %}
{% from "macros/pagination.html" import render_pagination %}
{% from "macros/comments.html" import render_count %}
{% block main_content %}
{% for child in this.pagination.items %}
@ -9,3 +10,8 @@
<div class="center">{{ render_pagination(this.pagination) }}</div>
{% endblock %}
{% block endbody %}
{{ super() }}
{{ disqus_count_script() }}
{% endblock %}

View file

@ -1,5 +1,6 @@
{% extends "blog/_base.html" %}
{% from "macros/blog.html" import render_blog_post %}
{% from "macros/comments.html" import disqus_comments_script %}
{% block body_class %}blog post{% endblock %}
@ -9,11 +10,14 @@
{{ render_blog_post(this) }}
{% if this.comments_enabled %}
<div class="comments center" id="disqus_thread"></div>
{% from 'macros/comments.html' import disqus with context %}
{{ disqus() }}
{% else %}
<div class="center block-info">
Comments have been disabled in this post, if you want to contact me please <a href="{{ '/contact'|url }}">go ahead</a>!
</div>
{% endif %}
{% endblock %}
{% block endbody %}
{{ super() }}
{{ disqus_comments_script() }}
{% endblock %}