diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2015-08-24 16:02:46 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2015-08-24 16:02:46 +0200 |
commit | f42e64968ffd0e4adfe67d484dc2768186269fb1 (patch) | |
tree | 4403f46b8af25d4d4a50ec1d9ebaf5496958f6b3 /blog/index.html | |
parent | 3c864f320b90c8bdd2419a93db51faf67db05473 (diff) | |
download | norsk-urskog-main-f42e64968ffd0e4adfe67d484dc2768186269fb1.tar.gz norsk-urskog-main-f42e64968ffd0e4adfe67d484dc2768186269fb1.tar.bz2 norsk-urskog-main-f42e64968ffd0e4adfe67d484dc2768186269fb1.zip |
Add pagination for index page.
Diffstat (limited to 'blog/index.html')
-rw-r--r-- | blog/index.html | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/blog/index.html b/blog/index.html index 512e009..aaf8fbd 100644 --- a/blog/index.html +++ b/blog/index.html @@ -8,7 +8,7 @@ hidden: true <section id="news" class="wide"> <h2>{% t home.latest_news %}</h2> - {% for p in site.posts limit: 5 %} + {% for p in paginator.posts %} <article> <header> <date>{{ p.date | date_to_string }}</date> @@ -21,7 +21,6 @@ hidden: true </section> </article> {% endfor %} - <a href="{{ '/archive.html' | prepend: site.baseurl }}">{% t home.older_news %}</a> </section> {% if site.links %} @@ -29,3 +28,18 @@ hidden: true <h2>{% t home.links %}</h2> </section> {% endif %} + +<!-- Pagination links --> +<div class="pagination"> + {% if paginator.previous_page %} + <a href="{{ paginator.previous_page_path | prepend: site.baseurl }}" class="previous">{% t home.prev_page %}</a> + {% else %} + <span class="previous">{% t home.prev_page %}</span> + {% endif %} + <span class="page_number ">{% t home.page_no %} {{ paginator.page }} / {{ paginator.total_pages }}</span> + {% if paginator.next_page %} + <a href="{{ paginator.next_page_path | prepend: site.baseurl }}" class="next">{% t home.next_page %}</a> + {% else %} + <span class="next ">{% t home.next_page %}</span> + {% endif %} +</div> |