Skip to content

Commit

Permalink
include archive in single posts
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmorris committed Feb 15, 2013
1 parent 890577e commit 6e5c5fd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
18 changes: 18 additions & 0 deletions _includes/archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<section class="other-posts">
<h2>Other Posts</h2>
<ul class="content-index">
{% for post in site.posts %}
{% assign index = true %}
{% assign truncated = true %}
{% assign content = post.content %}
{% capture current_year %}{{post.date | date: "%Y"}}{% endcapture %}
{% capture next_year %}{{post.next.date | date: "%Y"}}{% endcapture %}

{% if current_year != next_year and next_year != '' %}
<li class="year-mark"><h3>{{ post.date | date: "%Y" }}</h3></li>
{% endif %}

<li><a href="{{ site.baseurl }}{{ post.url }}">{% include article.html %}</a></li>
{% endfor %}
</ul>
</section>
4 changes: 3 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ <h2>your community gem host</h2>
</nav>
</header>

{{ content }}
<section class="allcontent">
{{ content }}
</section>

<footer>
<nav>
Expand Down
3 changes: 1 addition & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
---

{% include article.html %}

<a class="allposts" href="{{ site.baseurl }}/">&larr; All blog posts</a>
{% include archive.html %}
31 changes: 6 additions & 25 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,10 @@
title: RubyGems Blog
---

<section class="allcontent">
{% for post in site.posts limit:1 %}
{% assign index = true %}
{% assign content = post.content %}
{% include article.html %}
{% endfor %}
{% for post in site.posts limit:1 %}
{% assign index = true %}
{% assign content = post.content %}
{% include article.html %}
{% endfor %}

<section class="other-posts">
<h2>Other Posts</h2>
<ul class="content-index">
{% for post in site.posts %}
{% assign index = true %}
{% assign truncated = true %}
{% assign content = post.content %}
{% capture current_year %}{{post.date | date: "%Y"}}{% endcapture %}
{% capture next_year %}{{post.next.date | date: "%Y"}}{% endcapture %}

{% if current_year != next_year and next_year != '' %}
<li class="year-mark"><h3>{{ post.date | date: "%Y" }}</h3></li>
{% endif %}

<li><a href="{{ site.baseurl }}{{ post.url }}">{% include article.html %}</a></li>
{% endfor %}
</ul>
</section>
</section>
{% include archive.html %}

0 comments on commit 6e5c5fd

Please sign in to comment.