{{ .Date.Format "2006-01-02" }}
{{ if .Title }}

{{ .Title }}

{{ end }}
{{ .Content }}
{{ $pages := .CurrentSection.Pages.ByDate.Reverse }} {{ $.Scratch.Set "older" nil }} {{ $.Scratch.Set "newer" nil }} {{ range $i, $p := $pages }} {{ if eq $p.File.Path $.File.Path }} {{ if lt (add $i 1) (len $pages) }} {{ $.Scratch.Set "older" (index $pages (add $i 1)) }} {{ end }} {{ if gt $i 0 }} {{ $.Scratch.Set "newer" (index $pages (sub $i 1)) }} {{ end }} {{ end }} {{ end }} {{/* Determine background audio for this page: prefer page resources, then section subfolder */}} {{ $folder := path.Base (printf "%s" .File.Dir) }} {{ $paudios := .Resources.Match "*.{mp3,m4a,ogg,wav,opus,OPUS,OGG,WAV,MP3,M4A}" }} {{ $audio := index $paudios 0 }} {{ if not $audio }} {{ $secAudios := .CurrentSection.Resources.Match (printf "**/%s/*.{mp3,m4a,ogg,wav,opus,OPUS,OGG,WAV,MP3,M4A}" $folder) }} {{ $audio = index $secAudios 0 }} {{ end }} {{ with $audio }}
{{ end }}