{{- $pages := site.RegularPages }} {{- with site.Params.hb.blog.home.main_sections }} {{- $pages = where $pages "Section" "in" . }} {{- end }} {{- $pinnedPos := default "" site.Params.hb.blog.home.pinned_posts_position }} {{- $featuredCount := default 10 site.Params.hb.blog.home.featured_posts }} {{- $featuredPages := first $featuredCount (where $pages ".Params.featured" true) }} {{- if $featuredPages }}
{{- $pinnedPages := first 1 (where $pages ".Params.pinned" true) }} {{- $hasPinned := and (ne $pinnedPos "list") (gt (len $pinnedPages) 0) }} {{- if $hasPinned }}
{{ partial "hb/modules/blog/posts" (dict "Pages" $pinnedPages "Cols" "row-cols-1" "ReadMore" false) }}
{{- end }}
{{- end }}
{{- if default true site.Params.hb.blog.home.taxonomies }} {{ partialCached "hb/modules/blog/home/taxonomies" . }} {{- end }} {{- with .Paginator }} {{- $cols := "row-cols-1 row-cols-md-2" }} {{- if not (partialCached "hb/modules/blog/functions/has-sidebar" .) }} {{- $cols = printf "%s row-cols-lg-3" $cols }} {{- end }} {{ partial "hb/modules/blog/posts" (dict "Pages" .Pages "Cols" $cols) }} {{ partial "hb/modules/pagination/index" . }} {{- end }}
{{ partial "hb/modules/blog/sidebar" . }}