Merge pull request #113 from ErisDS/helper-updates

Updating Casper's use of title and author helpers
This commit is contained in:
John O'Nolan 2014-08-05 23:43:08 +02:00
commit 8fd21ea939
3 changed files with 33 additions and 28 deletions

View File

@ -2,27 +2,31 @@
{{! The tag above means - insert everything in this file into the {body} of the default.hbs template }} {{! The tag above means - insert everything in this file into the {body} of the default.hbs template }}
{{! The big featured header }} {{! The big featured header }}
<header class="main-header author-head {{#if author.cover}}" style="background-image: url({{author.cover}}){{else}}no-cover{{/if}}">
<nav class="main-nav overlay clearfix">
<a class="back-button icon-arrow-left" href="{{@blog.url}}">Home</a>
<a class="subscribe-button icon-feed" href="{{@blog.url}}/author/{{author.slug}}/rss/">{{author.name}}</a>
</nav>
</header>
<section class="author-profile inner"> {{! Everything inside the #author tags pulls data from the author }}
{{#if author.image}} {{#author}}
<figure class="author-image"> <header class="main-header author-head {{#if cover}}" style="background-image: url({{cover}}){{else}}no-cover{{/if}}">
<div class="img" style="background-image: url({{author.image}})"><span class="hidden">{{author.name}}'s Picture</span></div> <nav class="main-nav overlay clearfix">
</figure> <a class="back-button icon-arrow-left" href="{{@blog.url}}">Home</a>
{{/if}} <a class="subscribe-button icon-feed" href="{{url}}rss/">{{name}}</a>
<h1 class="author-title">{{author.name}}</h1> </nav>
<h2 class="author-bio">{{author.bio}}</h2> </header>
<div class="author-meta">
{{#if author.location}}<span class="author-location icon-location">{{author.location}}</span>{{/if}} <section class="author-profile inner">
{{#if author.website}}<span class="author-link icon-link"><a href="{{author.website}}">{{author.website}}</a></span>{{/if}} {{#if image}}
<span class="author-stats"><i class="icon-stats"></i> {{plural pagination.total empty='No posts' singular='% post' plural='% posts'}}</span> <figure class="author-image">
</div> <div class="img" style="background-image: url({{image}})"><span class="hidden">{{name}}'s Picture</span></div>
</section> </figure>
{{/if}}
<h1 class="author-title">{{name}}</h1>
<h2 class="author-bio">{{bio}}</h2>
<div class="author-meta">
{{#if location}}<span class="author-location icon-location">{{location}}</span>{{/if}}
{{#if website}}<span class="author-link icon-link"><a href="{{website}}">{{website}}</a></span>{{/if}}
<span class="author-stats"><i class="icon-stats"></i> {{plural ../pagination.total empty='No posts' singular='% post' plural='% posts'}}</span>
</div>
</section>
{{/author}}
{{! The main content area on the homepage }} {{! The main content area on the homepage }}
<main class="content" role="main"> <main class="content" role="main">

View File

@ -11,9 +11,10 @@
<main class="content" role="main"> <main class="content" role="main">
<article class="{{post_class}}"> <article class="{{post_class}}">
{{! Everything inside the #post tags pulls data from the post }}
{{#post}} {{#post}}
<h1 class="post-title">{{{title}}}</h1> <h1 class="post-title">{{title}}</h1>
<section class="post-content"> <section class="post-content">
{{content}} {{content}}

View File

@ -15,9 +15,9 @@
{{#post}} {{#post}}
<header class="post-header"> <header class="post-header">
<h1 class="post-title">{{{title}}}</h1> <h1 class="post-title">{{title}}</h1>
<section class="post-meta"> <section class="post-meta">
<time class="post-date" datetime="{{date format='YYYY-MM-DD'}}">{{date format="DD MMMM YYYY"}}</time> {{tags prefix=" on "}} <time class="post-date" datetime="{{date format='YYYY-MM-DD'}}">{{date format="DD MMMM YYYY"}}</time> {{tags prefix=" on "}}
</section> </section>
</header> </header>
@ -26,9 +26,9 @@
</section> </section>
<footer class="post-footer"> <footer class="post-footer">
{{! Everything inside the {#with author} tags pulls data from the author }} {{! Everything inside the #author tags pulls data from the author }}
{{#with author}} {{#author}}
{{#if image}} {{#if image}}
<figure class="author-image"> <figure class="author-image">
@ -38,7 +38,7 @@
<section class="author"> <section class="author">
<h4><a href="{{url}}">{{name}}</a></h4> <h4><a href="{{url}}">{{name}}</a></h4>
{{#if bio}} {{#if bio}}
<p>{{bio}}</p> <p>{{bio}}</p>
{{else}} {{else}}
@ -50,7 +50,7 @@
</div> </div>
</section> </section>
{{/with}} {{/author}}
<section class="share"> <section class="share">
<h4>Share this post</h4> <h4>Share this post</h4>