Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added pagination
  • Loading branch information
pablodefendini committed Jan 13, 2017
1 parent c0c955b commit b5ea11c
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 35 deletions.
19 changes: 10 additions & 9 deletions Gemfile.lock
Expand Up @@ -17,12 +17,12 @@ GEM
ethon (0.10.1)
ffi (>= 1.3.0)
execjs (2.7.0)
faraday (0.10.0)
faraday (0.10.1)
multipart-post (>= 1.2, < 3)
ffi (1.9.14)
forwardable-extended (2.6.0)
gemoji (2.1.0)
github-pages (112)
github-pages (114)
activesupport (= 4.2.7)
github-pages-health-check (= 1.3.0)
jekyll (= 3.3.1)
Expand All @@ -31,7 +31,7 @@ GEM
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.8.0)
jekyll-gist (= 1.4.0)
jekyll-github-metadata (= 2.2.0)
jekyll-github-metadata (= 2.3.0)
jekyll-mentions (= 1.2.0)
jekyll-optional-front-matter (= 0.1.2)
jekyll-paginate (= 1.1.0)
Expand All @@ -55,13 +55,14 @@ GEM
jekyll-theme-slate (= 0.0.3)
jekyll-theme-tactile (= 0.0.3)
jekyll-theme-time-machine (= 0.0.3)
jekyll-titles-from-headings (= 0.1.3)
jekyll-titles-from-headings (= 0.1.4)
jemoji (= 0.7.0)
kramdown (= 1.11.1)
liquid (= 3.0.6)
listen (= 3.0.6)
mercenary (~> 0.3)
minima (= 2.0.0)
nokogiri (= 1.6.8.1)
rouge (= 1.11.1)
terminal-table (~> 1.4)
github-pages-health-check (1.3.0)
Expand Down Expand Up @@ -95,7 +96,7 @@ GEM
jekyll (~> 3.3)
jekyll-gist (1.4.0)
octokit (~> 4.2)
jekyll-github-metadata (2.2.0)
jekyll-github-metadata (2.3.0)
jekyll (~> 3.1)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.2.0)
Expand Down Expand Up @@ -144,7 +145,7 @@ GEM
jekyll (~> 3.3)
jekyll-theme-time-machine (0.0.3)
jekyll (~> 3.3)
jekyll-titles-from-headings (0.1.3)
jekyll-titles-from-headings (0.1.4)
jekyll (~> 3.3)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
Expand All @@ -153,7 +154,7 @@ GEM
gemoji (~> 2.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0)
json (1.8.3)
json (1.8.6)
kramdown (1.11.1)
liquid (3.0.6)
listen (3.0.6)
Expand All @@ -171,7 +172,7 @@ GEM
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
public_suffix (2.0.4)
public_suffix (2.0.5)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
Expand All @@ -188,7 +189,7 @@ GEM
ethon (>= 0.8.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
unicode-display_width (1.1.2)
unicode-display_width (1.1.3)

PLATFORMS
ruby
Expand Down
2 changes: 2 additions & 0 deletions _config.yml
Expand Up @@ -22,11 +22,13 @@ url: "firesidefiction.github.io" # the base hostname & protocol for your site, e
twitter_username: firesidefiction
github_username: firesidefiction
google_analytics: UA-42281130-2
paginate: 10

# Build settings
markdown: kramdown
gems:
- jekyll-feed
- jekyll-paginate
exclude:
- Gemfile
- Gemfile.lock
Expand Down
19 changes: 16 additions & 3 deletions _layouts/home.html
Expand Up @@ -7,7 +7,7 @@

{{ content }}

{% for post in site.posts %}
{% for post in paginator.posts %}
{% if post.category == "short story" or post.category == "flash fiction" %}
<div class="entry story">
<h4>{{ post.category }}</h4>
Expand All @@ -25,7 +25,20 @@ <h3>by {{ post.author }}</h3>
{% endif %}
{% endfor %}

<!--FIXME add pagination here <br>
FIXME add category tabs here -->
<ol class="pagination">
{% if paginator.previous_page %}
<li class="previous"><a href="{{ paginator.previous_page_path | relative_url }}">Previous</a></li>
{% else %}
<li></li>
{% endif %}
<li class="current">Page {{ paginator.page }} of {{ paginator.total_pages }}</li>
{% if paginator.next_page %}
<li class="next"><a href="{{ paginator.next_page_path | relative_url }}">Next</a></li>
{% else %}
<li></li>
{% endif %}
</ol>

<!-- FIXME add category tabs here -->

</div>
18 changes: 10 additions & 8 deletions _sass/scss/objects/_nav.scss
Expand Up @@ -45,22 +45,24 @@ footer nav ul {
justify-content: center;

li {
border-right: 1px solid lighten($color__base--light, 30%);
font-weight: 100;
&:last-child {
border: 0;
}
font-weight: 300;
}
a {
padding: $pad;
padding: 0 $pad;
color: $color__highlight;
@include transition(background-color, 0.3s, ease);
&:hover {
color: $color__highlight--focus;
}
}
.current a {
color: $color__base--light;
.current {
padding: 0 $pad;
}
.previous {
border-right: 1px solid lighten($color__base--light, 30%);
}
.next {
border-left: 1px solid lighten($color__base--light, 30%);
}
}

Expand Down
9 changes: 5 additions & 4 deletions docs/assets/css/style.css
Expand Up @@ -287,11 +287,12 @@ header nav ul a { color: #fff; }
@media all and (max-width: 46.8em) { footer nav ul { display: inline; text-align: left; } }

.pagination { overflow: hidden; display: flex; justify-content: center; }
.pagination li { border-right: 1px solid #dadada; font-weight: 100; }
.pagination li:last-child { border: 0; }
.pagination a { padding: 1em; color: #610C0D; -webkit-transition: background-color 0.3s ease; -moz-transition: background-color 0.3s ease; -ms-transition: background-color 0.3s ease; -o-transition: background-color 0.3s ease; transition: background-color 0.3s ease; }
.pagination li { font-weight: 300; }
.pagination a { padding: 0 1em; color: #610C0D; -webkit-transition: background-color 0.3s ease; -moz-transition: background-color 0.3s ease; -ms-transition: background-color 0.3s ease; -o-transition: background-color 0.3s ease; transition: background-color 0.3s ease; }
.pagination a:hover { color: #8e1213; }
.pagination .current a { color: #8d8d8d; }
.pagination .current { padding: 0 1em; }
.pagination .previous { border-right: 1px solid #dadada; }
.pagination .next { border-left: 1px solid #dadada; }

.sidenav { max-width: 20em; margin: 0 auto; }
.sidenav ul { padding: 0 0 0 1em; }
Expand Down
2 changes: 1 addition & 1 deletion docs/feed.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xml" href="http://localhost:4000/magazine/feed.xslt.xml"?><feed xmlns="http://www.w3.org/2005/Atom"><generator uri="http://jekyllrb.com" version="3.3.1">Jekyll</generator><link href="http://localhost:4000/magazine/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/magazine/" rel="alternate" type="text/html" /><updated>2017-01-01T15:31:32-05:00</updated><id>http://localhost:4000/magazine//</id><title type="html">Fireside Magazine</title><subtitle>Fireside Fiction Company has two goals: to find and publish great stories regardless of genre, and to pay our writers and artists well.
<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xml" href="http://localhost:4000/magazine/feed.xslt.xml"?><feed xmlns="http://www.w3.org/2005/Atom"><generator uri="http://jekyllrb.com" version="3.3.1">Jekyll</generator><link href="http://localhost:4000/magazine/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/magazine/" rel="alternate" type="text/html" /><updated>2017-01-13T10:50:09-05:00</updated><id>http://localhost:4000/magazine//</id><title type="html">Fireside Magazine</title><subtitle>Fireside Fiction Company has two goals: to find and publish great stories regardless of genre, and to pay our writers and artists well.
</subtitle><entry><title type="html">Welcome to the Fireside Beta Site</title><link href="http://localhost:4000/magazine/news/welcome-to-the-fireside-beta" rel="alternate" type="text/html" title="Welcome to the Fireside Beta Site" /><published>2016-12-16T10:17:05-05:00</published><updated>2016-12-16T10:17:05-05:00</updated><id>http://localhost:4000/magazine/news/welcome-to-fireside</id><content type="html" xml:base="http://localhost:4000/magazine/news/welcome-to-the-fireside-beta">&lt;p&gt;This is the all-new beta site for Fireside Magazine. It runs on a static site generator called &lt;a href=&quot;https://jekyllrb.com&quot;&gt;Jekyll&lt;/a&gt;, and is served off &lt;a href=&quot;https://pages.github.com&quot;&gt;Github Pages&lt;/a&gt;. The idea is that, with a little bit of Markdown and Git knowledge, we can make Fireside production as simple as editing some plain text flies in a folder, and making a push to &lt;a href=&quot;https://github.com/firesidefiction/magazine&quot; title=&quot;The Fireside Magazine repository on GitHub&quot;&gt;the Fireside git repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You’ll find this post in the &lt;code class=&quot;highlighter-rouge&quot;&gt;_posts&lt;/code&gt; directory. Go ahead and edit it and push the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run &lt;code class=&quot;highlighter-rouge&quot;&gt;jekyll serve&lt;/code&gt;, which launches a web server and auto-regenerates your site when a file is updated.&lt;/p&gt;
Expand Down
19 changes: 9 additions & 10 deletions docs/index.html
Expand Up @@ -67,7 +67,6 @@






<div class="entry news">
Expand Down Expand Up @@ -159,18 +158,18 @@ <h3>by Tobias Buckell</h3>
</div>



<ol class="pagination">

<div class="entry news">
<h4>Jul 26, 2016 | essay</h4>
<h1><a class="post-link" href="/magazine/article/speculative-antiblackness">Speculative Antiblackness</a></h1>
<h3>by Troy L Wiggins</h3>
<p>My name is Troy. I am a black man born of black parents, and I’ve been a black man for about thirty years.</p>
</div>
<li></li>


<li class="current">Page 1 of 2</li>

<li class="next"><a href="/magazine/page2">Next</a></li>

</ol>

<!--FIXME add pagination here <br>
FIXME add category tabs here -->
<!-- FIXME add category tabs here -->

</div>

Expand Down

0 comments on commit b5ea11c

Please sign in to comment.