changeset 72:c2b99e876559 pelican_comment_system

use the pelican_plugin_system from the standard pelican plugins instead of my own simple_comments
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sat, 02 Jan 2016 04:47:39 +0100
parents 6e8d97e43bd7
children f6690e50793c
files content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/0.md content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/1.md content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/2.md content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/52fbd9f970ac0 content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/reply1 content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/reply2 content/comments/fair-traffic-queueing-using-fq_codel/0.md content/comments/fair-traffic-queueing-using-fq_codel/1 pelicanconf.py themes/tuxlite_tbs/templates/add_comment.html themes/tuxlite_tbs/templates/article.html themes/tuxlite_tbs/templates/pelican_comment_system.html themes/tuxlite_tbs/templates/simple_comments.html
diffstat 13 files changed, 84 insertions(+), 78 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/0.md	Sat Jan 02 04:47:39 2016 +0100
@@ -0,0 +1,5 @@
+Title:
+Author: jokraehe
+Date: 2014-02-12 21:30:49
+
+i have the exact same issue as you described above. do you have any solution to share yet?
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/1.md	Sat Jan 02 04:47:39 2016 +0100
@@ -0,0 +1,6 @@
+Title:
+Author: Dirk Olmes
+Date: 2014-02-15 16:30:00
+ReplyTo: 0md
+
+I dug to the root cause of the issue back after I wrote the blog post but didn't find the time to do a proper comparison of ikec's behaviour on the pi vs on my regular Linux machine. Long story short, it was the code that parses the config file. On the pi it doesn't proplerly detect the last entry in the file - or EOF, I don't remember the details. The workaround was to add an empty line to the end of the config file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/2.md	Sat Jan 02 04:47:39 2016 +0100
@@ -0,0 +1,6 @@
+Title:
+Author: Nkolay Dimitrov
+Date: 2015-10-31 22:13:37
+
+Thank you very much for this comment! It really helped me work around this issue.
+
--- a/content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/52fbd9f970ac0	Sat Jan 02 03:18:12 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-Author: jokraehe
-Date: 2014-02-12 21:30:49
-
-i have the exact same issue as you described above. do you have any solution to share yet?
--- a/content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/reply1	Sat Jan 02 03:18:12 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-Author: Dirk Olmes
-Date: 2014-02-15 16:30:00
-
-I dug to the root cause of the issue back after I wrote the blog post but didn't find the time to do a proper comparison of ikec's behaviour on the pi vs on my regular Linux machine. Long story short, it was the code that parses the config file. On the pi it doesn't proplerly detect the last entry in the file - or EOF, I don't remember the details. The workaround was to add an empty line to the end of the config file.
\ No newline at end of file
--- a/content/comments/compiling-the-shrew-soft-vpn-client-on-raspberry-pi/reply2	Sat Jan 02 03:18:12 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-Author: Nkolay Dimitrov
-Date: 2015-10-31 22:13:37
-
-Thank you very much for this comment! It really helped me work around this issue.
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/content/comments/fair-traffic-queueing-using-fq_codel/0.md	Sat Jan 02 04:47:39 2016 +0100
@@ -0,0 +1,5 @@
+Title:
+Author: Dirk Olmes
+Date: 2015-05-12 15:21:18
+
+You can go even one step further and make the codel packet scheduler the default one for all network connections. Just use sysctl -w net.core.default_qdisc=fq_codel
--- a/content/comments/fair-traffic-queueing-using-fq_codel/1	Sat Jan 02 03:18:12 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-Author: Dirk Olmes
-Date: 2015-05-12 15:21:18
-
-You can go even one step further and make the codel packet scheduler the default one for all network connections. Just use sysctl -w net.core.default_qdisc=fq_codel
\ No newline at end of file
--- a/pelicanconf.py	Sat Jan 02 03:18:12 2016 +0100
+++ b/pelicanconf.py	Sat Jan 02 04:47:39 2016 +0100
@@ -12,15 +12,11 @@
 DEFAULT_DATE_FORMAT = u'%d.%m.%Y'
 TYPOGRIFY = True
 
-PLUGIN_PATHS = ['../simple_comments']
-#PLUGINS = ['simple_comments', 'pelicaptcha']
-PLUGINS = ['simple_comments']
+PLUGIN_PATHS = ['../pelican-plugins/pelican_comment_system']
+PLUGINS = ['pelican_comment_system']
 
-# simple_comments plugin config
-COMMENT_PATH = 'comments'
-
-# pelicaptcha plugin config
-PELICAPTCHA_FONT = '/usr/share/tuxpaint/fonts/FreeMono.ttf'
+# pelican_comment_system plugin config
+PELICAN_COMMENT_SYSTEM = True
 
 # this theme looks ok but has some downsides:
 # - tag list at the bottom only
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/themes/tuxlite_tbs/templates/add_comment.html	Sat Jan 02 04:47:39 2016 +0100
@@ -0,0 +1,35 @@
+<div style="padding: 20px 0px 0px 0px;">
+    <div style="font-size: 120%;">
+        Leave a comment
+    </div>
+{% if False %}
+    <form action="http://xanthippe.duckdns.org/blog-comments/simple_comments.php" method="POST">
+{% endif %}
+    <form action="http://xanthippe.duckdns.org/blog-comments/submit_comment.php" method="POST">
+        <input type="hidden" name="Slug" value="{{ article.slug }}">
+        <table  style="padding: 10px 0px 0px 0px;">
+            <tr>
+                <td>
+                    Your name:
+                </td>
+                <td>
+                    <input type="text" name="Author">
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    Comment:
+                </td>
+                <td>
+                    <textarea rows="5" cols="60" name="Comment"></textarea>
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    <input type="submit" value="Submit">
+                </td>
+                <td></td>
+            </tr>
+        </table>
+    </form>
+</div>
--- a/themes/tuxlite_tbs/templates/article.html	Sat Jan 02 03:18:12 2016 +0100
+++ b/themes/tuxlite_tbs/templates/article.html	Sat Jan 02 04:47:39 2016 +0100
@@ -24,5 +24,7 @@
 		{% include "disqus.html" %}
 	{% endif %}
     {% include "simple_comments.html" %}
+    {% include "pelican_comment_system.html" %}
+    {% include "add_comment.html" %}
     </div>
 {% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/themes/tuxlite_tbs/templates/pelican_comment_system.html	Sat Jan 02 04:47:39 2016 +0100
@@ -0,0 +1,21 @@
+{% if article.comments %}
+    {% for comment in article.comments recursive %}
+        {% if loop.depth0 == 0 %}
+            {% set marginLeft = 0 %}
+        {% else %}
+            {% set marginLeft = 50 %}
+        {% endif %}
+            <article id="comment-{{comment.slug}}" style="border: 1px solid #DDDDDD; padding: 5px 0px 0px 5px; margin: 0px -1px 5px {{marginLeft}}px;">
+                <a href="{{ SITEURL }}/{{ article.url }}#comment-{{comment.slug}}" rel="bookmark" title="Permalink to this comment">Permalink</a>
+                <h4>{{ comment.author }}</h4>
+                <p>Posted on <abbr class="published" title="{{ comment.date.isoformat() }}">{{ comment.locale_date }}</abbr></p>
+                {{ comment.metadata['my_custom_metadata'] }}
+                {{ comment.content }}
+                {% if comment.replies %}
+                    {{ loop(comment.replies) }}
+                {% endif %}
+            </article>
+    {% endfor %}
+{% else %}
+    <p>There are no comments yet.<p>
+{% endif %}
--- a/themes/tuxlite_tbs/templates/simple_comments.html	Sat Jan 02 03:18:12 2016 +0100
+++ b/themes/tuxlite_tbs/templates/simple_comments.html	Sat Jan 02 04:47:39 2016 +0100
@@ -13,56 +13,3 @@
     </div>
     {% endfor %}
 {% endif %}
-{% if article.metadata.allowcomments %}
-<div style="padding: 20px 0px 0px 0px;">
-    <div style="font-size: 120%;">
-        Leave a comment
-    </div>
-{% if False %}
-    <form action="http://xanthippe.duckdns.org/blog-comments/simple_comments.php" method="POST">
-{% endif %}
-    <form action="http://xanthippe.duckdns.org/blog-comments/submit_comment.php" method="POST">
-        <input type="hidden" name="Slug" value="{{ article.slug }}">
-        <table  style="padding: 10px 0px 0px 0px;">
-            <tr>
-                <td>
-                    Your name:
-                </td>
-                <td>
-                    <input type="text" name="Author">
-                </td>
-            </tr>
-            <tr>
-                <td>
-                    Comment:
-                </td>
-                <td>
-                    <textarea rows="5" cols="60" name="Comment"></textarea>
-                </td>
-            </tr>
-{% if False %}
-            <tr>
-                <td colspan="2">
-                    Please type the characters you see in this image:
-                <td>
-                <td></td>
-            </tr>
-            <tr>
-                <td>
-                    <img src="{{ SITEURL }}/{{ article.slug }}.jpg">
-                </td>
-                <td>
-                    <input type="text" name="Challenge">
-                </td>
-            </tr>
-{% endif %}
-            <tr>
-                <td>
-                    <input type="submit" value="Submit">
-                </td>
-                <td></td>
-            </tr>
-        </table>
-    </form>
-</div>
-{% endif %}