single.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {{ define "main" }}
  2. {{- partial "header.html" . -}}
  3. <div class="container single page">
  4. <aside>
  5. {{ .TableOfContents }}
  6. </aside>
  7. <article>
  8. {{ if or ( or ( not ( isset .Params "date" ) ) ( lt .Date now ) ) ( eq ( .Site.Params.ShowFuture ) "TRUE" ) }}
  9. {{ with .Date }}<h3>{{ .Format "January 2, 2006" }} - {{ $.Param "author" }}</h3>{{ end }}
  10. <h1>{{ .Title }}</h1>
  11. {{ .Content }}
  12. {{ else }}
  13. <h1>Soon to come, check back on {{ .Date.Format "January 2, 2006" }}!</h1>
  14. <br/>
  15. <h4>Want early access to content? <a href="{{ .Site.Params.PatreonLink }}">Come support us on Patreon!</a></h4>
  16. <h4>Already a patron? <a href="{{ .Site.Params.PreviewLink }}">Access early content here!</a> (Requires Logging in via Patreon)</h4>
  17. <br/>
  18. {{ end }}
  19. {{ $.Scratch.Set "pageTitle" .Title }}
  20. {{ $.Scratch.Set "site" .Site }}
  21. {{ $.Scratch.Set "prev" .PrevInSection }}
  22. {{ $.Scratch.Set "next" .NextInSection }}
  23. {{ with .Section}}
  24. {{ range last 1 (where ($.Scratch.Get "site").RegularPages "Section" "catalogue") }}
  25. {{ if ne .Title ($.Scratch.Get "pageTitle") }}
  26. <p>
  27. <a href="{{ .Permalink }}"><< Give us that ole classic</a>
  28. </p>
  29. {{ end }}
  30. {{ $.Scratch.Set "firstTitle" .Title }}
  31. {{ with ($.Scratch.Get "prev") }}
  32. {{ if ne .Title ($.Scratch.Get "firstTitle") }}
  33. <p>
  34. <a href="{{ .Permalink }}">< Tell us that one from the other day</a>
  35. </p>
  36. {{ end }}
  37. {{ end }}
  38. {{ end }}
  39. {{ if eq ( ($.Scratch.Get "site").Params.ShowFuture ) "TRUE" }}
  40. <!-- Direct link to latest article regardles of date -->
  41. {{ range first 1 (where ($.Scratch.Get "site").RegularPages "Section" "catalogue") }}
  42. {{ $.Scratch.Set "latestTitle" .Title }}
  43. {{ with ($.Scratch.Get "next") }}
  44. {{ if ne .Title ($.Scratch.Get "latestTitle") }}
  45. <p>
  46. <a href="{{ .Permalink }}">Spin me another tale, keeper ></a>
  47. </p>
  48. {{ end }}
  49. {{ end }}
  50. {{ if ne .Title ($.Scratch.Get "pageTitle") }}
  51. <p>
  52. <a href="{{ .Permalink }}">Give us something new >></a>
  53. </p>
  54. {{ end }}
  55. {{ end }}
  56. {{ else }}
  57. <!-- Direct link to latest article not in the future -->
  58. {{ range first 1 (where (where ($.Scratch.Get "site").RegularPages "Section" "catalogue") "Params.date" "lt" now) }}
  59. {{ $.Scratch.Set "latestTitle" .Title }}
  60. {{ with ($.Scratch.Get "next") }}
  61. {{ if ne .Title ($.Scratch.Get "latestTitle") }}
  62. <p>
  63. <a href="{{ .Permalink }}">Spin me another tale, keeper ></a>
  64. </p>
  65. {{ end }}
  66. {{ end }}
  67. {{ if ne .Title ($.Scratch.Get "pageTitle") }}
  68. <p>
  69. <a href="{{ .Permalink }}">Give us something new >></a>
  70. </p>
  71. {{ end }}
  72. {{ end }}
  73. {{ end }}
  74. {{ end }}
  75. {{- partial "footer.html" . -}}
  76. </article>
  77. </div>
  78. {{ end }}