-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(index): add pagination support (#19)
- Loading branch information
Showing
8 changed files
with
98 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
# theme configuration | ||
guardian: | ||
style: | ||
logo_url: https://embed.widencdn.net/img/widen/c17yrvuaac/400px@2x/Widen Engineering White Logo.png?u=mcuc7i | ||
header_background_url: https://embed.widencdn.net/img/widen/m4ml1kuspv/exact/1680x90_Engineering Blog Banner.png?keep=c&crop=yes&u=ksmgip | ||
logo_url: https://embed.widencdn.net/img/widen/c17yrvuaac/400px@2x/widen-engineering-white-logo.png | ||
header_background_url: https://embed.widencdn.net/img/widen/m4ml1kuspv/exact/widen-engineering-blog-banner.png?keep=c&crop=yes | ||
social_links: | ||
twitter: widendev | ||
twitter: acquiadev | ||
github_org: widen | ||
github_repo: jekyll-theme-guardian | ||
email_subscription_url: https://www.widen.com | ||
email_subscription_url: | ||
tracking: | ||
google_analytics_code: | ||
disqus_shortname: | ||
|
||
paginate: 5 | ||
paginate_path: "/blog/page/:num/" | ||
|
||
plugins: | ||
- jekyll-paginate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
layout: default | ||
--- | ||
|
||
{{ content }} | ||
|
||
<div class="posts"> | ||
{% assign posts = site.posts %} | ||
{% if paginator %} | ||
{% assign posts = paginator.posts %} | ||
{% endif %} | ||
{% for post in posts %} | ||
<article> | ||
<h1> | ||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a> | ||
</h1> | ||
|
||
<p class="posts-excerpt"> | ||
{% if post.excerpt != '' %} | ||
{{ post.excerpt | truncatewords: 50 | remove: '<p>' | remove: '</p>' }} | ||
{% else %} | ||
{{ post.content | strip_html | truncatewords: 50 }} | ||
{% endif %} | ||
</p> | ||
|
||
<time>{{ post.date | date: "%b %-d, %Y" }}</time> • {{post.author}} | ||
</article> | ||
{% endfor %} | ||
|
||
{% if paginator %} | ||
<div class="paginator"> | ||
{% if paginator.previous_page %} | ||
<a href="{{ paginator.previous_page_path }}"><ion-icon name="arrow-back-outline"></ion-icon>Newer</a> | ||
{% else %} | ||
<span><ion-icon name="arrow-back-outline"></ion-icon>Newer</span> | ||
{% endif %} | ||
{% if paginator.next_page %} | ||
<a href="{{ paginator.next_page_path }}">Older<ion-icon name="arrow-forward-outline"></ion-icon></a> | ||
{% else %} | ||
<span>Older<ion-icon name="arrow-forward-outline"></ion-icon></span> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,3 @@ | ||
--- | ||
layout: default | ||
layout: index | ||
--- | ||
<div class="posts"> | ||
<ul> | ||
{% for post in site.posts %} | ||
<article> | ||
<h1> | ||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a> | ||
</h1> | ||
|
||
<p class="posts-excerpt"> | ||
{% if post.excerpt != '' %} | ||
{{ post.excerpt | truncatewords: 50 | remove: '<p>' | remove: '</p>' }} | ||
{% else %} | ||
{{ post.content | strip_html | truncatewords: 50 }} | ||
{% endif %} | ||
</p> | ||
|
||
<time>{{ post.date | date: "%b %-d, %Y" }}</time> • {{post.author}} | ||
</article> | ||
{% endfor %} | ||
</ul> | ||
</div> |