Disqus -> Commento

This commit is contained in:
Felipe M 2019-09-27 19:56:51 +02:00
parent 921e0e088c
commit 2988b5f18a
Signed by: fmartingr
GPG key ID: 716BC147715E716F
5 changed files with 9 additions and 32 deletions

View file

@ -14,9 +14,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<meta http-equiv="cleartype" content="on">
<script type="text/javascript">
var disqus_shortname = 'fmartingr';
</script>
{% block endhead %}{% endblock %}
</head>
<body class="{% block body_class %}{% endblock %}">
@ -50,6 +47,8 @@
<a target="_blank" rel="me" href="https://mastodon.social/@fmartingr">Mastodon</a>
</div>
</footer>
<script src="https://cdn.commento.io/js/commento.js"></script>
<script src="https://cdn.commento.io/js/count.js"></script>
<script type="text/javascript" src="{{ '/static/js/app-min.js'|url }}"></script>
{% block endbody %}{% endblock %}
<script>

View file

@ -1,7 +1,6 @@
{% extends "blog/_base.html" %}
{% from "macros/blog.html" import render_blog_post %}
{% from "macros/pagination.html" import render_pagination %}
{% from "macros/comments.html" import disqus_count_script %}
{% block main_content %}
{% for child in this.pagination.items %}
@ -13,5 +12,4 @@
{% block endbody %}
{{ super() }}
{{ disqus_count_script() }}
{% endblock %}

View file

@ -1,6 +1,5 @@
{% 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 %}
@ -8,16 +7,17 @@
{% block main_content %}
{{ render_blog_post(this) }}
{#% if this.comments_enabled %}
<div class="comments center" id="disqus_thread"></div>
{% if this.comments_enabled %}
<div class="comments center block">
<div id="commento"></div>
</div>
{% 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 %#}
{% endif %}
{% endblock %}
{% block endbody %}
{{ super() }}
{# {{ disqus_comments_script() }} #}
{% endblock %}

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="{{ post|url }}#disqus_thread">no comments.</a>
Published on {{ post.pub_date }} with <a href="{{ post|url }}#commento">no comments.</a>
</div>
<div class="content">
{% if from_index and summary|length > 1 %}
@ -17,6 +17,6 @@
<h3>Edits</h3>
{{ post.edit_comment }}
{% endif %}
<!--<hr class="light"> -->
<hr class="light">
</article>
{% endmacro %}

View file

@ -1,20 +0,0 @@
{% macro disqus_comments_script() -%}
<script type="text/javascript">
(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);
})();
</script>
{%- endmacro %}
{% macro disqus_count_script() %}
<script type="text/javascript">
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{%- endmacro %}