single.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {{ define "main" }}
  2. {{ if or ( not ( isset .Params "date" ) ) ( lt .Date now ) }}
  3. <h2>{{ .Title }}</h2>
  4. {{ with .Date }}<h3>{{ .Format "January 2, 2006" }} - {{ $.Param "author" }}</h3>{{ end }}
  5. {{ .Content }}
  6. {{ else }}
  7. <h3>Soon to come, check back on {{ .Date.Format "January 2, 2006" }}!</h3>
  8. <br/>
  9. {{ end }}
  10. {{ $.Scratch.Set "pageTitle" .Title }}
  11. {{ $.Scratch.Set "site" .Site }}
  12. {{ $.Scratch.Set "prev" .PrevInSection }}
  13. {{ $.Scratch.Set "next" .NextInSection }}
  14. {{ with .Section}}
  15. {{ range last 1 (where ($.Scratch.Get "site").RegularPages "Section" "catalogue") }}
  16. {{ if ne .Title ($.Scratch.Get "pageTitle") }}
  17. <p>
  18. <a href="{{ .Permalink }}"><< Give us that ole classic</a>
  19. </p>
  20. {{ end }}
  21. {{ $.Scratch.Set "firstTitle" .Title }}
  22. {{ with ($.Scratch.Get "prev") }}
  23. {{ if ne .Title ($.Scratch.Get "firstTitle") }}
  24. <p>
  25. <a href="{{ .Permalink }}">< Tell us that one from the other day</a>
  26. </p>
  27. {{ end }}
  28. {{ end }}
  29. {{ end }}
  30. {{ range first 1 (where (where ($.Scratch.Get "site").RegularPages "Section" "catalogue") "Params.date" "lt" now) }}
  31. {{ $.Scratch.Set "latestTitle" .Title }}
  32. {{ with ($.Scratch.Get "next") }}
  33. {{ if ne .Title ($.Scratch.Get "latestTitle") }}
  34. <p>
  35. <a href="{{ .Permalink }}">Spin me another tale, keeper ></a>
  36. </p>
  37. {{ end }}
  38. {{ end }}
  39. {{ if ne .Title ($.Scratch.Get "pageTitle") }}
  40. <p>
  41. <a href="{{ .Permalink }}">Give us something new >></a>
  42. </p>
  43. {{ end }}
  44. {{ end }}
  45. {{ end }}
  46. {{- partial "footer.html" . -}}
  47. {{ end }}