{{ define "main" }} {{- partial "header.html" . -}}
{{ with .Date }}

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

{{ end }}

{{ .Title }}

{{ .Content }} {{ $.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 ($.Scratch.Get "site").RegularPages "Section" "catalogue") }} {{ $.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 }}