{{ define "main" }} {{- $isNotesRoot := .Parent.IsHome -}}

{{ .Title }}

{{ partial "document-view.html" . }}
{{ .Content }} {{- if $isNotesRoot }} {{- with .RegularPages.ByTitle }}

STANDALONE NOTES

{{- end }} {{- with .Sections.ByWeight }}

SERIES

{{- end }} {{- else }} {{- with .RegularPages.ByWeight }}

ARTICLES

    {{- range $index, $page := . }}
  1. {{ printf "%02d" (add $index 1) }} {{ $page.LinkTitle }} updated {{ time.Format "2006-01-02" $page.Params.updated }}
  2. {{- end }}
{{- end }} {{- with .Sections.ByWeight }}

SUBSERIES

    {{- range $index, $series := . }}
  1. {{ printf "%02d" (add $index 1) }} {{ $series.LinkTitle }}/{{ with $series.Params.description }} — {{ . }}{{ end }}
  2. {{- end }}
{{- end }} {{- end }}
{{ end }}