2020-08-24 01:48:03 -05:00
|
|
|
{{ define "main" }}
|
|
|
|
|
|
|
|
{{/* get all the pages that are regular posts and not pages */}}
|
2021-01-03 07:06:59 -06:00
|
|
|
{{ $postsDir := .Site.Params.Posts | default (slice "posts" "post") }}
|
2021-04-13 16:30:34 -05:00
|
|
|
{{ $allPostsList := where .Site.RegularPages "Section" "in" $postsDir }}
|
|
|
|
{{ $featuredPostsList := slice }}
|
|
|
|
{{ $postsList := $allPostsList }}
|
2021-04-14 06:35:02 -05:00
|
|
|
{{ $pagination := slice }}
|
2021-04-13 16:30:34 -05:00
|
|
|
{{ if .Site.Params.enableFeatured | default false }}
|
|
|
|
{{ $featuredPostsList = where $allPostsList "Params.featured" true }}
|
|
|
|
{{ $postsList = union (where $allPostsList "Params.featured" false) (where $allPostsList "Params.featured" nil) }}
|
2021-04-14 06:35:02 -05:00
|
|
|
{{ $pagination = (.Paginate $postsList).Pages }}
|
2021-04-14 06:00:42 -05:00
|
|
|
{{ if eq .Paginator.PageNumber 1 }}
|
|
|
|
{{- partial "featured_articles.html" $featuredPostsList -}}
|
|
|
|
{{ end }}
|
2021-04-14 06:35:02 -05:00
|
|
|
{{ else }}
|
|
|
|
{{ $pagination = (.Paginate $postsList).Pages }}
|
2021-04-13 16:30:34 -05:00
|
|
|
{{ end }}
|
|
|
|
|
2020-08-24 01:48:03 -05:00
|
|
|
{{/* pagination */}}
|
2021-04-13 03:19:17 -05:00
|
|
|
<div class="postlist {{ if .Site.Params.gridView }}gridView{{ end }}" id="postlist">
|
2021-04-14 06:00:42 -05:00
|
|
|
{{ range $pagination }}
|
2021-04-15 03:04:06 -05:00
|
|
|
{{- partial "article_card.html" . -}}
|
2020-08-24 01:48:03 -05:00
|
|
|
{{ end }}
|
2021-04-12 16:07:16 -05:00
|
|
|
</div>
|
2021-04-13 03:19:17 -05:00
|
|
|
<div id="getNextBtnContainer"></div>
|
2021-01-04 06:20:55 -06:00
|
|
|
{{- partial "paginator.html" . -}}
|
2020-08-24 01:48:03 -05:00
|
|
|
|
|
|
|
{{ end }}
|