From 8701676bb6dd1e773e8df85611983044438443a6 Mon Sep 17 00:00:00 2001 From: Robert McGovern Date: Wed, 25 Jan 2023 22:40:03 +0000 Subject: [PATCH] cribbed pagination from quinnanya.github.io with some amendments for working with Minimal Mistakes, and to disable first and last where appropriate --- src/_includes/layouts/pagination.njk | 21 +++++++++++++ src/index.html | 47 ++++++++++++++++++++++++++-- 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 src/_includes/layouts/pagination.njk diff --git a/src/_includes/layouts/pagination.njk b/src/_includes/layouts/pagination.njk new file mode 100644 index 0000000..f384114 --- /dev/null +++ b/src/_includes/layouts/pagination.njk @@ -0,0 +1,21 @@ +{% if paginationNextUrl or paginationPrevUrl %} +
+
+ +
+{% endif %} diff --git a/src/index.html b/src/index.html index 0fd9067..2be47ae 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,48 @@ --- -layout: home -author_profile: true +layout: archive +permalink: "{% if pagination.pageNumber>0 %}page-{{ pagination.pageNumber | plus: 1 }}{% endif %}/index.html" +pagination: + data: collections.posts + size: 7 --- +{%- for post in pagination.items -%} +

{{ post.data.title }}

+{{ post.data.date | toUTCString}} +

{{ post.templateContent | description }} read more

+{%- endfor -%} + + +