From 188bbd972def17bb2a03ae3da0f3e3e07192c44e Mon Sep 17 00:00:00 2001 From: MadeByMike Date: Mon, 1 Jan 2018 23:16:20 +1100 Subject: Add pagination --- site/layouts/_default/list.html | 3 ++- site/layouts/partials/blog.html | 2 +- site/layouts/partials/pagination.html | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 site/layouts/partials/pagination.html (limited to 'site') diff --git a/site/layouts/_default/list.html b/site/layouts/_default/list.html index c23fa0c..81ce590 100644 --- a/site/layouts/_default/list.html +++ b/site/layouts/_default/list.html @@ -4,12 +4,13 @@
+ {{ partial "pagination" . }}
{{end}} \ No newline at end of file diff --git a/site/layouts/partials/blog.html b/site/layouts/partials/blog.html index aaa6f01..ce5c9bc 100644 --- a/site/layouts/partials/blog.html +++ b/site/layouts/partials/blog.html @@ -4,7 +4,7 @@

Latest stories

- {{ range where .Data.Pages "Type" "post" }} + {{ range first 4 (where .Data.Pages "Type" "post") }}
{{ .Render "li" }}
diff --git a/site/layouts/partials/pagination.html b/site/layouts/partials/pagination.html new file mode 100644 index 0000000..b71fc58 --- /dev/null +++ b/site/layouts/partials/pagination.html @@ -0,0 +1,18 @@ +{{ if gt .Paginator.TotalPages 1 }} + + + +{{ end }} \ No newline at end of file -- cgit v1.3