diff options
author | roryg <rg.rorygibson@gmail.com> | 2014-04-09 18:20:29 +0400 |
---|---|---|
committer | roryg <rg.rorygibson@gmail.com> | 2014-04-09 18:20:29 +0400 |
commit | 74729592661e94c8c269c178313ea8a14dfda4bb (patch) | |
tree | 15184fbca792eb8e24ebe683478e02df5c3c5fbc | |
parent | 8d127019ff7ad3d5e016835a206f2026f3d563e2 (diff) | |
parent | a186e7b03b5c8f5dc496db1debf0296dedba97d0 (diff) |
Merge pull request #35 from halloffame/master
Extracted post content into a partial
-rw-r--r-- | index.hbs | 38 | ||||
-rw-r--r-- | partials/post-content.hbs | 37 | ||||
-rw-r--r-- | post.hbs | 38 |
3 files changed, 39 insertions, 74 deletions
@@ -3,43 +3,7 @@ <div id="latest-post" class="container"> {{#foreach posts}} {{#if @first}} - <article class="post-container {{post_class}}"> - <header class="post-header"> - <h1 class="post-title">{{title}}</h1> - - <p class="post-date"><time datetime="{{published_at}}">Published {{date format="MMMM Do YYYY"}}</time></p> - </header> - - <div class="post-content clearfix"> - {{{content}}} - </div> - - <footer class="post-footer clearfix"> - {{#if tags}} - <p class="post-tags"><span>Tagged:</span> {{tags}}</p> - {{/if}} - - <div class="share"> - <a class="icon-twitter" href="http://twitter.com/share?text={{encode title}}&url={{url absolute="true"}}" - onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;"> - <i class="fa fa-twitter"></i> - <span class="hidden">Twitter</span> - </a> - - <a class="icon-facebook" href="https://www.facebook.com/sharer/sharer.php?u={{url absolute="true"}}" - onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;"> - <i class="fa fa-facebook"></i> - <span class="hidden">Facebook</span> - </a> - - <a class="icon-google-plus" href="https://plus.google.com/share?url={{url absolute="true"}}" - onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;"> - <i class="fa fa-google-plus"></i> - <span class="hidden">Google+</span> - </a> - </div> - </footer> - </article> + {{> post-content}} {{/if}} {{/foreach}} </div> diff --git a/partials/post-content.hbs b/partials/post-content.hbs new file mode 100644 index 0000000..6b4fa08 --- /dev/null +++ b/partials/post-content.hbs @@ -0,0 +1,37 @@ +<article class="post-container {{post_class}}"> + <header class="post-header"> + <h1 class="post-title">{{title}}</h1> + + <p class="post-date"><time datetime="{{published_at}}">Published {{date format="MMMM Do YYYY"}}</time></p> + </header> + + <div class="post-content clearfix"> + {{{content}}} + </div> + + <footer class="post-footer clearfix"> + {{#if tags}} + <p class="post-tags"><span>Tagged:</span> {{tags}}</p> + {{/if}} + + <div class="share"> + <a class="icon-twitter" href="http://twitter.com/share?text={{encode title}}&url={{url absolute="true"}}" + onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;"> + <i class="fa fa-twitter"></i> + <span class="hidden">Twitter</span> + </a> + + <a class="icon-facebook" href="https://www.facebook.com/sharer/sharer.php?u={{url absolute="true"}}" + onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;"> + <i class="fa fa-facebook"></i> + <span class="hidden">Facebook</span> + </a> + + <a class="icon-google-plus" href="https://plus.google.com/share?url={{url absolute="true"}}" + onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;"> + <i class="fa fa-google-plus"></i> + <span class="hidden">Google+</span> + </a> + </div> + </footer> +</article>
\ No newline at end of file @@ -2,42 +2,6 @@ <div class="container"> {{#post}} - <article class="post-container {{post_class}}"> - <header class="post-header"> - <h1 class="post-title">{{title}}</h1> - - <p class="post-date"><time datetime="{{published_at}}">Published {{date format="MMMM Do YYYY"}}</time></p> - </header> - - <div class="post-content clearfix"> - {{{content}}} - </div> - - <footer class="post-footer clearfix"> - {{#if tags}} - <p class="post-tags"><span>Tagged:</span> {{tags}}</p> - {{/if}} - - <div class="share"> - <a class="icon-twitter" href="http://twitter.com/share?text={{encode title}}&url={{url absolute="true"}}" - onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;"> - <i class="fa fa-twitter"></i> - <span class="hidden">Twitter</span> - </a> - - <a class="icon-facebook" href="https://www.facebook.com/sharer/sharer.php?u={{url absolute="true"}}" - onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;"> - <i class="fa fa-facebook"></i> - <span class="hidden">Facebook</span> - </a> - - <a class="icon-google-plus" href="https://plus.google.com/share?url={{url absolute="true"}}" - onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;"> - <i class="fa fa-google-plus"></i> - <span class="hidden">Google+</span> - </a> - </div> - </footer> - </article> + {{> post-content}} {{/post}} </div>
\ No newline at end of file |