You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
3.0 KiB

  1. {{ define "singlebody" }}
  2. {{ $currentNode := . }}
  3. {{ $currentDir := "" }}
  4. {{ with .File }}
  5. {{ $currentDir = .Dir }}
  6. {{ end }}
  7. {{ $currentFile := (printf "/%s" .File) }}
  8. {{ $editFile := $.Site.GetPage "/edit" }}
  9. {{ $editFilePath := $editFile.RelPermalink }}
  10. <div class="coretitle"><span class="supt">Sitemap⁄{{ substr $.Site.Title 0 1 }}</span>{{ substr $.Site.Title 1 }} {{with $currentDir}}({{ . }}){{ end }}</div>
  11. {{ $s := partialCached "scratch.html" . }}
  12. {{ $noTriad := (slice) }}
  13. {{ range $p := .Site.RegularPages }}
  14. {{ $scratch := $s.Get (printf "/%s" $p.File) }}
  15. {{ if eq $scratch.depth "core" }}
  16. <div class="sitemap" ><div class="{{ with $p.File }}{{ if eq $currentDir .Dir }}highline{{ end }}{{ end }}"><a href="{{- $p.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $p.Title}} title="{{- $p.Title -}}"{{- end -}}><span class="sup">{{- substr $p.File.Dir 0 -1 -}}⁄</span>{{- $p.Title -}}</a><a class="svedit" href="{{- printf "%sindex.html#%s" $editFilePath $p.File.UniqueID -}}">[EDIT]</a></div>
  17. {{ range $coreKid := $scratch.has_children }}
  18. <div class="sitemap"><a href="{{- $coreKid.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $coreKid.Title}} title="{{- $coreKid.Title -}}"{{- end -}}><div class="{{ with $coreKid.File }}{{ if eq $currentDir .Dir }}highline{{ end }}{{ end }}"><span class="sup">{{- substr $coreKid.File.Dir 0 -1 -}}⁄</span>{{- $coreKid.Title -}}</a><a class="svedit" href="{{- printf "%sindex.html#%s" $editFilePath $coreKid.File.UniqueID -}}">[EDIT]</a></div>
  19. {{ $scratchCKid := $s.Get (printf "/%s" $coreKid.File) }}
  20. {{ range $mantleKid := $scratchCKid.has_children }}
  21. <div class="sitemap"><div class="{{ with $mantleKid.File }}{{ if eq $currentDir .Dir }} highline{{ end }}{{ end }}"><a href="{{- $mantleKid.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $mantleKid.Title}} title="{{- $mantleKid.Title -}}"{{- end -}}><span class="sup">{{ with $mantleKid.File }}{{substr .Dir 0 -1 -}}⁄{{ end }}</span>{{- $mantleKid.Title -}}</a><a class="svedit" href="{{- printf "%sindex.html#%s" $editFilePath $mantleKid.File.UniqueID -}}">[EDIT]</a></div></div>
  22. {{ end }}
  23. </div>
  24. {{ end }}
  25. {{ else if not (in (slice "core" "mantle" "crust") $scratch.depth)}}
  26. {{ $noTriad = $noTriad | append $p }}
  27. {{ else }}
  28. </div>
  29. {{ end }}
  30. {{ end }}
  31. {{ range $noTriad }}
  32. <div class="sitemap {{ with .File }}{{ if eq $currentDir .Dir }} highline{{ end }}{{ end }}"><a href="{{- .RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with .Title }} title="{{- . -}}"{{- end -}}><span class="sup">{{- substr .File.Dir 0 -1 -}}⁄</span>{{- .Title -}}</a>{{ if not (or (hasPrefix .File.Dir "edit") (hasPrefix .File.Dir "print")) }}<a class="svedit" href="{{- printf "%sindex.html#%s" $editFilePath .File.UniqueID -}}">[EDIT]</a>{{ end }}</div>
  33. {{ end }}
  34. {{ end }}