diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2020-11-30 22:56:26 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2020-12-03 21:35:35 +0100 |
commit | 9b77ec15e5beeff3f57f845be883416d2a68b84d (patch) | |
tree | 796f2aecfcdf5012ce611fac22b85fa481bf63de /plugins/related_posts/Readme.rst | |
parent | 1c02ae819eee2d28040804d58872ceb4c003ee1f (diff) |
New article on rst & Latex. Changed theme
Diffstat (limited to 'plugins/related_posts/Readme.rst')
-rw-r--r-- | plugins/related_posts/Readme.rst | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/related_posts/Readme.rst b/plugins/related_posts/Readme.rst new file mode 100644 index 0000000..0edf4bd --- /dev/null +++ b/plugins/related_posts/Readme.rst @@ -0,0 +1,38 @@ +Related posts +------------- + +**NOTE:** `This plugin has been moved to its own repository <https://github.com/pelican-plugins/related-posts>`_. Please file any issues/PRs there. Once all plugins have been migrated to the `new Pelican Plugins organization <https://github.com/pelican-plugins>`_, this monolithic repository will be archived. + +------------------------------------------------------------------------------- + +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 %} + <ul> + {% for related_post in article.related_posts %} + <li><a href="{{ SITEURL }}/{{ related_post.url }}">{{ related_post.title }}</a></li> + {% endfor %} + </ul> + {% 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. |