{{ define "main" }} {{ if or ( not ( isset .Params "date" ) ) ( lt .Date now ) }}

{{ .Title }}

{{ with .Date }}

{{ .Format "January 2, 2006" }} - {{ $.Param "author" }}

{{ end }} {{ .Content }} {{ else }}

Soon to come, check back on {{ .Date.Format "January 2, 2006" }}!


{{ end }} {{ $.Scratch.Set "pageTitle" .Title }} {{ $.Scratch.Set "site" .Site }} {{ $.Scratch.Set "prev" .PrevInSection }} {{ $.Scratch.Set "next" .NextInSection }} {{ with .Section}} {{ range last 1 (where ($.Scratch.Get "site").RegularPages "Section" "catalogue") }} {{ if ne .Title ($.Scratch.Get "pageTitle") }}

<< Give us that ole classic

{{ end }} {{ $.Scratch.Set "firstTitle" .Title }} {{ with ($.Scratch.Get "prev") }} {{ if ne .Title ($.Scratch.Get "firstTitle") }}

< Tell us that one from the other day

{{ end }} {{ end }} {{ end }} {{ range first 1 (where (where ($.Scratch.Get "site").RegularPages "Section" "catalogue") "Params.date" "lt" now) }} {{ $.Scratch.Set "latestTitle" .Title }} {{ with ($.Scratch.Get "next") }} {{ if ne .Title ($.Scratch.Get "latestTitle") }}

Spin me another tale, keeper >

{{ end }} {{ end }} {{ if ne .Title ($.Scratch.Get "pageTitle") }}

Give us something new >>

{{ end }} {{ end }} {{ end }} {{- partial "footer.html" . -}} {{ end }}