Removed lektor disqus comments, using simple script

This commit is contained in:
Felipe M 2016-12-19 17:05:28 +01:00
parent 821f9bbf5c
commit 15f629b7ef
5 changed files with 24 additions and 4 deletions

View file

@ -8,7 +8,9 @@
{% block main_content %}
{{ render_blog_post(this) }}
{% if this.comments_enabled %}
<div class="center comments">{{ render_disqus_comments() }}</div>
<div class="comments center" id="disqus_thread"></div>
{% from 'macros/comments.html' import disqus with context %}
{{ disqus() }}
{% else %}
<div class="center info">
Comments have been disabled in this post, if you want to contact me please <a href="{{ '/contact'|url }}">go ahead</a>!

View file

@ -3,7 +3,7 @@
<article class="blog-post center">
<h1><a href="{{ post|url }}">{{ post.title }}</a></h1>
<div class="info">
Published on {{ post.pub_date }} with <a href="#">no comments.</a>
Published on {{ post.pub_date }} with <a href="#disqus_thread">no comments.</a>
</div>
<div class="content">
{% if from_index and summary|length > 1 %}

View file

@ -0,0 +1,20 @@
{% macro disqus(shortname) -%}
<script type="text/javascript">
var disqus_shortname = 'fmartingr';
// Embed
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
// Count
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{%- endmacro %}