aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-04-15 18:14:17 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-04-15 18:14:17 +0300
commit18efd27277e085ad14a064e474d7e1974e1804aa (patch)
treea91a4a7868f388e4ee59d051b5be23bcee082fdd
parentpaginator: refactoring (diff)
downloadjekyll-theme-18efd27277e085ad14a064e474d7e1974e1804aa.tar.gz
jekyll-theme-18efd27277e085ad14a064e474d7e1974e1804aa.zip
paginator: refactoring
-rw-r--r--_includes/jekyll-theme/posts/paginator.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/_includes/jekyll-theme/posts/paginator.html b/_includes/jekyll-theme/posts/paginator.html
index 341687c..268d8fd 100644
--- a/_includes/jekyll-theme/posts/paginator.html
+++ b/_includes/jekyll-theme/posts/paginator.html
@@ -3,6 +3,8 @@
https://jekyllrb.com/docs/pagination/.
{% endcomment %}
{% if site.posts.size != 0 %}
+ {% capture prev %}<span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Prev{% endcapture %}
+ {% capture next %}Next&nbsp;<span class="glyphicon glyphicon-chevron-right"></span>{% endcapture %}
{% 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.
@@ -15,11 +17,11 @@
<ul class="pagination">
{% if paginator.previous_page %}
<li>
- <a href="{{ paginator.previous_page_path | relative_url }}"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Prev</a>
+ <a href="{{ paginator.previous_page_path | relative_url }}">{{ prev }}</a>
</li>
{% else %}
<li class="disabled">
- <a href="#"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Prev</a>
+ <a href="#">{{ prev }}</a>
</li>
{% endif %}
{% for page_number in (1..paginator.total_pages) %}
@@ -37,11 +39,11 @@
{% endfor %}
{% if paginator.next_page %}
<li>
- <a href="{{ paginator.next_page_path | relative_url }}">Next&nbsp;<span class="glyphicon glyphicon-chevron-right"></span></a>
+ <a href="{{ paginator.next_page_path | relative_url }}">{{ next }}</a>
</li>
{% else %}
<li class="disabled">
- <a href="#">Next&nbsp;<span class="glyphicon glyphicon-chevron-right"></span></a>
+ <a href="#">{{ next }}</a>
</li>
{% endif %}
</ul>