{{define "layout"}} {{block "title" .}}{{.Blog.Title}}{{end}} {{if .Data.theme.Favicon}} {{else}} {{end}} {{$l := .Data.layout}} {{if or $l.Header .Data.theme.HeaderImage}}{{if .Data.theme.HeaderOn}}{{end}}{{end}}
{{$n := .Data.notices}}
{{template "notices" (index $n "main-top")}} {{range $l.Above}}{{template "module" (dict "m" . "root" $)}}{{end}} {{template "content" .}} {{range $l.Below}}{{template "module" (dict "m" . "root" $)}}{{end}} {{template "notices" (index $n "main-bottom")}}
{{if $l.HasLeft}}
{{template "notices" (index $n "left-top")}} {{range $l.Left}}{{template "module" (dict "m" . "root" $)}}{{end}} {{template "notices" (index $n "left-bottom")}}
{{end}} {{if $l.HasRight}}
{{template "notices" (index $n "right-top")}} {{range $l.Right}}{{template "module" (dict "m" . "root" $)}}{{end}} {{template "notices" (index $n "right-bottom")}}
{{end}}
{{if $l.Footer}}{{end}} {{end}} {{define "notices"}}{{range .}} {{end}}{{end}} {{/* One layout module. .m is the store.Module, .root the page data; the same kind renders differently in the header (big blocks) and elsewhere (boxes). */}} {{define "module"}}{{$m := .m}}{{$r := .root}}{{$t := $r.Data.theme}} {{- if eq $m.Kind "title"}}

{{$r.Blog.Title}}

{{if $r.Blog.Tagline}}

{{$r.Blog.Tagline}}

{{end}}
{{- else if eq $m.Kind "logo"}}{{if $t.Logo}}{{if eq $m.Area "header"}} {{else}}{{end}}{{end}} {{- else if eq $m.Kind "menu"}}{{if eq $m.Area "header"}} {{else}}{{end}} {{- else if eq $m.Kind "recent"}}
{{template "modtitle" $m}}
{{- else if eq $m.Kind "archive"}}
{{template "modtitle" $m}} {{range $i, $y := $r.Data.archive}}{{$y.Year}} ({{$y.Count}}) {{range $y.Months}}
{{month .Month}} ({{len .Posts}})
{{end}} {{else}}

{{t "No posts yet."}}

{{end}}
{{- else if eq $m.Kind "tags"}}
{{template "modtitle" $m}}
{{- else if eq $m.Kind "tagcloud"}}
{{template "modtitle" $m}}

{{range $r.Data.tagcloud}}{{.Name}} {{else}}{{t "No tags yet."}}{{end}}

{{- else if eq $m.Kind "html"}}{{if not $m.Body}}{{else if or (eq $m.Area "above") (eq $m.Area "below")}}
{{html $m.Body}}
{{else}}
{{template "modtitle" $m}}{{html $m.Body}}
{{end}} {{- else if eq $m.Kind "rss"}}

{{t "RSS feed"}}

{{- else if eq $m.Kind "text"}}{{if $m.Body}}
{{range split $m.Body "\n"}}{{if .}}

{{.}}

{{end}}{{end}}
{{end}} {{- else if eq $m.Kind "sitemap"}}
{{template "modtitle" $m}}
{{- end}}{{end}} {{define "modtitle"}}{{if .Title}}

{{.Title}}

{{end}}{{end}} {{define "menulinks"}}{{range .Data.menu}}{{.Text}} {{end}}{{end}}