This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This plugin adds next_article (newer) and prev_article (older) variables to the article’s context.

Also adds next_article_in_category and prev_article_in_category.

Usage

 <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>

Usage with the Subcategory plugin

If you want to get the neigbors within a subcategory it’s a little different. 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 Foo/Bar. Therefor the usage with subcategories 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>
Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pelican_neighbors-1.0.0-py2.py3-none-any.whl (4.4 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Dec 18, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting