forked from clarklab/chowdown
-
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.
Merge pull request #16 from JayPanoz/pagination
Pagination
- Loading branch information
Showing
5 changed files
with
88 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "jekyll" | ||
|
||
group :jekyll_plugins do | ||
gem "jekyll-paginate-v2" | ||
end |
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,20 +1,51 @@ | ||
--- | ||
layout: default | ||
id: "homepage" | ||
pagination: | ||
enabled: true | ||
--- | ||
|
||
<div class="home"> | ||
<div class="recipes xs-px1 xs-mt2"> | ||
<div class="clearfix"> | ||
{% assign sorted = site.recipes | sort:"title" %} | ||
{% for post in sorted %} | ||
|
||
{% for post in paginator.posts %} | ||
|
||
<div class="sm-col sm-col-6 md-col-6 lg-col-4 xs-px1 xs-mb2"> | ||
<a class="block relative bg-accent" href="{{ post.url | prepend: site.baseurl }}"> | ||
<div class="image ratio bg-cover"{% for image in post.image %} style="background-image:url({{site.baseurl}}/images/{{ image }});"{% endfor %}></div> | ||
<h1 class="title p2 m0 absolute bold white bottom-0 left-0">{{ post.title }}</h1> | ||
</a> | ||
</div> | ||
{% endfor %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
|
||
<div class="paginator-nav xs-px1 xs-mt2"> | ||
<div class="clearfix"> | ||
{% if paginator.total_pages > 1 %} | ||
<ul class="paginator-list"> | ||
{% if paginator.previous_page %} | ||
<li class="paginator-prev"> | ||
<a href="{{ paginator.previous_page_path | prepend: site.baseurl }}">{{ site.translation[site.language].paginator_previous }}</a> | ||
</li> | ||
{% endif %} | ||
|
||
{% if paginator.page_trail %} | ||
{% for trail in paginator.page_trail %} | ||
<li class="paginator-trail{% if page.url == trail.path %} selected{% endif %}"> | ||
<a href="{{ trail.path | prepend: site.baseurl }}" title="{{trail.title}}">{{ trail.num }}</a> | ||
</li> | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% if paginator.next_page %} | ||
<li class="paginator-next"> | ||
<a href="{{ paginator.next_page_path | prepend: site.baseurl }}">{{ site.translation[site.language].paginator_next }}</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> |