Added descriptive handlebars comments to help new developers

This commit is contained in:
John O'Nolan 2013-09-01 17:02:37 +02:00 committed by Hannah Wolfe
parent d93a50d48b
commit 2ef2ff68bf
2 changed files with 19 additions and 7 deletions

View file

@ -1,5 +1,9 @@
{{!< default}} {{!< default}}
{{! The comment above "< default" means - insert everything in this file into
the {body} of the default.hbs template, which contains our header/footer. }}
{{! The big featured header on the homepage, with the site logo and description }}
<header id="site-head"> <header id="site-head">
<div class="vertical"> <div class="vertical">
<div id="site-head-content"> <div id="site-head-content">
@ -10,10 +14,12 @@
</div> </div>
</header> </header>
{{! The main content area on the homepage }}
<main class="content" role="main"> <main class="content" role="main">
{{! Each post will be output using this markup }}
{{#foreach posts}} {{#foreach posts}}
<article class="{{post_class}}"> <article class="{{post_class}}">
<header class="post-header"> <header class="post-header">
<span class="post-meta"><time datetime="{{date published_at format='YYYY-MM-DD'}}">{{date published_at format='DD MMM YYYY'}}</time> in <a href="#">What I Learned Building...</a></span> <span class="post-meta"><time datetime="{{date published_at format='YYYY-MM-DD'}}">{{date published_at format='DD MMM YYYY'}}</time> in <a href="#">What I Learned Building...</a></span>
@ -26,6 +32,8 @@
</article> </article>
{{/foreach}} {{/foreach}}
{{!! After all the posts, we have the previous/next pagination links }}
{{pagination}} {{pagination}}
</main> </main>

View file

@ -1,20 +1,24 @@
{{!< default}} {{!< default}}
<main class="content" role="main"> {{! The comment above "< default" means - insert everything in this file into
the {body} of the default.hbs template, which contains our header/footer. }}
<main class="content" role="main">
{{! Everything inside the #post tags is the template used to ourput the post }}
{{#post}} {{#post}}
<article class="{{post_class}}"> <article class="{{post_class}}">
{{! Each post has the blog logo at the top, with a link back to the homage page }}
<header class="post-header"> <header class="post-header">
<a id="blog-logo" href="{{../settings.url}}"><img src="assets/img/user.png" alt="" /></a> <a id="blog-logo" href="{{../settings.url}}"><img src="assets/img/user.png" alt="" /></a>
</header> </header>
{{! Everything below outputs content of the the post which has been published }}
<span class="post-meta"><time datetime="{{date published_at format='YYYY-MM-DD'}}">{{date published_at format='DD MMM YYYY'}}</time> on <a href="#">What I Learned Building...</a></span> <span class="post-meta"><time datetime="{{date published_at format='YYYY-MM-DD'}}">{{date published_at format='DD MMM YYYY'}}</time> on <a href="#">What I Learned Building...</a></span>
<h1 class="post-title">{{title}}</h1> <h1 class="post-title">{{title}}</h1>
<section class="post-content"> <section class="post-content">
{{content}} {{content}}