Skip to content

Commit 16a24d0

Browse files
committed
Add blog page with pagination
1 parent 15f7769 commit 16a24d0

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

_config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
title: Clojure/GSoC
22
description: Let’s get Clojure ready for GSoC 2017!
3+
feed:
4+
path: blog/atom.xml
35
author:
46
twitter: ClojureGSoC
57
picture: /assets/images/clojure-gsoc.png
68
excerpt_separator: <!--more-->
79
url: http://clojure-gsoc.org/
10+
paginate: 5
11+
paginate_path: "/blog/page:num"
812
gems:
913
- jekyll-feed
14+
- jekyll-paginate
1015
- jekyll-redirect-from
1116
- jekyll-sitemap

_data/sitemap.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
- path: index.md
22
name: Home
3+
- path: blog/index.html
4+
name: Blog
35
- path: students/index.md
46
children:
57
- path: students/application-template.md

assets/css/styles.scss

+13
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,17 @@
100100
}
101101
}
102102
}
103+
104+
.clj-gsoc-pagination {
105+
display: flex;
106+
box-sizing: border-box;
107+
align-items: center;
108+
}
109+
110+
.clj-gsoc-blog-post-card {
111+
.mdl-card__title-text a {
112+
color: inherit;
113+
text-decoration: none;
114+
}
115+
}
103116
}

blog/index.html

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Clojure/GSoC blog
3+
layout: cards
4+
---
5+
6+
{% for post in paginator.posts %}
7+
<section class="mdl-card mdl-shadow--4dp mdl-cell mdl-cell--12-col clj-gsoc-blog-post-card">
8+
<header class="mdl-card__title mdl-color-text--primary-contrast mdl-color--primary">
9+
<h2 class="mdl-card__title-text"><a href="{{ post.url }}">{{ post.title }}</a></h2>
10+
<div class="mdl-layout-spacer"></div>
11+
<span>{{ post.date | date_to_string }}</span>
12+
</header>
13+
<main class="mdl-card__supporting-text mdl-card--expand">
14+
{{ post.content }}
15+
</main>
16+
</section>
17+
{% endfor %}
18+
19+
{% if paginator.total_pages > 1 %}
20+
<div class="mdl-cell mdl-cell--12-col clj-gsoc-pagination">
21+
{% if paginator.previous_page %}
22+
<a class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--raised mdl-button--colored" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">Previous</a>
23+
{% else %}
24+
<span class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--raised mdl-button--colored" disabled>Previous </span>
25+
{% endif %}
26+
27+
<div class="mdl-layout-spacer"></div>
28+
29+
{% if paginator.next_page %}
30+
<a class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--raised mdl-button--colored" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next</a>
31+
{% else %}
32+
<span class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--raised mdl-button--colored" disabled>Next</span>
33+
{% endif %}
34+
</div>
35+
{% endif %}

0 commit comments

Comments
 (0)