{{ define "main" }} {{ if .Title }}

{{ .Title }}

{{ end }} {{ $pages := union .RegularPages .Sections }} {{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} {{ end }} {{ $paginator := .Paginate $pages }} {{ range $index, $page := $paginator.Pages }} {{ if and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) }} {{ $avatar_url := $.Scratch.Get `avatar_url` }} {{ if or $avatar_url site.Params.name }}
{{ if $avatar_url }}
avatar
{{ end }} {{ if site.Params.name }}

{{ site.Params.name }}

{{ site.Params.bio | default (print "Personal blog by " site.Params.name) }}
{{ end }}
{{ end }} {{ end }}

{{ .Title }}

{{ end }} {{ if gt $paginator.TotalPages 1 }} {{ end }} {{ end }}