From 400357930a08a962bfaf6b34587525e0e3c2404d Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Thu, 19 Apr 2018 18:08:48 +0300 Subject: [PATCH] Add taxonomy template The default list template was used for paginating posts on the homepage as well as the taxonomies and terms pages, but actually those two cases are different. This introduces a taxonomy template that paginates based on the current context (ie, when displaying posts for a certain tag). --- layouts/_default/taxonomy.html | 18 ++++++++++++++++++ layouts/partials/pagination.html | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 layouts/_default/taxonomy.html create mode 100644 layouts/partials/pagination.html diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000..ac46043 --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,18 @@ +{{ define "main" }} + +{{ $truncate := default true .Site.Params.truncate }} +{{ range .Paginator.Pages }} +{{ if $truncate }} +{{ .Render "summary" }} +{{ else }} +{{ .Render "content" }} +{{ end }} +{{ end }} + +{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} +{{ partial "pagination.html" . }} +{{ end }} + +{{ end }} + +{{- /* vim: set ts=2 sw=2 et: */}} diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..4fe59af --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,16 @@ + + +{{- /* vim: set ts=2 sw=2 et: */}}