{{ define "main" }} {{- $prev_page := false }} {{- /* Try to get the previous sibling */}} {{- with .Parent.Pages.Next . }} {{- /* Check if it's a section, if yes, get it's last page */}} {{- if (and .IsSection (gt .Pages.Len 0 )) }} {{- $prev_page = index .Pages.Reverse 0 }} {{ else }} {{- $prev_page = . }} {{ end }} {{ else }} {{- /* No previous sibling, use the parent itself */}} {{- $prev_page = .Parent }} {{ end }} {{- $next_page := false }} {{- if gt .Pages.Len 0 }} {{- $next_page = index .Pages 0 }} {{- else }} {{- with .Parent.Pages.Prev . }} {{- $next_page = . }} {{ end }} {{- end }} {{- $reading_time := 0}} {{- range .RegularPagesRecursive }} {{- $reading_time = add $reading_time .ReadingTime}} {{- end}}

{{ .Title }}

Total reading time: about {{ $reading_time }} min



{{ .Content }}
{{ partial "pagesTOC.html" (dict "page" . "header_level" 2) }}
{{ end }}