_layouts/post.html in hanuman-0.3.0 vs _layouts/post.html in hanuman-0.4.0
- old
+ new
@@ -1,153 +1,157 @@
----
-layout: default
----
- {% if page.cover %}
- <figure class="ampstart-image-fullpage-hero m0 relative mb4">
- <amp-img width="404" height="720" alt="{{ page.title }}" layout="responsive" src="{{ site.baseurl }}{{ page.cover }}" media="(max-width: 415px)"></amp-img>
- <amp-img height="720" alt="{{ page.title }}" layout="fixed-height" src="{{ site.baseurl }}{{ page.cover }}" media="(min-width: 416px)"></amp-img>
- <figcaption class="absolute top-0 right-0 bottom-0 left-0">
- <header class="p3">
- <h1 class="ampstart-fullpage-hero-heading mb0 hanuman">
- <span class="ampstart-fullpage-hero-heading-text title">
- {{ page.title }}
- </span>
- </h1>
- <h2 class="ampstart-fullpage-hero-heading mb0">
- {% if page.author %}
- <span class="ampstart-fullpage-hero-heading-text description">
- By <b><a href="#" role="author" class="text-decoration-none author">{{page.author}}</a></b>
- </span>
- {% endif %}
- </h2>
- </header>
- <footer class="absolute left-0 right-0 bottom-0">
- <a class="ampstart-readmore py3 caps line-height-2 text-decoration-none center block h5" href="#content"><span class="ampstart-readmore-text px1">Read more</span></a>
- </footer>
- </figcaption>
- </figure>
-
- <main id="content" role="main" class="">
- <article class="photo-article">
- <div class="post-meta mb4 px3">
- <time class="post-date" datetime="{{ page.date | date:'%Y-%m-%d' }}">{{ page.date | date_to_string }}</time>
-
- {% if page.tags.size > 0 %}
- in
- {% for tag in page.tags %}
- {% if forloop.index == page.tags.size %}
- <a href=''>{{ tag | capitalize }}</a>
- {% else %}
- <a href=''>{{ tag | capitalize }}</a>,
- {% endif %}
- {% endfor %}
- {% endif %}
-
- </div>
-
- <div class="mb4 px3 radhakrishna" align="left">
- <amp-social-share type="facebook" width="45" height="33" data-param-app_id="145393166088568"></amp-social-share>
- <amp-social-share type="twitter" width="45" height="33"></amp-social-share>
- <amp-social-share type="whatsapp" width="45" height="33"></amp-social-share>
- <amp-social-share type="gplus" width="45" height="33"></amp-social-share>
- <amp-social-share width="45" height="33" type="email"></amp-social-share>
- </div>
-
- {% else %}
-
- <main id="content" role="main" class="">
- <article class="recipe-article">
- <header>
- {% if page.tags.size > 0 %}
- <span class="ampstart-subtitle block px3 pt2 mb2">
- {% for tag in page.tags %}
- {% if forloop.index == page.tags.size %}
- {{ tag | upcase }}
- {% else %}
- {{ tag | upcase }},
- {% endif %}
- {% endfor %}
- </span>
- {% endif %}
- <h1 class="mb1 px3">{{page.title}}</h1>
-
- <address class="ampstart-byline clearfix mb4 px3 h5">
- <time class="ampstart-byline-pubdate block bold my1" datetime="{{ page.date | date:'%e %B %Y' }}">{{ page.date | date:'%e %B %Y' }}</time>
- </address>
- </header>
-
- {% endif %}
-
- <div class="px3 mb4">
- {{content}}
- </div>
-
- <!-- Start Related article -->
-
- {% if page.tags.size > 0 %}
- {% assign primary = page.tags | first %}
- {% assign related_posts = 0 %}
- {% for post in site.posts %}
- {% if post.tags.size > 0 %}
- {% if post.tags contains primary %}
- {% assign related_posts = related_posts | plus: 1 %}
- {% endif %}
- {% endif %}
- {% endfor %}
- {% if related_posts > 1 %}
- <section class="ampstart-related-article-section p3 mb4 border-top">
- <h2 class="ampstart-heading ampstart-label m0 mb3">Related article</h2>
- <article class="ampstart-related-article">
- {% if post.cover %}
- <amp-img src="{{ site.baseurl }}{{ post.cover }}" width="656" height="350" layout="responsive" alt="" class="mb3"></amp-img>
- {% else %}
- {% if site.cover %}
- <amp-img src="{{ site.baseurl }}{{ site.cover }}" width="656" height="350" layout="responsive" alt="" class="mb3"></amp-img>
- {% endif %}
- {% endif %}
- {% assign count = 0 %}
- {% for post in site.posts %}
- {% if post.tags contains primary %}
- {% if post.title != page.title %}
- {% assign count = count | plus: 1 %}
- {% if count <= 3 %}
- <h3 class="ampstart-heading h4 m0 mb3"><b>{{ post.title }}</b></h3>
- <p class="line-height-4 mb3">
- {% if post.description %}
- {{post.description}}
- {% else %}
- {{ post.content | strip_html | truncatewords:15 }}
- {% endif %}
- </p>
- <a href="{{ site.baseurl }}{{ post.url | remove: '/' }}" class="ampstart-rekated-article-readmore block text-decoration-none ampstart-label">Read more</a>
- {% endif %}
- {% endif %}
- {% endif %}
- {% endfor %}
- </article>
- </section>
- {% endif %}
- {% endif %}
- <!-- End Related article -->
-<hr>
-
-<div class="author-section mb4">
- {% if site.data.author["author"]["assets"] %}
- <amp-img width="100" height="100" class="author-thumb-post" layout="responsive" src="{{ site.baseurl }}{{site.data.author["author"]["assets"]}}" alt="Author image"/></amp-img>
- {% endif %}
- <a href=""><h4 class="author-name">{{site.data.author["author"]["name"]}}</h4></a>
- <p class="mb4 px3">{{site.data.author["author"]["bio"]}}</p>
-</div>
-
-<!-- Start Socialbox -->
-<div class="ampstart-social-box mb4">
- <amp-social-share type="twitter" aria-label="Share this on Twitter"></amp-social-share>
- <amp-social-share type="facebook" aria-label="Share this on Facebook" data-param-app_id="145393166088568"></amp-social-share>
- <amp-social-share type="gplus" aria-label="Share this on Google Plus"></amp-social-share>
- <amp-social-share type="email" aria-label="Share this with E-mail"></amp-social-share>
-</div>
-<!-- End Socialbox -->
-
-
- {% include footer.html %}
-
-</main>
+---
+layout: default
+---
+ {% if page.cover %}
+ <figure class="ampstart-image-fullpage-hero m0 relative mb4">
+ <amp-img width="404" height="720" alt="{{ page.title }}" layout="responsive" src="{{ site.baseurl }}{{ page.cover }}" media="(max-width: 415px)"></amp-img>
+ <amp-img height="720" alt="{{ page.title }}" layout="fixed-height" src="{{ site.baseurl }}{{ page.cover }}" media="(min-width: 416px)"></amp-img>
+ <figcaption class="absolute top-0 right-0 bottom-0 left-0">
+ <header class="p3">
+ <h1 class="ampstart-fullpage-hero-heading mb0 hanuman">
+ <span class="ampstart-fullpage-hero-heading-text title">
+ {{ page.title }}
+ </span>
+ </h1>
+ <h2 class="ampstart-fullpage-hero-heading mb0">
+ {% if page.author %}
+ <span class="ampstart-fullpage-hero-heading-text description">
+ By <b><a href="#" role="author" class="text-decoration-none author">{{page.author}}</a></b>
+ </span>
+ {% endif %}
+ </h2>
+ </header>
+ <footer class="absolute left-0 right-0 bottom-0">
+ <a class="ampstart-readmore py3 caps line-height-2 text-decoration-none center block h5" href="#content"><span class="ampstart-readmore-text px1">Read more</span></a>
+ </footer>
+ </figcaption>
+ </figure>
+
+ <main id="content" role="main" class="">
+ <article class="photo-article">
+ <div class="post-meta mb4 px3">
+ <time class="post-date" datetime="{{ page.date | date:'%Y-%m-%d' }}">{{ page.date | date_to_string }}</time>
+
+ {% if page.tags.size > 0 %}
+ in
+ {% for tag in page.tags %}
+ {% if forloop.index == page.tags.size %}
+ <a href='{{site.baseurl}}tags/#{{tag}}'>{{ tag | capitalize }}</a>
+ {% else %}
+ <a href='{{site.baseurl}}tags/#{{tag}}'>{{ tag | capitalize }}</a>,
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+
+ </div>
+
+ <div class="mb4 px3 radhakrishna" align="left">
+ <amp-social-share type="facebook" width="45" height="33" data-param-app_id="145393166088568"></amp-social-share>
+ <amp-social-share type="twitter" width="45" height="33"></amp-social-share>
+ <amp-social-share type="whatsapp" width="45" height="33"></amp-social-share>
+ <amp-social-share type="gplus" width="45" height="33"></amp-social-share>
+ <amp-social-share width="45" height="33" type="email"></amp-social-share>
+ </div>
+
+ {% else %}
+
+ <main id="content" role="main" class="">
+ <article class="recipe-article">
+ <header>
+ {% if page.tags.size > 0 %}
+ <span class="ampstart-subtitle block px3 pt2 mb2">
+ {% for tag in page.tags %}
+ {% if forloop.index == page.tags.size %}
+ <a href='{{site.baseurl}}tags/#{{tag}}'>{{ tag | capitalize }}</a>
+ {% else %}
+ <a href='{{site.baseurl}}tags/#{{tag}}'>{{ tag | capitalize }}</a>,
+ {% endif %}
+ {% endfor %}
+ </span>
+ {% endif %}
+ <h1 class="mb1 px3">{{page.title}}</h1>
+
+ <address class="ampstart-byline clearfix mb4 px3 h5">
+ <time class="ampstart-byline-pubdate block bold my1" datetime="{{ page.date | date:'%e %B %Y' }}">{{ page.date | date:'%e %B %Y' }}</time>
+ </address>
+ </header>
+
+ {% endif %}
+
+ <div class="px3 mb4">
+ {{content}}
+ </div>
+
+ <!-- Start Related article -->
+
+ {% if page.tags.size > 0 %}
+ {% assign primary = page.tags | first %}
+ {% assign related_posts = 0 %}
+ {% for post in site.posts %}
+ {% if post.tags.size > 0 %}
+ {% if post.tags contains primary %}
+ {% assign related_posts = related_posts | plus: 1 %}
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ {% if related_posts > 1 %}
+ <section class="ampstart-related-article-section p3 mb4 border-top">
+ <h2 class="ampstart-heading ampstart-label m0 mb3">Related article</h2>
+ <article class="ampstart-related-article">
+ {% if post.cover %}
+ <amp-img src="{{ site.baseurl }}{{ post.cover }}" width="656" height="350" layout="responsive" alt="" class="mb3"></amp-img>
+ {% else %}
+ {% if site.cover %}
+ <amp-img src="{{ site.baseurl }}{{ site.cover }}" width="656" height="350" layout="responsive" alt="" class="mb3"></amp-img>
+ {% endif %}
+ {% endif %}
+ {% assign count = 0 %}
+ {% for post in site.posts %}
+ {% if post.tags contains primary %}
+ {% if post.title != page.title %}
+ {% assign count = count | plus: 1 %}
+ {% if count <= 3 %}
+ <h3 class="ampstart-heading h4 m0 mb3"><b>{{ post.title }}</b></h3>
+ <p class="line-height-4 mb3">
+ {% if post.description %}
+ {{post.description}}
+ {% else %}
+ {{ post.content | strip_html | truncatewords:15 }}
+ {% endif %}
+ </p>
+ <a href="{{ site.baseurl }}{{ post.url | remove: '/' }}" class="ampstart-rekated-article-readmore block text-decoration-none ampstart-label">Read more</a>
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ </article>
+ </section>
+ {% endif %}
+ {% endif %}
+ <!-- End Related article -->
+<hr>
+
+{% for author in site.data.authors %}
+ {% if author[1].username == page.author %}
+ <div class="author-section mb4">
+ {% if author[1].assets %}
+ <amp-img width="100" height="100" class="author-thumb-post" layout="responsive" src="{{ site.baseurl }}{{author[1].assets}}" alt="{{author[1].name}}"/></amp-img>
+ {% endif %}
+ <a href="{{site.baseurl}}authors/#{{author[1].username}}"><h4 class="author-name">{{author[1].name}}</h4></a>
+ <p class="mb4 px3">{{author[1].bio}}</p>
+ </div>
+ {% endif %}
+{% endfor %}
+
+<!-- Start Socialbox -->
+<div class="ampstart-social-box mb4">
+ <amp-social-share type="twitter" aria-label="Share this on Twitter"></amp-social-share>
+ <amp-social-share type="facebook" aria-label="Share this on Facebook" data-param-app_id="145393166088568"></amp-social-share>
+ <amp-social-share type="gplus" aria-label="Share this on Google Plus"></amp-social-share>
+ <amp-social-share type="email" aria-label="Share this with E-mail"></amp-social-share>
+</div>
+<!-- End Socialbox -->
+
+
+ {% include footer.html %}
+
+</main>