Kernc ab63994cf9 Add related_posts option RELATED_POSTS_SKIP_SAME_CATEGORY %!s(int64=10) %!d(string=hai) anos
..
Readme.rst ab63994cf9 Add related_posts option RELATED_POSTS_SKIP_SAME_CATEGORY %!s(int64=10) %!d(string=hai) anos
__init__.py 9e70c17839 import plugins from core and restructure repo %!s(int64=11) %!d(string=hai) anos
related_posts.py ab63994cf9 Add related_posts option RELATED_POSTS_SKIP_SAME_CATEGORY %!s(int64=10) %!d(string=hai) anos

Readme.rst

Related posts
-------------

This plugin adds the ``related_posts`` variable to the article's context.
By default, up to 5 articles are listed. You can customize this value by
defining ``RELATED_POSTS_MAX`` in your settings file::

RELATED_POSTS_MAX = 10

You can then use the ``article.related_posts`` variable in your templates.
For example::

{% if article.related_posts %}

    {% for related_post in article.related_posts %}
  • {{ related_post.title }}

  • {% endfor %}

{% endif %}


Your related posts should share a common tag. You can also use ``related_posts:`` in your post's meta data.
The 'related_posts:' meta data works together with your existing slugs::

related_posts: slug1, slug2, slug3, ... slugN

``N`` represents the ``RELATED_POSTS_MAX``.

Additionally, you can specify::

RELATED_POSTS_SKIP_SAME_CATEGORY = True

in your settings file. With this setting, ``article.related_posts`` will
contain only related posts from categories other than the original article's.