{{- /* Renders an archive section or sub-section of a page. Expects a section as input. Exemple usage: {{ partial "comic/archive.html" . }} */}} {{ $first_page := partial "func/FirstPageRecursive" . }} {{- $is_leaf_section := eq .Sections.Len 0 }}

{{ .Title }}

{{ .RegularPagesRecursive.Len }} pages

{{ .Content }}
{{- if $is_leaf_section }} {{- /* We got only regular pages, just render them as a list */}} {{- else }} {{- /* We got subsections pages, render them recursivelly */}} {{- range .Pages }} {{ partial "comic/archive.html" . }} {{- end }} {{- end }}