Browse Source

clean target added in Makefile + more natual pagination

products
_ahmedbilal 3 years ago
parent
commit
604f8d17c0
  1. 3
      Makefile
  2. 10
      templates/macros/pagination.html

3
Makefile

@ -15,3 +15,6 @@ permissions: build
build:
lektor build -O $(BUILDDIR)
clean:
rm -rf $(BUILDDIR)

10
templates/macros/pagination.html

@ -5,10 +5,16 @@
{% else %}
<span class="disabled">&laquo; Previous</span>
{% 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 %}
<a href="{{ pagination.for_page(page)|url }}">{{ page }}</a> |
{% else %}
{{ pagination.page }} |
{% endif %}
{% endfor %}
{% if pagination.has_next %}
<a href="{{ pagination.next|url }}">Next &raquo;</a>
{% else %}

Loading…
Cancel
Save