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

{{ .Site.Title }}

{{ .Site.Params.Description }}

{{ if isset .Site.Params "socialicons" }}
{{ end }} {{ if isset .Site.Params "showpostsonhomepage" }}

{{ .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 }}