From 9b77ec15e5beeff3f57f845be883416d2a68b84d Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Mon, 30 Nov 2020 22:56:26 +0100 Subject: New article on rst & Latex. Changed theme --- plugins/related_posts/Readme.rst | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 plugins/related_posts/Readme.rst (limited to 'plugins/related_posts/Readme.rst') 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 `_. Please file any issues/PRs there. Once all plugins have been migrated to the `new Pelican Plugins organization `_, 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 %} + + {% 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. -- cgit v1.2.3