{{ 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 (or (and (fileExists "content/_index.md") .Content) (fileExists "content/index-about.md")) }}
{{ or .Content (readFile "index-about.md" | markdownify) }}
{{ end }} {{ if isset .Site.Params "showpostsonhomepage" }}

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

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