{{- define "singlebody" -}}
  {{ $s := partialCached "scratch.html" . }}
  {{ $p := $.GetPage .Params.print }}
  {{ $scratch := $s.Get (printf "/%s" $p.File) }}

  {{ $currentDir := "" }}
  {{ with .File }}
    {{ $currentDir = .Dir }}
  {{ end }}

  <div class="print0">{{ partial "singlebody.html" $p }}</div>
  <div class="content">{{ $p.Content }}
    {{ range $printPage := $scratch.has_cildren }}
      <div class="print1">{{ partial "singlebody.html" $printPage }}</div>
      <div class="content">{{ $printPage.Content }}
        {{ $printPageScratch := $s.Get (printf "/%s" $printPage.File) }}
        {{ range $printPageKid := $printPageScratch.has_children }}
          <div class="print2">{{ partial "singlebody.html" $printPageKid }}</div>
          <div class="content">{{ $printPageKid.Content }}
            {{ . }}
        {{ end }}
          </div>
    {{ end }}
{{- end -}}
