Removed lektor disqus comments, using simple script
This commit is contained in:
parent
821f9bbf5c
commit
15f629b7ef
5 changed files with 24 additions and 4 deletions
|
@ -2,7 +2,6 @@
|
|||
name = Felipe Martin
|
||||
|
||||
[packages]
|
||||
lektor-disqus-comments = 0.2
|
||||
lektor-markdown-highlighter = 0.1
|
||||
|
||||
[servers.production]
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
shortname = fmartingr
|
|
@ -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>!
|
||||
|
|
|
@ -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 %}
|
||||
|
|
20
templates/macros/comments.html
Normal file
20
templates/macros/comments.html
Normal 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 %}
|
Loading…
Add table
Add a link
Reference in a new issue