Metadata-Version: 2.1
Name: pelican-related-posts
Version: 1.0.0
Summary: Pelican plugin that adds a list of related posts to an article.
Home-page: https://github.com/pelican-plugins/related-posts
License: AGPL-3.0
Keywords: pelican,plugin,related,posts,articles
Author: Justin Mayer
Author-email: entroP@gmail.com
Requires-Python: >=3.6,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Framework :: Pelican
Classifier: Framework :: Pelican :: Plugins
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: markdown
Requires-Dist: markdown (>=3.2.2,<4.0.0); extra == "markdown"
Requires-Dist: pelican (>=4.5,<5.0)
Project-URL: Documentation, https://docs.getpelican.com
Project-URL: Funding, https://donate.getpelican.com/
Project-URL: Issue Tracker, https://github.com/pelican-plugins/related-posts/issues
Project-URL: Repository, https://github.com/pelican-plugins/related-posts
Description-Content-Type: text/markdown

Related Posts: A Plugin for Pelican
===================================

[![Build Status](https://img.shields.io/github/workflow/status/pelican-plugins/related-posts/build)](https://github.com/pelican-plugins/related-posts/actions) [![PyPI Version](https://img.shields.io/pypi/v/pelican-related-posts)](https://pypi.org/project/pelican-related-posts/)

Related Posts is a Pelican plugin that adds a list of related posts to an article by adding a `related_posts` variable to the article’s context.


Installation
------------

This plugin can be installed via:

    python -m pip install pelican-related-posts


Usage
-----

By default, up to five related 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` value.

Additionally, you can specify the following in your settings file:

    RELATED_POSTS_SKIP_SAME_CATEGORY = True

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


Contributing
------------

Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].

To start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.

[existing issues]: https://github.com/pelican-plugins/related-posts/issues
[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html

