Ivan Dyedov 0ab01b2994 fix invalid name for __init__.py & add unicode_literals import 9 years ago
..
README.rst a73d9dddcb fix structure of disqus_static plugin and update README 10 years ago
__init__.py 0ab01b2994 fix invalid name for __init__.py & add unicode_literals import 9 years ago
disqus_static.py 0ab01b2994 fix invalid name for __init__.py & add unicode_literals import 9 years ago

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.

We use disqus-python package for communication with disqus API:
``pip install disqus-python``

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

PLUGINS = [u"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_comment_count }} comments



    {% for comment in article.disqus_comments recursive %}



  • Avatar



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



    {{ comment.message }}




    {% if comment.children %}

      {{ loop(comment.children) }}

    {% endif %}

  • {% endfor %}


{% endif %}