Skip to main content

Lektor plugin to generate blog-like index pages

Project description

Lektor Index Pages Plugin

PyPI version PyPI Supported Python Versions GitHub license Documentation Status GitHub Actions (Tests) Trackgit Views

This Lektor plugin can be used to generate “index pages” for a blog or similar collection of pages. These index pages list the blog posts segregated by some key, with each index page containing only those posts which match that key.

Examples of what this can be used for include:

  • Category Indexes: A set of index pages, one for each category, which lists all the posts in that category. (Multi-valued index keys are also supported, so that each post can appear on more than a single index page: e.g. keyword indexes.)

  • Date Indexes: A set of index pages, one for each year (say), which list all the posts in that year. (Sub-indexes are supported subindexes — e.g., each year index may have as children a sequence of month indexes.)

Behind the scenes, judicious caching of indexing results, and careful control of Lektor’s dependency tracking prevent all this from slowing the build process down too excruciatingly much.

Project Links

Author

Jeff Dairiki dairiki@dairiki.org

Changelog

Release 1.1.0 (2023-06-16)

  • Drop support for Lektor 3.2.x
  • Test under python 3.11
  • Add type annotations
  • Convert packaging from setuptools to PDM
  • Disuse pkg_resources in favor of importlib.metadata
  • Add pre-commit configuration
  • Run black and reorder-python-imports on code

Release 1.0 (2022-01-28)

  • Drop support for python 2.7 and 3.6.
  • Fix deprecation warning from jinja2. Jinja2 version 3 is now required.

Documentation

  • Documentation clarifications, updates and fixes. (PR #2 — Thank you Bart Van Loon!)

  • Add missing requirement recommonmark to docs/requirements.txt.

  • Add docs enviroment to tox.ini to test that docs will build cleanly.

Testing

  • Test under python 3.10 and lektor<3.3

Release 0.1 (2021-02-05)

No code changes.

Update development status classifier to "stable".

Release 0.1a3 (2020-05-08)

API changes

  • Added a key field on the index virtual source object. It is an alias to _id, but is syntactically more self-explanatory.

  • The keys configuration key has been renamed to key.

  • When the key expression is being evaluted, the record whose key(s) is(are) to be be computed is now available in the jinja context as item rather than this.

Documentation

  • Documentation moved from README to Sphinx docs at RTFD.io

Release 0.1a2 (2020-05-06)

API changes

  • The record argument has been dropped from the (jinja) global index_pages function. (Since indexes can not have multiple parents, it is not necessary.)

  • The parent configuration key has been renamed to parent_path.

  • The slug configuration key has been renamed to slug_format.

  • The attributes config section has been renamed to fields.

    Though they are not quite like regular Lektor Record fields, they are more field-like than attribute-like. (I.e. access is via getitem rather than getattr.)

Release 0.1a1 (2020-05-05)

Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lektor_index_pages-1.1.0.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

lektor_index_pages-1.1.0-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file lektor_index_pages-1.1.0.tar.gz.

File metadata

  • Download URL: lektor_index_pages-1.1.0.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.7.4 CPython/3.10.6

File hashes

Hashes for lektor_index_pages-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0badac99f9eb161e6db1c45378a3be03ab98ae11b8bd2104a7eb21d0d0e0f485
MD5 c5c7db6171690da41401779c5db24d8f
BLAKE2b-256 0134e79432f46f0e99a64c50fd7618fe4b26662cb78560bc994203e7a9fe29e8

See more details on using hashes here.

File details

Details for the file lektor_index_pages-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lektor_index_pages-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11848f70f746002057f25907e317e69a638e9ddddafcaf34126d7f9eee71e244
MD5 38ace1731d69f1f53cc93926ba1f0543
BLAKE2b-256 3265b45cad30f58f1c080f5e8817701a0c5d3d9e1506cb4ff600d46bafabe223

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page