From 3805e9ef2d509d610d0153bccebdfa2d025aa25b Mon Sep 17 00:00:00 2001 From: Ankur Sinha Date: Tue, 1 Oct 2019 20:48:16 +0200 Subject: [PATCH] Added code for Issue 31 - Remove Post Dependency --- layouts/partials/post-list-term.html | 4 ++-- layouts/partials/post-list.html | 2 +- layouts/partials/readnext-random-sori.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/partials/post-list-term.html b/layouts/partials/post-list-term.html index f4c81e7..34de98f 100644 --- a/layouts/partials/post-list-term.html +++ b/layouts/partials/post-list-term.html @@ -1,5 +1,5 @@ -{{ $pages := ((where .Site.Pages "Type" "post") | shuffle) }} -{{ range first 3 $pages}} +{{ $pages := (.Site.RegularPages | shuffle) }} +{{ range first 6 $pages}}
{{if .Params.image}} diff --git a/layouts/partials/post-list.html b/layouts/partials/post-list.html index 50a80a0..da63603 100644 --- a/layouts/partials/post-list.html +++ b/layouts/partials/post-list.html @@ -1,4 +1,4 @@ -{{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") }} +{{ $paginator := .Paginate .Site.RegularPages }} {{ range $paginator.Pages }}
diff --git a/layouts/partials/readnext-random-sori.html b/layouts/partials/readnext-random-sori.html index c251581..bbe27de 100644 --- a/layouts/partials/readnext-random-sori.html +++ b/layouts/partials/readnext-random-sori.html @@ -1,4 +1,4 @@ -{{ $posts := (where .Site.RegularPages "Section" "==" "post") }}{{ $postCount := len $posts }}{{if ge $postCount 4}}{{ $currentPage := . }} +{{ $posts := .Site.RegularPages }}{{ $postCount := len $posts }}{{if ge $postCount 4}}{{ $currentPage := . }}