Ivan Dyedov c29e082093 fix README markdown display vor 12 Jahren
..
README.rst c29e082093 fix README markdown display vor 12 Jahren
disqus_static.py 5b8ffde2a5 initial commit of disqus_static plugin, a plugin for allowing you to fetch disqus comments from their API and embed them into your templates at HTML generation time. vor 12 Jahren

README.rst

Disqus static comment plugin for Pelican
====================================

This plugin adds a disqus_comments property to all articles.
Comments are fetched at generation time using disqus API.

Installation
------------
Because we use disqus API to retrieve the comments you need to create an application at
http://disqus.com/api/applications/ which will provide you with a secret and public keys for the API.

Put ``disqus_static.py`` plugin in ``plugins`` folder in pelican installation
and use the following in your settings::

PLUGINS = [u"pelican.plugins.disqus_static"]

DISQUS_SITENAME = u'YOUR_SITENAME'
DISQUS_SECRET_KEY = u'YOUR_SECRET_KEY'
DISQUS_PUBLIC_KEY = u'YOUR_PUBLIC_KEY'

Usage
-----

.. code-block:: html+jinja

{% if article.disqus_comments %}

{{ article.disqus_comments|length }} comments



    {% for comment in article.disqus_comments %}



  • Avatar



    {{ comment.author.name }}
    {{ comment.createdAt }}




    {{ comment.message }}






  • {% endfor %}


{% endif %}

TODO
-----

- handle replies to comments properly and maintain parent-child relationships
- test for sites with over 100 comments (I think disqus API only returns 100 items per request)