Skip to content

Commit

Permalink
Moved posts loop into 'loop' partial
Browse files Browse the repository at this point in the history
  • Loading branch information
roryg committed Aug 12, 2014
1 parent fc1e4b1 commit 46b64ae
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 39 deletions.
14 changes: 1 addition & 13 deletions author.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,7 @@
</section>

<ol class="post-list">
{{#foreach posts}}
<li class="post-stub {{post_class}}" >
<a class="js-ajax-link" title="{{title}} | {{@blog.title}}" href="{{url}}">
<h4 class="post-stub-title">{{title}}</h4>

<time class="post-stub-date" datetime="{{published_at}}">Published {{date format="MMMM Do YYYY"}}</time>

{{#if featured}}
<span class="post-stub-tag">Featured</span>
{{/if}}
</a>
</li>
{{/foreach}}
{{> loop}}
</ol>

<div class="post-navigation">
Expand Down
14 changes: 1 addition & 13 deletions index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,7 @@

<div id="post-index" class="container">
<ol class="post-list">
{{#foreach posts}}
<li class="post-stub {{post_class}}" >
<a class="js-ajax-link" title="{{title}} | {{@blog.title}}" href="{{url}}">
<h4 class="post-stub-title">{{title}}</h4>

<time class="post-stub-date" datetime="{{published_at}}">Published {{date format="MMMM Do YYYY"}}</time>

{{#if featured}}
<span class="post-stub-tag">Featured</span>
{{/if}}
</a>
</li>
{{/foreach}}
{{> loop}}
</ol>

<div class="post-navigation">
Expand Down
13 changes: 13 additions & 0 deletions partials/loop.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{#foreach posts}}
<li class="post-stub {{post_class}}" >
<a class="js-ajax-link" title="{{title}} | {{@blog.title}}" href="{{url}}">
<h4 class="post-stub-title">{{title}}</h4>

<time class="post-stub-date" datetime="{{published_at}}">Published {{date format="MMMM Do YYYY"}}</time>

{{#if featured}}
<span class="post-stub-tag">Featured</span>
{{/if}}
</a>
</li>
{{/foreach}}
14 changes: 1 addition & 13 deletions tag.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@
<h1 class="page-title">Posts tagged: {{tag.name}}</h1>

<ol class="post-list">
{{#foreach posts}}
<li class="post-stub {{post_class}}" >
<a class="js-ajax-link" title="{{title}} | {{@blog.title}}" href="{{url}}">
<h4 class="post-stub-title">{{title}}</h4>

<time class="post-stub-date" datetime="{{published_at}}">Published {{date format="MMMM Do YYYY"}}</time>

{{#if featured}}
<span class="post-stub-tag">Featured</span>
{{/if}}
</a>
</li>
{{/foreach}}
{{> loop}}
</ol>

<div class="post-navigation">
Expand Down

0 comments on commit 46b64ae

Please sign in to comment.