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

Recent Posts

{{ $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 }} {{/* TILs Section */}} {{ $tils := where .Site.Pages "Params.type" "tils" }} {{ $tilsToShow := $tils.ByDate.Reverse | first (or .Site.Params.NumberTilsOnHomePage 3) }} {{ if gt (len $tilsToShow) 0 }}

Recent TILs

{{ range $tilsToShow }} {{- partial "list-posts.html" . -}} {{ end }}
{{ end }} {{ end }}