single.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {{ define "main" }}
  2. {{- partial "header.html" . -}}
  3. <div class="container single page">
  4. <aside>
  5. {{ .TableOfContents }}
  6. </aside>
  7. <article>
  8. {{ with .Date }}<h3>{{ .Format "January 2, 2006" }} - {{ $.Param "author" }}</h3>{{ end }}
  9. <h1>{{ .Title }}</h1>
  10. {{ .Content }}
  11. {{ $.Scratch.Set "pageTitle" .Title }}
  12. {{ $.Scratch.Set "site" .Site }}
  13. {{ $.Scratch.Set "prev" .PrevInSection }}
  14. {{ $.Scratch.Set "next" .NextInSection }}
  15. {{ with .Section}}
  16. {{ range last 1 (where ($.Scratch.Get "site").RegularPages "Section" "catalogue") }}
  17. {{ if ne .Title ($.Scratch.Get "pageTitle") }}
  18. <p>
  19. <a href="{{ .Permalink }}"><< Give us that ole classic</a>
  20. </p>
  21. {{ end }}
  22. {{ $.Scratch.Set "firstTitle" .Title }}
  23. {{ with ($.Scratch.Get "prev") }}
  24. {{ if ne .Title ($.Scratch.Get "firstTitle") }}
  25. <p>
  26. <a href="{{ .Permalink }}">< Tell us that one from the other day</a>
  27. </p>
  28. {{ end }}
  29. {{ end }}
  30. {{ end }}
  31. {{ range first 1 (where ($.Scratch.Get "site").RegularPages "Section" "catalogue") }}
  32. {{ $.Scratch.Set "latestTitle" .Title }}
  33. {{ with ($.Scratch.Get "next") }}
  34. {{ if ne .Title ($.Scratch.Get "latestTitle") }}
  35. <p>
  36. <a href="{{ .Permalink }}">Spin me another tale, keeper ></a>
  37. </p>
  38. {{ end }}
  39. {{ end }}
  40. {{ if ne .Title ($.Scratch.Get "pageTitle") }}
  41. <p>
  42. <a href="{{ .Permalink }}">Give us something new >></a>
  43. </p>
  44. {{ end }}
  45. {{ end }}
  46. {{ end }}
  47. {{- partial "footer.html" . -}}
  48. </article>
  49. </div>
  50. {{ end }}