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}}">
{{! Everything inside the #author tags pulls data from the author }}
{{#author}}
<header class="main-header author-head {{#if cover}}" style="background-image: url({{cover}}){{else}}no-cover{{/if}}">
<nav class="main-nav overlay clearfix"> <nav class="main-nav overlay clearfix">
<a class="back-button icon-arrow-left" href="{{@blog.url}}">Home</a> <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> <a class="subscribe-button icon-feed" href="{{url}}rss/">{{name}}</a>
</nav> </nav>
</header> </header>
<section class="author-profile inner"> <section class="author-profile inner">
{{#if author.image}} {{#if image}}
<figure class="author-image"> <figure class="author-image">
<div class="img" style="background-image: url({{author.image}})"><span class="hidden">{{author.name}}'s Picture</span></div> <div class="img" style="background-image: url({{image}})"><span class="hidden">{{name}}'s Picture</span></div>
</figure> </figure>
{{/if}} {{/if}}
<h1 class="author-title">{{author.name}}</h1> <h1 class="author-title">{{name}}</h1>
<h2 class="author-bio">{{author.bio}}</h2> <h2 class="author-bio">{{bio}}</h2>
<div class="author-meta"> <div class="author-meta">
{{#if author.location}}<span class="author-location icon-location">{{author.location}}</span>{{/if}} {{#if location}}<span class="author-location icon-location">{{location}}</span>{{/if}}
{{#if author.website}}<span class="author-link icon-link"><a href="{{author.website}}">{{author.website}}</a></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> <span class="author-stats"><i class="icon-stats"></i> {{plural ../pagination.total empty='No posts' singular='% post' plural='% posts'}}</span>
</div> </div>
</section> </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,7 +15,7 @@
{{#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>
@ -27,8 +27,8 @@
<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">
@ -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>