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.

89 lines
3.6 KiB

  1. {{ $s := partialCached "scratch.html" . }}
  2. {{ $currentNode := . }}
  3. {{ $currentDir := "" }}
  4. {{ with .File }}
  5. {{ $currentDir = .Dir }}
  6. {{ end }}
  7. {{ $currentFile := (printf "/%s" .File) }}
  8. {{ $scratch := $s.Get $currentFile }}
  9. <div id="ph-{{ .File.UniqueID }}" class="{{ $scratch.depth | default "crust" }}title"><span class="supt">{{ substr $currentDir 0 -1 }}⁄</span>{{ .Title }}</div>
  10. <div class="grid">
  11. <div class="leftcolumn">
  12. {{ if ne (trim .Page.TableOfContents "\n") "<nav id=\"TableOfContents\"></nav>" }}
  13. {{ .Page.TableOfContents }}
  14. {{ end }}
  15. </div>
  16. <div class="rightcolumn">
  17. {{ $closeDivs := false }}
  18. {{ $sandnamePlural := (slice) }}
  19. {{ range $k, $v := $.Site.Data.sandpointsnamegraph }}
  20. {{ $sandnamePlural = $sandnamePlural | append $v }}
  21. {{ end }}
  22. {{ $paramsKeys := (slice) }}
  23. {{ range $k, $v := $currentNode.Params }}
  24. {{ $paramsKeys = $paramsKeys | append $k }}
  25. {{ end }}
  26. {{ $mentions := intersect $paramsKeys $sandnamePlural }}
  27. {{ range $mention := $mentions }}
  28. {{ range $k, $m := index $currentNode.Params $mention }}
  29. {{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }}
  30. {{- with $.GetPage $mentionLink -}}
  31. {{ with not $k }}
  32. {{ $closeDivs = true }}
  33. <div class="has hasauthors">
  34. <div class="hassup">{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ substr $mention 0 -1 }}{{ end }}{{ end }}⁄</div>
  35. <div class="afterhas">
  36. {{ end }}
  37. <div class="crust">
  38. <a href="#ph-{{ .File.UniqueID }}">{{ .Title }}</a>
  39. </div>
  40. {{ end }}
  41. {{ end }}
  42. {{ end }}
  43. {{- with $closeDivs -}}</div></div>{{ end }}
  44. {{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }}
  45. <div class="has hashas">
  46. {{ with $scratch.has }}
  47. <div class="hassup">has {{ $scratch.has }}⁄</div>
  48. {{ end }}
  49. <div class="afterhas">
  50. {{ range $scratch.has_children }}
  51. {{ $authors := "" }}
  52. {{ range $k, $authorLink := .Params.authors }}
  53. {{ $authorPage := $.GetPage (printf "/author/%s" $authorLink) }}
  54. {{ $prefix := ", " }}
  55. {{ with not $k }}
  56. {{ $prefix = "" }}
  57. {{ end }}
  58. {{ $authors = printf "%s%s" $prefix $authorPage.Title }}
  59. {{ end }}
  60. <div class="{{ $scratch.child_depth }} crustoc">
  61. <a class="toc" href="#ph-{{ .File.UniqueID }}"><span><span class="back">{{ .Title }} {{with $authors}}({{ $authors }}){{ end }}</span></span></a>
  62. </div>
  63. {{ end }}
  64. </div></div>
  65. {{ end }}
  66. {{ if eq $scratch.depth "crust" }}
  67. <div class="has hasin">
  68. <div class="hassup">in {{ index $scratch.in 1 }}⁄</div>
  69. <div class="afterhas">
  70. {{ range $scratch.is_in }}
  71. <div class="{{ substr $currentDir 0 -1 }}">
  72. <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
  73. </div>
  74. {{ end }}
  75. </div></div>
  76. {{ end }}
  77. </div>
  78. </div>
  79. {{ with .Page.Params.abstract }}<div class="abstract"><span class="supt">abstract⁄</span>{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}</div>{{ end }}
  80. {{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div class="keywords"><span class="sup">keywords⁄</span>{{- $v -}}{{- else -}},&nbsp;{{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}