Skip to main content

An installable version of the original Pelican Series plugin

Project description

Pelican Series: A Plugin for Pelican

This plugin extends the original series plugin by FELD Boris lothiraldan@gmail.com Copyright (c) Leonardo Giordani giordani.leonardo@gmail.com This plugin is also in the Pelican Plugins repository

The series plugin allows you to join different posts into a series.

In order to mark posts as part of a series, use the :series: metadata:

:series:  NAME_OF_THIS_SERIES

or, in Markdown syntax

Series: NAME_OF_THIS_SERIES

The plugin collects all articles belonging to the same series and provides series-related variables that you can use in your template.

Indexing

By default articles in a series are ordered by date and then automatically numbered.

If you want to force a given order just specify the :series_index: metadata or in Markdown series_index:, starting from 1. All articles with this enforced index are put at the beginning of the series and ordered according to the index itself. All the remaining articles come after them, ordered by date.

The plugin provides the following variables to your templates

* `article.series.name` is the name of the series as specified in the article metadata
* `article.series.index` is the index of the current article inside the series
* `article.series.all` is an ordered list of all articles in the series (including the current one)
* `article.series.all_previous` is an ordered list of the articles published before the current one
* `article.series.all_next` is an ordered list of the articles published after the current one
* `article.series.previous` is the previous article in the series (a shortcut to `article.series.all_previous[-1]`)
* `article.series.next` is the next article in the series (a shortcut to `article.series.all_next[0]`)

For example:

{% if article.series %}
    <p>This post is part {{ article.series.index }} of the "{{ article.series.name }}" series:</p>
    <ol class="parts">
        {% for part_article in article.series.all %}
            <li {% if part_article == article %}class="active"{% endif %}>
                <a href='{{ SITEURL }}/{{ part_article.url }}'>{{ part_article.title }}</a>
            </li>
        {% endfor %}
    </ol>
{% endif %}

Joins articles in a series and provides variables to manage the series in the template.

Installation

This plugin can be installed via:

pip install pelican-series-plugin

Next add it to the PLUGINS section in pelicanconf.py

PLUGINS = [
    '...',
    'pelican.plugins.series',
    '...'
]

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pelican-series-plugin-1.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

pelican_series_plugin-1.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pelican-series-plugin-1.1.0.tar.gz.

File metadata

  • Download URL: pelican-series-plugin-1.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.1 Darwin/19.6.0

File hashes

Hashes for pelican-series-plugin-1.1.0.tar.gz
Algorithm Hash digest
SHA256 636d70464f915ce343120f373036f212d5cf59c0a231a04bfa2a6cb5dc125125
MD5 b1e7bf07c486b305234fcf97fcb8ebbe
BLAKE2b-256 b58c10821fd6b862e8963cae9924126d2fdd3812a7bf0741879c2078300b326f

See more details on using hashes here.

File details

Details for the file pelican_series_plugin-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pelican_series_plugin-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58082686e292feb2abfde13c515d95752901b6b380de5f36cc4658f42c2a2a21
MD5 ed19d5b0474b016df0bea1008d4e0a25
BLAKE2b-256 b35513825212eeecdd908359e3dcbd89baa482039aa4805a9e44af37f07e00b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page