Flourish API: flourish.generators.base.IndexGenerator
IndexGenerator
is the class for generating pages that contain lists of
sources. For example: a list of links such as an archive page, or an
aggregated page such as a one-page summary.
Other than as noted below, it behaves the same as
BaseGenerator
.
from flourish.generators import base
PATHS = (
...
base.IndexGenerator(
name = 'homepage',
path = '/',
),
...
)
Class attributes
limit
— This generator should return no more thanlimit
sources.order_by
— This generator should sort matching sources in this way. Default value isNone
.sources_exclude
— This generator should exclude sources that match this filter. Default value isNone
.sources_filter
— This generator should only use sources that match this filter; see Filtering down to specific sources. Default value isNone
.template_name
— This generator should use this template when rendering the content. Default value isindex.html
.
Context variables
current_url
— the URL of this pageobjects
— a list of all matching source objects for the current URLpages
— a list of all matching source objects for the current URLsite
— a dictionary containing all of the keys in the_site.toml
configuration file
Mixins
IndexGenerator
includes the features of
PageIndexContextMixin
.