Skip to content

Archive

Archives are a BasePage object used to display a list of Page objects in a Collection.

Archive objects create a customizeable page that can be controlled via its parent Collction.

Bases: BasePage

The Archive is a Page object used by the collection that focuses on presenting the Collection's pages.

Parameters:

Name Type Description Default
pages list[BasePage]

The list of pages to include in the archive

required
title str

The title of the archive

required
template str | jinja2.Template

The template to use for the archive

required
routes list[str | pathlib.Path]

The routes for where the archive page should be generated

required
archive_index int

The index of the page in the series of archive pages

0
num_of_pages

The total number of pages in the series of archive pages

required

Not Directly Used

The Archive object is not meant to be used directly. It is used by the Collection object. Attributes can be used to customize.

Collection.archives yields a generator of Archive objects. Each Archive object will have a pages attribute that is a list of Page objects referenced in that Archive Page. The number of pages is determined by the Collection.items_per_page attribute.

The slug of the Archive Page is determined by whether the Archive is paginated.

If there is more than one archive page, the Archive.archive_index will be appended to the Archive.slug . For example, if the Archive.slug is archive and the Archive.archive_index is 2, the Archive Page will have a slug of archive2.