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.
 
 
 
 
 

64 lines
2.6 KiB

  1. {{ define "main" }}
  2. {{$currentNode := . }}
  3. {{ $graphOptions := newScratch }}
  4. {{ range $k, $v := $.Site.Data.sandpointsnamegraph }}
  5. {{ if eq (substr $currentNode.File.Dir 0 -1) $k }}
  6. {{ $graphOptions.Set "plural" (index $v "plural") }}
  7. {{ $graphOptions.Set "depth" (index $v "depth") }}
  8. {{ with index $v "in" }}
  9. {{ $graphOptions.Set "in" (index $v "in") }}
  10. {{ end }}
  11. {{ with index $v "has" }}
  12. {{ $graphOptions.Set "has" (index $v "has") }}
  13. {{ end }}
  14. {{ end }}
  15. {{ end }}
  16. <div class="{{ $graphOptions.Get "depth" }}title"><span class="sup">{{ substr .File.Dir 0 -1 }}⁄{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div>
  17. <div class="grid">
  18. <div class="leftcolumn">
  19. {{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
  20. {{ .Page.TableOfContents }}
  21. {{ end }}
  22. </div>
  23. <div class="rightcolumn">
  24. {{ if (not (eq ($graphOptions.Get "depth") "crust")) }}
  25. <div class="has">
  26. <span class="sup">has {{ index ($graphOptions.Get "has") 1 }}⁄</span>
  27. </div>
  28. <div class="afterhas">
  29. {{ range index $currentNode.Params (printf "has_%s" (index ($graphOptions.Get "has") 1) )}}
  30. {{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($graphOptions.Get "has") 0)) . ) }}
  31. <div class="{{ index ($graphOptions.Get "has") 0 }}">
  32. <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
  33. </div>
  34. {{ end }}
  35. {{ end }}
  36. {{ end }}
  37. {{ if eq ($graphOptions.Get "depth") "crust" }}
  38. <div class="has">
  39. <span class="sup">in {{ index ($graphOptions.Get "in") 1 }}⁄</span>
  40. </div>
  41. {{ range where $.Site.RegularPages ".Section" (index ($graphOptions.Get "in") 0) }}
  42. {{ if in (index .Params (printf "has_%s" ($graphOptions.Get "plural"))) $currentNode.File.LogicalName }}
  43. <div class="{{ substr .File.Dir 0 -1 }}">
  44. <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
  45. </div>
  46. {{ else if in $currentNode.Params.is_in .File.LogicalName }}
  47. <div class="{{ substr .File.Dir 0 -1 }}">
  48. <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
  49. </div>
  50. {{ end }}
  51. {{ end }}
  52. {{ end }}
  53. </div>
  54. </div>
  55. </div>
  56. <div class="content">{{ .Content }}</div>
  57. {{ end }}