Enhance Article Navigation with the Neighbors Plugin for Pelican

Emily Techscribe Avatar

·

Enhance Article Navigation with the Neighbors Plugin for Pelican

If you’re a Pelican user looking to enhance the article navigation experience on your website, the Neighbors plugin is the solution you’ve been searching for. In this article, we’ll explore the features and benefits of the Neighbors plugin and show you how to integrate it into your Pelican-powered website. Whether you’re a web developer, content creator, or website owner, this plugin can significantly improve the user experience and engagement on your platform.

Introducing the Neighbors Plugin

The Neighbors plugin is designed to simplify article navigation on Pelican websites. It adds Next/Previous links to articles, allowing readers to seamlessly move from one article to another. With these navigation links, your visitors can easily explore related content, increasing their engagement and time spent on your website.

Installation

Installing the Neighbors plugin is quick and straightforward. Simply open your command line interface and execute the following command:

python -m pip install pelican-neighbors

Once the installation is complete, you’re ready to start using the Neighbors plugin.

Usage

The Neighbors plugin provides several additional variables that can be used in your Jinja article.html template:

  • next_article (newer)
  • prev_article (older)
  • next_article_in_category
  • prev_article_in_category
  • next_article_in_subcategory#
  • prev_article_in_subcategory#

To add article navigation to your template, you can use the following example code:

“`html+jinja

“`

This code snippet adds a simple list of links to the previous and next articles, allowing readers to navigate between them easily. You can also customize the appearance and placement of the navigation links to match your website’s design.

More Categories and Subcategory Support

The Neighbors plugin seamlessly integrates with other Pelican plugins such as the More Categories plugin and the Subcategory plugin. If you’re using any of these additional plugins, the Neighbors plugin extends its functionality to support them.

For websites utilizing the More Categories plugin, the Neighbors plugin adds navigation links specific to the categories. This allows readers to explore articles within the same category, providing them with more relevant content.

When using the Subcategory plugin, the Neighbors plugin considers the hierarchy of subcategories. It adds navigation links for each level of subcategory, allowing readers to navigate within specific subcategories with ease.

Limitations and Future Enhancements

It’s important to note that if an article has multiple categories, only the first category is considered by the Neighbors plugin for navigation purposes. However, this limitation is being actively addressed, and future updates may include support for multiple categories.

Conclusion

The Neighbors plugin is a valuable addition to any Pelican-powered website. By adding Next/Previous links to articles, you can significantly improve the user experience and engagement on your platform. Whether you’re a web developer, content creator, or website owner, integrating the Neighbors plugin into your Pelican website is a simple and effective way to enhance article navigation.

So why wait? Install the Neighbors plugin today and start enjoying the benefits of seamless article navigation on your Pelican website.

Contributed by Dr. Emily Techscribe

Note: This article is published as part of the Pelican Plugins Blog Series, which aims to showcase the capabilities of various plugins for the Pelican static site generator. For more plugin articles, stay tuned to our blog.

Leave a Reply

Your email address will not be published. Required fields are marked *