Skip to main content

Related Posts: A Plugin for Pelican

Build Status PyPI Version

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.

Metadata

Release files for pelican-related-posts 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pelican-related-posts 1.0.0
File Size Uploaded Provenance Actions
pelican-related-posts-1.0.0.tar.gz 3.7 kB Without provenance Details for pelican-related-posts-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pelican-related-posts 1.0.0
File Interpreter ABI Platform Actions
pelican_related_posts-1.0.0-py3-none-any.whl Python 3 none any Details for pelican_related_posts-1.0.0-py3-none-any.whl

Total release size: 7.2 kB

Security for pelican-related-posts 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page