diff --git a/components/content/src/ser.rs b/components/content/src/ser.rs index 919d0d1bb6..d77a43dd16 100644 --- a/components/content/src/ser.rs +++ b/components/content/src/ser.rs @@ -162,6 +162,8 @@ pub struct SerializingSection<'a> { backlinks: Vec>, generate_feeds: bool, transparent: bool, + paginate_by: &'a Option, + paginate_reversed: bool, } #[derive(Debug)] @@ -226,6 +228,8 @@ impl<'a> SerializingSection<'a> { subsections, translations, backlinks, + paginate_by: §ion.meta.paginate_by, + paginate_reversed: section.meta.paginate_reversed, } } } diff --git a/docs/content/documentation/templates/pages-sections.md b/docs/content/documentation/templates/pages-sections.md index 97f9559614..1061796f48 100644 --- a/docs/content/documentation/templates/pages-sections.md +++ b/docs/content/documentation/templates/pages-sections.md @@ -112,8 +112,16 @@ backlinks: Array<{permalink: String, title: String?}>; generate_feeds: bool; // Whether this section is transparent. Taken from the front-matter if set transparent: bool; +// How many items per pager (if defined) +paginate_by: Number?; +// If items order is reversed in the pagination (defaults to false) +paginate_reversed: bool; ``` +Information about pagination is useful when using the `get_section` Tera function for which the `paginator` is not available. + +See [pagination template documentation](@/documentation/templates/pagination.md) for more information on the `paginator` variable. + ## Table of contents Both page and section templates have a `toc` variable that corresponds to an array of `Header`.