akhayyat / pelican-page-order

A Pelican plugin that adds a page_order attribute to all pages if one is not defined.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Page Order

Author: Ahmad Khayyat (akhayyat@gmail.com)

A Pelican plugin that adds a page_order attribute to all pages if one is not defined. Allows your templates to sort pages as follows:

{% for p in PAGES|sort(attribute='page_order') %}

Without this plugin, to be able to use the line above in your templates, you would have to define the page_order attribute in all pages. This plugin sets the value of this attribute to a default value of 100, unless a DEFAULT_PAGE_ORDER setting is defined.

The page_order attribute is cast to an int, so only use numeric values. This is to have a value of 11 be greater than 2.

License

Licence: BSD. See included LICENSE file.

About

A Pelican plugin that adds a page_order attribute to all pages if one is not defined.

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 100.0%