changeset 76:7aa5f064106e

Use the "standard" pelican_plugin_system for comments instead of or homegrown pelican plugin.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 06 Jan 2016 16:10:11 +0100
parents ff642c382b2b (current diff) ab417a6e0b05 (diff)
children 21fd84209125
files 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/1
diffstat 14 files changed, 85 insertions(+), 79 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	Wed Jan 06 16:10:11 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	Wed Jan 06 16:10:11 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	Wed Jan 06 16:10:11 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	Sun Jan 03 00:53:23 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	Sun Jan 03 00:53:23 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	Sun Jan 03 00:53:23 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	Wed Jan 06 16:10:11 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	Sun Jan 03 00:53:23 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/content/pages/about.md	Sun Jan 03 00:53:23 2016 +0100
+++ b/content/pages/about.md	Wed Jan 06 16:10:11 2016 +0100
@@ -5,7 +5,7 @@
 
 I've had interest in computers ever since I turned 15 or so. My first machine was a [Commodore 64](https://en.wikipedia.org/wiki/Commodore_64), mostly for playing computer games. But I did a bit of BASIC programming, too.
 
-The second machine I owned was a [Sharp MZ 3500](https://en.wikipedia.org/wiki/Sharp_MZ) which I was abandoned at my dad's workplace. Since there were no games available for that machine, I turned to programming - more BASIC [dBASE](https://en.wikipedia.org/wiki/DBase),  and [Turbo Pascal](https://en.wikipedia.org/wiki/Turbo_Pascal).
+The second machine I owned was a [Sharp MZ 3500](https://en.wikipedia.org/wiki/Sharp_MZ) that was abandoned at my dad's workplace. Since there were no games available for that machine, I turned to programming - more BASIC [dBASE](https://en.wikipedia.org/wiki/DBase),  and [Turbo Pascal](https://en.wikipedia.org/wiki/Turbo_Pascal).
 
 Later, I got in touch with [NeXTSTEP](https://en.wikipedia.org/wiki/NeXTSTEP) but I  never owned one of these stylish black boxes. However, hacking [Objective-C](https://en.wikipedia.org/wiki/Objective-C) really opened my mind to object oritented programming.
 
--- a/pelicanconf.py	Sun Jan 03 00:53:23 2016 +0100
+++ b/pelicanconf.py	Wed Jan 06 16:10:11 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']
+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	Wed Jan 06 16:10:11 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	Sun Jan 03 00:53:23 2016 +0100
+++ b/themes/tuxlite_tbs/templates/article.html	Wed Jan 06 16:10:11 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	Wed Jan 06 16:10:11 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	Sun Jan 03 00:53:23 2016 +0100
+++ b/themes/tuxlite_tbs/templates/simple_comments.html	Wed Jan 06 16:10:11 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 %}