{{ range where .Data.Pages "Title" "Home" }}
{{ .Content }}
{{ end }}
{{ if isset .Site.Params "latestpostcount" }}
{{ $nbPosts := len (where .Data.Pages "Section" "blog") }}
{{ if gt $nbPosts 0 }}
Latest posts
{{ range (first .Site.Params.latestpostcount .Pages).GroupByDate "Jan, 2006" "desc" }}
- {{ .Key }}
{{ range .Pages.ByPublishDate.Reverse }}
{{ partial "li.html" . }}
{{ end }}
{{ end }}
{{ if gt $nbPosts .Site.Params.latestpostcount }}
See more ...
{{ end }}
{{ end }}
{{ end }}
{{ $nbPosts := len (where .Data.Pages "Params.best" true) }}
{{ if gt $nbPosts 0 }}
Best posts
{{ range .Data.Pages.ByPublishDate.Reverse }}
{{ if eq .Params.best true }}
{{ partial "li.html" . }}
{{ end }}
{{ end }}
{{ end }}