Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a6c5b48

Browse files
committedJan 10, 2017
fix blog post pagination
rename rc.1 blog post link
1 parent 4d1b0ca commit a6c5b48

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed
 

‎_includes/paginator.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{% include base_path %}
2+
{% capture posts_path %}{{ base_path }}/{{ include.posts_path }}{% endcapture %}
23

34
{% if paginator.total_pages > 1 %}
45
<nav class="pagination">
56
<ul>
67
{% comment %} Link for previous page {% endcomment %}
78
{% if paginator.previous_page %}
89
{% if paginator.previous_page == 1 %}
9-
<li><a href="{{ base_path }}/">{{ site.data.ui-text[site.locale].pagination_previous }}</a></li>
10+
<li><a href="{{ posts_path }}/">{{ site.data.ui-text[site.locale].pagination_previous }}</a></li>
1011
{% else %}
11-
<li><a href="{{ base_path }}/page{{ paginator.previous_page }}/">{{ site.data.ui-text[site.locale].pagination_previous }}</a></li>
12+
<li><a href="{{ posts_path }}/page{{ paginator.previous_page }}/">{{ site.data.ui-text[site.locale].pagination_previous }}</a></li>
1213
{% endif %}
1314
{% else %}
1415
<li><a href="#" class="disabled"><span aria-hidden="true">{{ site.data.ui-text[site.locale].pagination_previous }}</span></a></li>
@@ -18,7 +19,7 @@
1819
{% if paginator.page == 1 %}
1920
<li><a href="#" class="disabled current">1</a></li>
2021
{% else %}
21-
<li><a href="{{ base_path }}/">1</a></li>
22+
<li><a href="{{ posts_path }}/">1</a></li>
2223
{% endif %}
2324

2425
{% assign page_start = 2 %}
@@ -36,15 +37,15 @@
3637

3738
{% for index in (page_start..page_end) %}
3839
{% if index == paginator.page %}
39-
<li><a href="{{ base_path }}/page{{ index }}/" class="disabled current">{{ index }}</a></li>
40+
<li><a href="{{ posts_path }}/page{{ index }}/" class="disabled current">{{ index }}</a></li>
4041
{% else %}
4142
{% comment %} Distance from current page and this link {% endcomment %}
4243
{% assign dist = paginator.page | minus: index %}
4344
{% if dist < 0 %}
4445
{% comment %} Distance must be a positive value {% endcomment %}
4546
{% assign dist = 0 | minus: dist %}
4647
{% endif %}
47-
<li><a href="{{ base_path }}/page{{ index }}/">{{ index }}</a></li>
48+
<li><a href="{{ posts_path }}/page{{ index }}/">{{ index }}</a></li>
4849
{% endif %}
4950
{% endfor %}
5051

@@ -56,12 +57,12 @@
5657
{% if paginator.page == paginator.total_pages %}
5758
<li><a href="#" class="disabled current">{{ paginator.page }}</a></li>
5859
{% else %}
59-
<li><a href="{{ base_path }}/page{{ paginator.total_pages }}/">{{ paginator.total_pages }}</a></li>
60+
<li><a href="{{ posts_path }}/page{{ paginator.total_pages }}/">{{ paginator.total_pages }}</a></li>
6061
{% endif %}
6162

6263
{% comment %} Link next page {% endcomment %}
6364
{% if paginator.next_page %}
64-
<li><a href="{{ base_path }}/page{{ paginator.next_page }}/">{{ site.data.ui-text[site.locale].pagination_next }}</a></li>
65+
<li><a href="{{ posts_path }}/page{{ paginator.next_page }}/">{{ site.data.ui-text[site.locale].pagination_next }}</a></li>
6566
{% else %}
6667
<li><a href="#" class="disabled"><span aria-hidden="true">{{ site.data.ui-text[site.locale].pagination_next }}</span></a></li>
6768
{% endif %}

‎_posts/2017-01-09-uirouter-1.0.0-rc.1.md renamed to ‎_posts/2017-01-09-angular-ui-router-1.0.0-rc.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ layout: post
33
excerpt: UI-Router 1.0.0-rc.1 is released
44
comments: true
55
permalink: /blog/:title/
6+
redirect_from: /blog/uirouter-1.0.0-rc.1/
67
---
78

89
{% include toc icon="columns" title="UI-Router 1.0.0-rc.1" %}

‎blog/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
layout: archive
3-
permalink: /blog/
43
title: "UI-Router blog"
54
author_profile: false
65
---
@@ -19,5 +18,5 @@ <h3 class="archive__subtitle">
1918
{% include archive-single.html %}
2019
{% endfor %}
2120

22-
{% include paginator.html %}
21+
{% include paginator.html posts_path="blog" %}
2322

0 commit comments

Comments
 (0)
Please sign in to comment.