Created
December 2, 2011 02:15
-
-
Save nimbupani/1421414 to your computer and use it in GitHub Desktop.
Octopress archives with pagination
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
<div class="blog-archives"> | |
{% for post in paginator.posts %} | |
{% assign content = post.content %} | |
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} | |
{% unless year == this_year %} | |
{% assign year = this_year %} | |
<h2>{{ year }}</h2> | |
{% endunless %} | |
<article> | |
{% include archive_post.html %} | |
</article> | |
{% endfor %} | |
<div class="pagination"> | |
{% if paginator.next_page %} | |
<a class="prev" href="{{paginator.next_page}}">← Older</a> | |
{% endif %} | |
<a href="/blog/archives">Blog Archives</a> | |
{% if paginator.previous_page %} | |
<a class="next" href="{{paginator.previous_page}}">Newer →</a> | |
{% endif %} | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment