1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-22 01:46:51 +01:00

pagination

This commit is contained in:
Matthias Kretschmann 2013-11-20 23:33:58 +01:00
parent 013283f09b
commit 1989ef1041
5 changed files with 54 additions and 24 deletions

5
README.md Normal file
View File

@ -0,0 +1,5 @@
Requirements
------------------
Grunt, Jekyll

View File

@ -1,7 +1,13 @@
name: kremalicious name: kremalicious
description: Blog of designer & developer Matthias Kretschmann description: Blog of designer & developer Matthias Kretschmann
url: http://kremalicious.com
author: Matthias Kretschmann
permalink: /:title permalink: /:title
relative_permalinks: true relative_permalinks: true
paginate: 10
paginate_path: "/page/:num"
markdown: redcarpet markdown: redcarpet
pygments: true pygments: true

View File

@ -65,7 +65,7 @@
.col6 { margin-left: 0; } .col6 { margin-left: 0; }
.col1 { width: 13%; } .col1 { width: 13%; }
.col2 { width: 30%; } .col2 { width: 28%; }
.col3 { width: 48%; } .col3 { width: 48%; }
.col4 { width: 65%; } .col4 { width: 65%; }
.col5 { width: 82%; } .col5 { width: 82%; }

View File

@ -41,35 +41,29 @@ a.nav-main-link {
font-weight: @headings-font-weight; font-weight: @headings-font-weight;
line-height: @headings-line-height; line-height: @headings-line-height;
.h6; .h6;
p {
width: 48%; p { position: relative; }
margin: 0;
position: relative;
font-size: .95em;
}
.alignright { text-align: right; }
a { display: block; } a { display: block; }
.alignleft i { margin-right: .5em; } i {
.alignright i { margin-left: .5em; }
.single & .alignleft a { margin-left: 1.5em; }
.single & .alignright a { margin-right: 1.5em; }
.single & i {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
} }
.alignright { text-align: right; }
.single & .alignright i { .alignleft i { margin-right: .5em; }
.alignright i {
margin-left: .5em;
left: auto; left: auto;
right: 0; right: 0;
} }
.alignleft a { margin-left: 1.5em; }
.alignright a { margin-right: 1.5em; }
} }

View File

@ -3,7 +3,7 @@ layout: base
title: Home title: Home
--- ---
{% for post in site.posts %} {% for post in paginator.posts %}
{% if post.layout == "link" %} {% if post.layout == "link" %}
@ -62,4 +62,29 @@ title: Home
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<nav class="row pager pagination">
{% if paginator.previous_page %}
<p class="previous col2 alignleft">
<i class="icon-arrow-left"></i>
{% if paginator.previous_page == 1 %}
<a href="/" rel="prev">Previous</a>
{% else %}
<a href="/page/{{ paginator.previous_page }}/" rel="prev">Previous</a>
{% endif %}
</p>
{% endif %}
<p class="col2 textcenter">
<span class="page_number ">Page {{ paginator.page }} of {{ paginator.total_pages }}</span>
</p>
{% if paginator.next_page %}
<p class="next col2 alignright">
<a href="/page/{{ paginator.next_page }}/" rel="next">Next</a>
<i class="icon-arrow-right"></i>
</p>
{% endif %}
</nav>