featured articles only shown in first page of home page
This commit is contained in:
parent
efaaecc82f
commit
bfa66798b3
|
@ -5,15 +5,18 @@
|
||||||
{{ $allPostsList := where .Site.RegularPages "Section" "in" $postsDir }}
|
{{ $allPostsList := where .Site.RegularPages "Section" "in" $postsDir }}
|
||||||
{{ $featuredPostsList := slice }}
|
{{ $featuredPostsList := slice }}
|
||||||
{{ $postsList := $allPostsList }}
|
{{ $postsList := $allPostsList }}
|
||||||
|
{{ $pagination := (.Paginate $postsList).Pages }}
|
||||||
{{ if .Site.Params.enableFeatured | default false }}
|
{{ if .Site.Params.enableFeatured | default false }}
|
||||||
{{ $featuredPostsList = where $allPostsList "Params.featured" true }}
|
{{ $featuredPostsList = where $allPostsList "Params.featured" true }}
|
||||||
{{ $postsList = union (where $allPostsList "Params.featured" false) (where $allPostsList "Params.featured" nil) }}
|
{{ $postsList = union (where $allPostsList "Params.featured" false) (where $allPostsList "Params.featured" nil) }}
|
||||||
|
{{ if eq .Paginator.PageNumber 1 }}
|
||||||
{{- partial "featured_articles.html" $featuredPostsList -}}
|
{{- partial "featured_articles.html" $featuredPostsList -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{/* pagination */}}
|
{{/* pagination */}}
|
||||||
<div class="postlist {{ if .Site.Params.gridView }}gridView{{ end }}" id="postlist">
|
<div class="postlist {{ if .Site.Params.gridView }}gridView{{ end }}" id="postlist">
|
||||||
{{ range (.Paginate $postsList).Pages }}
|
{{ range $pagination }}
|
||||||
<article class="card postlistitem {{ if .Site.Params.discreteCards }}discrete{{ end }}">
|
<article class="card postlistitem {{ if .Site.Params.discreteCards }}discrete{{ end }}">
|
||||||
<div>
|
<div>
|
||||||
<h2>
|
<h2>
|
||||||
|
|
Loading…
Reference in New Issue