{{ define "main" }}
{{ if isset .Site.Params "avatarurl" }} {{ .Site.Params.AvatarAltText|default {{ end }}

{{ .Site.Title }}

{{ if isset .Site.Params "description" }}

{{ .Site.Params.Description }}

{{ end }}
{{ if isset .Site.Params "socialicons" }}
{{ end }} {{ if os.FileExists "index-about.md" }}
{{ readFile "index-about.md" | markdownify }}
{{ end }} {{ if isset .Site.Params "showpostsonhomepage" }}

{{ i18n (.Site.Params.ShowPostsOnHomePage | humanize) }} Posts

{{ $posts := where .Site.Pages "Params.type" "post" }} {{ if eq .Site.Params.ShowPostsOnHomePage "popular" }} {{ range $posts.ByWeight | first 4 }} {{- partial "list-posts.html" . -}} {{ end }} {{ else if eq .Site.Params.ShowPostsOnHomePage "recent" }} {{ range $posts.ByDate.Reverse | first 4 }} {{- partial "list-posts.html" . -}} {{ end }} {{ end }}
{{ end }} {{ end }}