
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Neighbors is a Pelican plugin that adds Next/Previous links to articles.
This plugin can be installed via:
python -m pip install pelican-neighbors
This plugin adds a couple of new variables to the article's context:
next_article
(newer)prev_article
(older)next_article_in_category
prev_article_in_category
next_article_in_subcategory#
prev_article_in_subcategory#
Here is an example on how to add article navigation in your Jinja article.html
template:
<ul>
{% if article.prev_article %}
<li>
<a href="{{ SITEURL }}/{{ article.prev_article.url}}">
{{ article.prev_article.title }}
</a>
</li>
{% endif %}
{% if article.next_article %}
<li>
<a href="{{ SITEURL }}/{{ article.next_article.url}}">
{{ article.next_article.title }}
</a>
</li>
{% endif %}
</ul>
<ul>
{% if article.prev_article_in_category %}
<li>
<a href="{{ SITEURL }}/{{ article.prev_article_in_category.url}}">
{{ article.prev_article_in_category.title }}
</a>
</li>
{% endif %}
{% if article.next_article_in_category %}
<li>
<a href="{{ SITEURL }}/{{ article.next_article_in_category.url}}">
{{ article.next_article_in_category.title }}
</a>
</li>
{% endif %}
</ul>
You can use the Neighbors plugin with the More Categories plugin.
Since an article can belong to more than one subcategory, subcategories are
stored in a list. If you have an article with subcategories like
foo/bar/baz
, it will belong to both subcategory bar
and bar/baz
.
Subcategory neighbors are added to an article as next_article_in_subcategory#
and prev_article_in_subcategory#
, where #
is the level of subcategory.
Using the example above:
subcategory0
is foo
subcategory1
will be foo/bar
subcategory2
will be foo/bar/baz
You can use the Neighbors plugin in conjunction with the Subcategory plugin.
Since an article can belong to more than one subcategory, subcategories are
stored in a list. If you have an article with subcategories like
Category/Foo/Bar
, it will belong to both subcategory Foo
, and Foo/Bar
.
Subcategory neighbors are added to an article as next_article_in_subcategory#
and prev_article_in_subcategory#
where #
is the level of subcategory. So
using the example from above, subcategory1
will be Foo
, and subcategory2
will be Foo/Bar
.
The usage with subcategories from either the Subcategory plugin or the More Categories plugin is:
<ul>
{% if article.prev_article_in_subcategory1 %}
<li>
<a href="{{ SITEURL }}/{{ article.prev_article_in_subcategory1.url}}">
{{ article.prev_article_in_subcategory1.title }}
</a>
</li>
{% endif %}
{% if article.next_article_in_subcategory1 %}
<li>
<a href="{{ SITEURL }}/{{ article.next_article_in_subcategory1.url}}">
{{ article.next_article_in_subcategory1.title }}
</a>
</li>
{% endif %}
</ul>
<ul>
{% if article.prev_article_in_subcategory2 %}
<li>
<a href="{{ SITEURL }}/{{ article.prev_article_in_subcategory2.url}}">
{{ article.prev_article_in_subcategory2.title }}
</a>
</li>
{% endif %}
{% if article.next_article_in_subcategory2 %}
<li>
<a href="{{ SITEURL }}/{{ article.next_article_in_subcategory2.url}}">
{{ article.next_article_in_subcategory2.title }}
</a>
</li>
{% endif %}
</ul>
If an article has multiple categories, only the first category is considered.
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.
FAQs
Neighbors is a Pelican plugin that adds Next/Previous links to articles
We found that pelican-neighbors demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.