Mercurial > hg > Blog
changeset 12:7bfdc2b1d768
generate a captcha per blog post
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Tue, 06 Aug 2013 04:06:16 +0200 |
parents | bb1f035109da |
children | 3b69622879c9 |
files | pelicanconf.py publishconf.py themes/tuxlite_tbs/templates/simple_comments.html |
diffstat | 3 files changed, 45 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/pelicanconf.py Thu Jul 18 02:19:49 2013 +0200 +++ b/pelicanconf.py Tue Aug 06 04:06:16 2013 +0200 @@ -11,7 +11,13 @@ TYPOGRIFY = True PLUGIN_PATH = '../simple_comments' -PLUGINS = [ 'simple_comments' ] +PLUGINS = [ 'simple_comments', 'pelicaptcha' ] + +# simple_comments plugin config +COMMENT_PATH = 'comments' + +# pelicaptcha plugin config +PELICAPTCHA_FONT = '/usr/share/tuxpaint/fonts/FreeMono.ttf' # this theme looks ok but has some downsides: # - tag list at the bottom only @@ -29,8 +35,6 @@ CATEGORY_FEED_ATOM = None TRANSLATION_FEED_ATOM = None -COMMENT_PATH = 'comments' - # Blogroll LINKS = () #('Pelican', 'http://getpelican.com/'), # ('Python.org', 'http://python.org/'),
--- a/publishconf.py Thu Jul 18 02:19:49 2013 +0200 +++ b/publishconf.py Tue Aug 06 04:06:16 2013 +0200 @@ -15,10 +15,3 @@ FEED_ALL_ATOM = 'feeds/all.atom.xml' CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml' - -DELETE_OUTPUT_DIRECTORY = True - -# Following items are often useful when publishing - -#DISQUS_SITENAME = "" -#GOOGLE_ANALYTICS = ""
--- a/themes/tuxlite_tbs/templates/simple_comments.html Thu Jul 18 02:19:49 2013 +0200 +++ b/themes/tuxlite_tbs/templates/simple_comments.html Tue Aug 06 04:06:16 2013 +0200 @@ -20,15 +20,44 @@ </div> <form action="http://xanthippe.dyndns.org/blog-comments/simple_comments.php" method="POST"> <input type="hidden" name="Slug" value="{{ article.slug }}"> - <div style="padding: 10px 0px 0px 0px;"> - Your name: <input type="text" name="Author"> - </div> - <div> - <textarea rows="5" cols="60" name="Comment"></textarea> - </div> - <div> - <input type="submit" value="Submit"> - </div> + <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 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> + <tr> + <td> + <input type="submit" value="Submit"> + </td> + <td></td> + </tr> + </table> </form> </div> {% endif %}