From 604f8d17c0c01ec729b9f78415d290e830840220 Mon Sep 17 00:00:00 2001 From: meow Date: Mon, 18 Nov 2019 19:36:27 +0500 Subject: [PATCH] clean target added in Makefile + more natual pagination --- Makefile | 3 +++ templates/macros/pagination.html | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a40ffb8..5b3a484 100644 --- a/Makefile +++ b/Makefile @@ -15,3 +15,6 @@ permissions: build build: lektor build -O $(BUILDDIR) + +clean: + rm -rf $(BUILDDIR) \ No newline at end of file diff --git a/templates/macros/pagination.html b/templates/macros/pagination.html index ba4379e..93e639b 100644 --- a/templates/macros/pagination.html +++ b/templates/macros/pagination.html @@ -5,10 +5,16 @@ {% else %} « Previous {% endif %} | - {{ pagination.page }} | - {% for page in range(pagination.page + 1, pagination.pages + 1)[:5] %} + + + {% for page in range(1, pagination.pages + 1) %} + {% if page != pagination.page %} {{ page }} | + {% else %} + {{ pagination.page }} | + {% endif %} {% endfor %} + {% if pagination.has_next %} Next » {% else %}