Skip to content

Commit

Permalink
added pagination (reflectoring#73)
Browse files Browse the repository at this point in the history
* added pagination

* fixed link label
  • Loading branch information
thombergs authored May 29, 2017
1 parent bb92dba commit aa00252
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 16 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ gem "jekyll-gist", "1.4.0"
gem "jekyll-feed", "0.8.0"
gem "github-pages", "105"
gem "html-proofer", "3.3.1"
gem "jekyll-paginate", "1.1.0"

1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ DEPENDENCIES
jekyll (= 3.3.1)
jekyll-feed (= 0.8.0)
jekyll-gist (= 1.4.0)
jekyll-paginate (= 1.1.0)
jekyll-sitemap (= 0.12.0)

BUNDLED WITH
Expand Down
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ feed:

# Jekyll configuration

paginate: 12
paginate_path: "/:num"

sass:
sass_dir: _sass
style: compressed
Expand All @@ -22,6 +25,7 @@ gems:
- jekyll-sitemap
- jekyll-gist
- jekyll-feed
- jekyll-paginate

collections:
- projects
Expand Down
11 changes: 11 additions & 0 deletions _sass/_pagination.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* ==========================================================================
Tiles
========================================================================== */

.pagination {
clear: both;
}

.page-number {
margin-right: 20px;
}
1 change: 1 addition & 0 deletions css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ sitemap: false
========================================================================== */

@import "layout";
@import "pagination";
30 changes: 30 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
layout: archive
title: "Latest Posts"
date: 2016-11-26
modified:
tags: [reflectoring, posts, blog, software, engineering, programming, java]
image:
feature:
teaser: archive.jpg
---

<div class="tiles">
{% for post in paginator.posts %}
{% include post-grid.html %}
{% endfor %}
</div>

<div class="pagination">
<span class="page-number">Page {{ paginator.page }} of {{ paginator.total_pages }}</span>
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}" class="btn previous">Previous Page</a>
{% else %}
<span class="btn previous">Previous Page</span>
{% endif %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}" class="btn next">Next Page</a>
{% else %}
<span class="btn next">Next Page</span>
{% endif %}
</div>
16 changes: 0 additions & 16 deletions index.md

This file was deleted.

0 comments on commit aa00252

Please sign in to comment.