Skip to content

Commit

Permalink
Add some pagination.
Browse files Browse the repository at this point in the history
  • Loading branch information
johno committed Jun 13, 2014
1 parent fcae6a9 commit e0001e7
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
1 change: 1 addition & 0 deletions _config.yml
Expand Up @@ -9,3 +9,4 @@ url: "http://pixyll.com"
# Build settings
markdown: kramdown
permalink: pretty
paginate: 3
21 changes: 21 additions & 0 deletions _includes/pagination.html
@@ -0,0 +1,21 @@
<div class="pagination clearfix mb1 mt4">
<div class="left p1">
{% if paginator.next_page %}
<a class="pagination-item older button button-big button-gray" href="{{ site.baseurl }}page{{paginator.next_page}}">Older</a>
{% else %}
<span class="pagination-item older button button-big button-gray button-disabled">Older</span>
{% endif %}
</div>
<div class="right p1">
{% if paginator.previous_page %}
{% if paginator.page == 2 %}
<a class="pagination-item newer button button-big button-gray" href="{{ site.baseurl }}/">Newer</a>
{% else %}
<a class="pagination-item newer button button-big button-gray" href="{{ site.baseurl }}page{{paginator.previous_page}}">Newer</a>
{% endif %}
{% else %}
<span class="pagination-item newer button button-big button-gray button-disabled">Newer</span>
{% endif %}
</div>
<div class=""></div>
</div>
9 changes: 9 additions & 0 deletions _posts/2014-06-08-pixyll-has-pagination.md
@@ -0,0 +1,9 @@
---
layout: post
title: Pixyll has Pagination
date: 2014-06-08 11:21:29
summary: This is an empty post to illustrate the pagination component with Pixyll.
categories: jekyll pixyll
---

This is an empty post to illustrate the pagination component with Pixyll.
9 changes: 9 additions & 0 deletions _posts/2014-06-09-so-what-is-jekyll.md
@@ -0,0 +1,9 @@
---
layout: post
title: So, What is Jekyll?
date: 2014-06-09 12:32:18
summary: Transform your plain text into static websites and blogs. Simple, static, and blog-aware.
categories: jekyll pixyll
---


22 changes: 22 additions & 0 deletions css/pixyll.css
Expand Up @@ -15,6 +15,10 @@

body {
font-size: 1.5rem;

box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}

.site-header a {
Expand Down Expand Up @@ -65,6 +69,24 @@ body {
color: #7a7a7a;
}

.pagination .button {
font-size: 1rem;
font-weight: 200;
letter-spacing: 1px;
}

.button-disabled {
opacity: 0.55;
background-color: #999;
}

.button-disabled:hover,
.button-disabled:active,
.button-disabled:focus {
cursor: not-allowed;
background-color: #999;
}

p {
font-weight: 200;
font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
Expand Down
4 changes: 3 additions & 1 deletion index.html
Expand Up @@ -5,7 +5,7 @@
<div class="home">

<div class="posts">
{% for post in site.posts %}
{% for post in paginator.posts %}
<div class="post">
<a href="{{ post.url | prepend: site.baseurl }}" class="post-link">
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span> <br><br>
Expand All @@ -16,5 +16,7 @@ <h3 class="h2 post-title">{{ post.title }}</h3>
{% endfor %}
</div>

{% include pagination.html %}

<!--<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>-->
</div>

0 comments on commit e0001e7

Please sign in to comment.