Skip to content

Pagination plugin for Pelican static site generator

Notifications You must be signed in to change notification settings

stemoretti/pagination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Pagination Filter Plugin for Pelican

This plugin adds a filter function pagination that returns a list of numbers from 1 to n and abbreviated with 0 if too long.

Usage

Enable the plugin in your pelicanconf.py:

PLUGINS = [ 'pagination' ]

Use the filter in a theme as follows:

<ul>
{% for cpage articles_paginator.num_pages | pagination(articles_page.number) %}
  <li>
  {% if cpage != 0 %}
    <a href="{{ articles_paginator.page(cpage).url }}">{{ cpage }}</a>
  {% else %}
    <span>...</span>
  {% endif %}
  </li>
{% endfor %}
</ul>

Credits

The filter function is a modified version of the original in this stackexchange answer.

About

Pagination plugin for Pelican static site generator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages