From b0b39768de6564e21f28c96fca34e01fa4602116 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 8 Apr 2021 21:48:53 +0300 Subject: _includes: move paginator.html to posts --- _includes/posts/paginator.html | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 _includes/posts/paginator.html (limited to '_includes/posts/paginator.html') diff --git a/_includes/posts/paginator.html b/_includes/posts/paginator.html new file mode 100644 index 0000000..471383c --- /dev/null +++ b/_includes/posts/paginator.html @@ -0,0 +1,36 @@ +{% comment %} + Page links, inspired by the example at the bottom of + https://jekyllrb.com/docs/pagination/. +{% endcomment %} +{% if site.posts.size != 0 %} + {% comment %} + Link to page 1 is tricky. If site.paginate_path is used, then we cannot + simply use /. This is a silly attempt to get the proper page 1 link. + {% endcomment %} + {% if paginator.page == 1 %} + {% assign page1_url = page.url %} + {% else %} + {% assign page1_url = page.url | split: '/' | pop | join: '/' | append: '/' %} + {% endif %} + +{% endif %} -- cgit v1.2.3