Skip to content

Instantly share code, notes, and snippets.

@nimbupani
Created December 2, 2011 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nimbupani/1421414 to your computer and use it in GitHub Desktop.
Save nimbupani/1421414 to your computer and use it in GitHub Desktop.
Octopress archives with pagination
<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}}">&larr; Older</a>
{% endif %}
<a href="/blog/archives">Blog Archives</a>
{% if paginator.previous_page %}
<a class="next" href="{{paginator.previous_page}}">Newer &rarr;</a>
{% endif %}
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment