{{ page.title }}
{#- A page is part of a series if one of the sections above (whether it is transparent or not) has the `extra.series` parameter set to true. -#} {#- As a series might be a transparent section in order to mix up its articles with those of the section just above or the root, -#} {#- there is no other way but to compute the potential path of each ancestor section related to the page and look for the first one being a series. -#} {#- Using the `ancestors` field of a section is not possible because transparent sections are not present in this field. -#} {%- set series_path_components = [] -%} {%- set section_paths = [] -%} {%- for path in page.relative_path | split(pat="/") | slice(end=-1) -%} {%- set_global series_path_components = series_path_components | concat(with=path) -%} {%- set section_path = series_path_components | concat(with="_index.md") | join(sep="/") -%} {%- set_global section_paths = section_paths | concat(with=section_path) -%} {%- endfor -%} {#- The series the page is part of is the closest section flagged as a series, if any -#} {%- for section_path in section_paths | reverse -%} {%- set section_file_exists = load_data(path=section_path, required=false) -%} {%- if section_file_exists -%} {%- set loaded_section = get_section(path=section_path,lang=lang) -%} {%- if "series" in loaded_section.extra and loaded_section.extra.series -%} {%- set_global series_section = loaded_section -%} {%- set_global series_ordered_pages = loaded_section.pages -%} {%- if loaded_section.paginated | default(value=0) > 0 and loaded_section.paginate_reversed -%} {%- set_global series_ordered_pages = loaded_section.pages | reverse -%} {%- endif -%} {%- break -%} {%- endif -%} {%- endif -%} {%- endfor -%} {% if page.extra.tldr %}
TL;DR
{{ page.extra.tldr | markdown | safe }}
- ' -%}
{%- if footnotes_marker in content_with_intro -%}
{%- set content_sections = processed_content | split(pat=footnotes_marker) -%}
{%- set main_content = content_sections | first -%}
{%- set footnotes_content = content_sections | slice(start=1) | join(sep=footnotes_marker) -%}
{%- set processed_content = main_content ~ series_outro_html ~ footnotes_marker ~ footnotes_content -%}
{%- else -%}
{%- set processed_content = processed_content ~ series_outro_html -%}
{%- endif -%}
{%- endif -%}
{#- Replace TOC and render final content -#}
{#- The replace pattern is used to enable arbitrary locations for the Table of Contents -#}
{#- This is Philipp Oppermann's workaround: https://github.com/getzola/zola/issues/584#issuecomment-474329637 -#}
{{ processed_content | replace(from="", to=macros_toc::toc(page=page, header=false, language_strings=language_strings)) | safe }}