Skip to content

Commit 06ba2bc

Browse files
committed
Fix #132 Refactor blog pagination
1 parent 938d1c6 commit 06ba2bc

File tree

2 files changed

+10
-27
lines changed

2 files changed

+10
-27
lines changed

_includes/blog_nav.html

+9-26
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,40 @@
11
{% if paginator.total_pages > 1 %}
22
<div class="pagination">
33
<div class="previous">
4-
{% if paginator.previous_page %}
4+
5+
{% if paginator.previous_page and paginator.previous_page != 1%}
56
<!-- << -->
6-
{% if paginator.previous_page != 1 %}
77
<a alt="{{ site.theme_settings.str_previous_page }}" href="{{ '/' | relative_url }}" style="margin-right:0.1em" class="button">
88
<i class="fa fa-angle-double-left"></i>
99
</a>
1010
{% endif %}
11+
1112
<!-- < previous -->
12-
<a href="{{ paginator.previous_page_path | relative_url }}" class="button">
13+
<a href="{{ paginator.previous_page_path | relative_url }}" {% unless paginator.previous_page %}style="visibility:hidden"{% endunless %} class="button">
1314
<i class="fa fa-chevron-left"></i>
1415
{{ site.theme_settings.str_previous_page }}
1516
</a>
16-
{% endif %}
17-
18-
{% unless paginator.previous_page %}
19-
20-
<a href="{{ paginator.previous_page_path | relative_url }}" style="visibility:hidden" class="button">
21-
<i class="fa fa-chevron-left"></i>
22-
{{ site.theme_settings.str_previous_page }}
23-
</a>
24-
{% endunless %}
2517
</div>
2618

2719
<div class="page_number">
28-
2920
{{ paginator.page }} / {{ paginator.total_pages }}
30-
3121
</div>
3222

3323
<div class="next">
34-
{% if paginator.next_page %}
24+
3525
<!-- next > -->
36-
<a alt="{{ site.theme_settings.str_next_page }}" href="{{ paginator.next_page_path | relative_url }}" class="button">
26+
<a alt="{{ site.theme_settings.str_next_page }}" href="{{ paginator.next_page_path | relative_url }}" {% unless paginator.next_page %}style="visibility:hidden"{% endunless %} class="button">
3727
{{ site.theme_settings.str_next_page }}
3828
<i class="fa fa-chevron-right"></i>
3929
</a>
30+
31+
{% if paginator.next_page and paginator.next_page != paginator.total_pages %}
4032
<!-- >> -->
41-
{% if paginator.next_page != paginator.total_pages %}
4233
<a href="{{ site.paginate_path | relative_url | replace: ':num', paginator.total_pages }}" style="margin-left:0.1em" class="button">
4334
<i class="fa fa-angle-double-right"></i>
4435
</a>
4536
{% endif %}
46-
{% endif %}
47-
48-
{% unless paginator.next_page %}
49-
50-
<a alt="{{ site.theme_settings.str_next_page }}" href="{{ paginator.next_page_path | relative_url }}" style="visibility:hidden" class="button">
51-
{{ site.theme_settings.str_next_page }}
52-
<i class="fa fa-chevron-right"></i>
53-
</a>
54-
{% endunless %}
37+
5538
</div>
5639
</div>
5740
{% endif %}

type-on-strap.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gem::Specification.new do |spec|
44
spec.name = "type-on-strap"
5-
spec.version = "1.0.2"
5+
spec.version = "1.1.0"
66
spec.authors = ["Sylhare","Rohan Chandra"]
77
88

0 commit comments

Comments
 (0)