Skip to content

Commit

Permalink
Add post paginate navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ngzhio committed Jul 16, 2020
1 parent 1e07ff0 commit 061f114
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}
</ul>
</div>
{% endif %}

<nav class="post-pagination" role="navigation">
{% if page.previous %}
<a class="post-previous" href="{{ page.previous.url | relative_url }}">
<i class="fas fa-arrow-left"></i> {{ page.previous.title | markdownify | strip_html }}
</a>
{% endif %}

{% if page.next %}
<a class="post-next" href="{{ page.next.url | relative_url }}">
{{ page.next.title | markdownify | strip_html }} <i class="fas fa-arrow-right"></i>
</a>
{% endif %}
</nav>
</footer>

{% if page.comments != false and jekyll.environment == "production" %}
Expand Down
14 changes: 14 additions & 0 deletions _sass/hamilton/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,20 @@ ul.post-categories {
}
}

.post-pagination {
@include relative-font-size(0.8);
display: flex;
justify-content: space-between;
padding-top: $spacing-unit / 2;
padding-bottom: $spacing-unit / 2;
border-top: 1px solid;

.post-previous
.post-next {
display: block;
}
}


// About font sizes for h1-h6, refer to https://stackoverflow.com/a/6140504/13261366
.post-title,
Expand Down

0 comments on commit 061f114

Please sign in to comment.