{# Those macros deal with introduction and navigation for series pages. Using macros have been prefered over partial inclusion or inline code to make sure series_ordered_pages is forced to be used. A section's pages natural order is invalid in case of reversed pagination which would lead to invalid series' pages order. To prevent this, pages are ordered correctly in a separate variable which must be used instead of the series section pages. #} {# Computes the introduction of a series's page. Parameters: - `page`: The page object being part of the series. - `series_section`: The series' section the page belongs to. - `series_ordered_pages`: The series' pages properly ordered (see at the top of this file for an explanation). - `language_strings`: A dictionary containing the translation strings. #} {% macro process_series_template(template_type, page, series_section, series_ordered_pages, language_strings) %} {%- if "series" in series_section.extra and series_section.extra.series -%} {# Prepare variables for substitution #} {%- set series_title = series_section.title -%} {%- set series_permalink = series_section.permalink -%} {%- set series_html_link = '' ~ series_section.title ~ '' -%} {# Build series pages list #} {%- set series_pages_list = [] -%} {%- for series_page in series_ordered_pages -%} {%- if series_page.relative_path == page.relative_path -%} {%- set series_pages_list_item = '