Series is a Pelican plugin that joins multiple posts into a series
Project description
Series: A Plugin for Pelican
Series is a Pelican plugin that joins multiple posts into a series. Globally, it provides a list of all the series, and for each article it provides a list of all articles in the same series and links to the next and previous articles in the series.
Installation
This plugin can be installed via:
python -m pip install pelican-series
As long as you have not explicitly added a PLUGINS setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add series to your existing PLUGINS list. For more information, please see the How to Use Plugins documentation.
Usage
In order to mark reStructuredText-formatted posts as part of a series, use the :series: metadata:
:series: NAME_OF_THIS_SERIES
Or, for Markdown-formatted content:
Series: NAME_OF_THIS_SERIES
The plugin collects all articles or pages belonging to the same series and provides series-related variables that you can use in your template.
Articles and pages
This plugin works both with articles and pages. As Pelican uses the specific variable article for article templates and page for page templates it is complicated to give examples that work for both cases. In the following documentation all example will mention article. (e.g. article.series, article.title) but the code works in the same way with page (e.g. page.series, page.title).
Article series and page series are created separately, so even if an article and a page have the same series they won't appear together.
Indexing
By default, articles in a series are ordered by date and then automatically numbered. Pages in a series are ordered by title and automatically numbered.
If you want to force a given order, specify :series_index: (reST) or series_index: (Markdown) in the article metadata, 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 with the default ordering (date for articles and title for pages).
The plugin provides the following variables to your templates:
article.series.nameis the name of the series as specified in the article metadataarticle.series.indexis the index of the current article inside the seriesarticle.series.allis an ordered list of all articles in the series (including the current one)article.series.all_previousis an ordered list of the articles published before the current onearticle.series.all_nextis an ordered list of the articles published after the current onearticle.series.previousis the previous article in the series (a shortcut toarticle.series.all_previous[-1]) orNonefor the first articlearticle.series.nextis the next article in the series (a shortcut toarticle.series.all_next[0]) orNonefor the last one
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 %}
Global Context
Warning: in version 3 the global key series has been renamed to article_series to differentiate it from the new global key page_series.
The plugin also adds the keys article_series and page_series to the global context. They are dictionaries of all series names (as keys) and items (as values). You can use that to list all the series in your site, for example
{% for series_name, series_articles in article_series.items() %}
{% set article = series_articles[0] %}
<article class="card">
<a href="{{ article.url }}" class="image">
<img src="/images/{{ article.image }}.jpg" alt="{{ article.image }}" />
</a>
<div class="card-body">
<a href="{{ article.url }}"><h3 class="card-title">{{ series_name }}</h3></a>
<ul class="actions">
<li><a href="{{ article.url }}" class="button">Start</a></li>
</ul>
</div>
</article>
{% endfor %}
As it is not possible to create pages from plugins you can leverage it to create a page for a specific series, even though you have to hard code the name of the series in the template.
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.
License
This project is licensed under the AGPL 3.0 license.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pelican_series-3.1.0.tar.gz.
File metadata
- Download URL: pelican_series-3.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2656ff855a9ea48e6bc80ba0ba9178a5077eba093d8e6423d3335300280184a
|
|
| MD5 |
847f76e34cf3cb2a598811e3e674ea13
|
|
| BLAKE2b-256 |
2cc9f198ab0a2861ed18caa8d50fcba979b0d1ae90436ad48a181a46206d54c8
|
Provenance
The following attestation bundles were made for pelican_series-3.1.0.tar.gz:
Publisher:
main.yml on pelican-plugins/series
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pelican_series-3.1.0.tar.gz -
Subject digest:
d2656ff855a9ea48e6bc80ba0ba9178a5077eba093d8e6423d3335300280184a - Sigstore transparency entry: 654280230
- Sigstore integration time:
-
Permalink:
pelican-plugins/series@01d842f85a07f9c6b70d44b3d5eeb28cfa935a71 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pelican-plugins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@01d842f85a07f9c6b70d44b3d5eeb28cfa935a71 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pelican_series-3.1.0-py3-none-any.whl.
File metadata
- Download URL: pelican_series-3.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
049cccc89f03bc00349af89d190b97b04b0242ecee676272612d492d563d2dda
|
|
| MD5 |
55a4a9df12acfdeb30988b464ae653c7
|
|
| BLAKE2b-256 |
3c1b465ddf3d5eb8a450320ed0b736e838ef236a72fe5ed7a23364b39ed2dacc
|
Provenance
The following attestation bundles were made for pelican_series-3.1.0-py3-none-any.whl:
Publisher:
main.yml on pelican-plugins/series
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pelican_series-3.1.0-py3-none-any.whl -
Subject digest:
049cccc89f03bc00349af89d190b97b04b0242ecee676272612d492d563d2dda - Sigstore transparency entry: 654280252
- Sigstore integration time:
-
Permalink:
pelican-plugins/series@01d842f85a07f9c6b70d44b3d5eeb28cfa935a71 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pelican-plugins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@01d842f85a07f9c6b70d44b3d5eeb28cfa935a71 -
Trigger Event:
push
-
Statement type: