SourceGenerator is the class for generating individual source pages.
Other than as noted below, it behaves the same as
from flourish.generators import base PATHS = ( ... base.SourceGenerator( name = 'source', path = '/#slug', ), ... )
limit— This generator should return no more than
order_by— This generator should sort matching sources in this way. Default value is
None. However, as this generator is meant for generating single sources, it is also meaningless in this case.
sources_exclude— This generator should exclude sources that match this filter. Default value is
sources_filter— This generator should only use sources that match this filter; see Filtering down to specific sources. Default value is
template_name— This generator should use this template when rendering the content. Default value is
current_url— the URL of this page
objects— a list of all matching source objects for the current URL
page— the source object matching the current URL
site— a dictionary containing all of the keys in the
...— every key that has been set in the matching source object
PageGenerator includes the features of
Generator method flow
This method is altered to returns the value of
template_name unless the
page source has set the key
page_type, in which case it returns the value of
page_type with ".html" appended, or if the key
template has been set, when
that value is returned unaltered.
For example, the following TOML would give a template name of
title = 'Grand Canyon' page_type = 'photo' ...
whereas this would give a template name of
title = 'Grand Canyon' page_type = 'photo' template = 'broken' ...