diff options
Diffstat (limited to 'site/layouts/partials')
| -rw-r--r-- | site/layouts/partials/blog.html | 2 | ||||
| -rw-r--r-- | site/layouts/partials/pagination.html | 18 |
2 files changed, 19 insertions, 1 deletions
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 @@ <h2 class="f2 b lh-title mb3">Latest stories</h1> <div class="w-100 flex-ns mhn1-ns flex-wrap mb3"> - {{ range where .Data.Pages "Type" "post" }} + {{ range first 4 (where .Data.Pages "Type" "post") }} <div class="ph1-ns w-50-ns flex"> {{ .Render "li" }} </div> 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 }} + +<nav class="cf pa3"> + {{ if .Paginator.HasNext }} + <a class="fl dib link dim black f6 f5-ns b pa2" title="Next Page" href="{{ .Paginator.Next.URL }}"> + ← Previous + </a> + {{ end }} + <div class="pagination"> + {{ if .Paginator.HasPrev }} + <a class="fl dib link dim black f6 f5-ns b pa2" title="Previous Page" href="{{ .Paginator.Prev.URL }}"> + Next → + </a> + {{ end }} + </div> +</nav> + +{{ end }}
\ No newline at end of file |
