liebling/post.hbs

190 lines
8.1 KiB
Handlebars
Raw Normal View History

2019-04-14 18:41:25 +00:00
{{!--
This template is used for the post page.
--}}
{{!-- The tag below means: insert everything in this file
into the {body} of the default.hbs template --}}
2019-02-28 16:26:55 +00:00
{{!< default}}
2019-03-08 09:47:48 +00:00
<div class="main-wrap">
2019-04-14 18:41:25 +00:00
{{!-- Everything inside the #post tags pulls data from the post --}}
2019-03-08 09:47:48 +00:00
{{#post}}
2019-04-14 18:41:25 +00:00
{{!--Special header.hbs partial to generate the <header> tag--}}
2019-02-28 16:26:55 +00:00
{{> header background=feature_image}}
2019-04-14 18:41:25 +00:00
{{!-- Inject styles of the hero image to make it responsive --}}
2019-02-28 16:26:55 +00:00
{{> hero background=feature_image}}
</header>
2019-03-08 09:47:48 +00:00
{{/post}}
2019-03-12 10:39:01 +00:00
<main>
2019-03-08 09:47:48 +00:00
<article>
2019-03-12 10:39:01 +00:00
<div class="l-content">
2019-04-14 18:41:25 +00:00
{{!-- Everything inside the #post tags pulls data from the post --}}
2019-03-08 09:47:48 +00:00
{{#post}}
<div class="l-wrapper in-post js-aos-wrapper" data-aos="fade-up" data-aos-delay="300">
{{#if @labs.subscribers}}
<div class="l-post-content has-subscribe-form js-progress-content">
{{else}}
<div class="l-post-content js-progress-content">
{{/if}}
2019-02-28 16:26:55 +00:00
<header class="m-heading">
<h1 class="m-heading__title in-post">{{title}}</h1>
2019-03-12 10:39:01 +00:00
<div class="m-heading__meta">
2019-02-28 16:26:55 +00:00
{{#if primary_tag}}
2019-03-08 09:47:48 +00:00
<a href="{{primary_tag.url}}" class="m-heading__meta__tag">{{primary_tag.name}}</a>
<span class="m-heading__meta__divider">&bull;</span>
2019-02-28 16:26:55 +00:00
{{/if}}
<span class="m-heading__meta__time">{{date published_at}}</span>
2019-03-12 10:39:01 +00:00
</div>
2019-02-28 16:26:55 +00:00
</header>
2019-03-12 10:39:01 +00:00
<div class="pos-relative js-post-content">
2019-02-28 16:26:55 +00:00
<div class="m-share">
<div class="m-share__content js-sticky">
<a href="https://www.facebook.com/sharer/sharer.php?u={{url absolute='true'}}" class="m-icon-button filled in-share" target="_blank" rel="noopener" aria-label="Facebook">
2019-02-28 16:26:55 +00:00
<span class="icon-facebook"></span>
</a>
<a href="https://twitter.com/intent/tweet?text={{encode title}}&url={{url absolute='true'}}" class="m-icon-button filled in-share" target="_blank" rel="noopener" aria-label="Twitter">
2019-02-28 16:26:55 +00:00
<span class="icon-twitter"></span>
</a>
<button class="m-icon-button filled in-share progress js-scrolltop" aria-label="Scroll to top">
2019-02-28 16:26:55 +00:00
<span class="icon-arrow-top"></span>
<svg>
<circle class="progress-ring__circle js-progress" stroke="#04aeee" fill="transparent" r="0" />
2019-02-28 16:26:55 +00:00
</svg>
</button>
</div>
</div>
{{content}}
2019-03-12 10:39:01 +00:00
</div>
2019-02-28 16:26:55 +00:00
</div>
</div>
2019-04-14 18:41:25 +00:00
{{!-- Email subscribe form at the bottom of the page --}}
{{#if @labs.subscribers}}
2019-03-03 18:32:36 +00:00
<section class="m-subscribe-section">
<div class="l-wrapper in-post">
<div class="m-subscribe-section__content">
<div class="m-subscribe-section__text">
2019-08-15 14:40:46 +00:00
<h4 class="m-subscribe-section__title">{{t "Subscribe to our newsletter"}}</h4>
2019-03-03 18:32:36 +00:00
<p class="m-subscribe-section__description">
2019-08-15 14:40:46 +00:00
{{t "Get the latest posts delivered right to your inbox."}}
2019-03-03 18:32:36 +00:00
</p>
</div>
<div class="m-subscribe-section__form">
{{subscribe_form
form_id="subscribe-form"
2019-03-08 09:47:48 +00:00
form_class="m-subscribe-section__form"
input_id="subscribe_input"
2019-03-08 09:47:48 +00:00
input_class="m-input in-subscribe-section"
button_id="subscribe_button"
2019-03-08 09:47:48 +00:00
button_class="m-button primary block"
2019-08-17 18:34:39 +00:00
placeholder=(t "Your email address")
2019-03-08 09:47:48 +00:00
}}
2019-03-03 18:32:36 +00:00
</div>
2019-02-28 16:26:55 +00:00
</div>
</div>
2019-03-03 18:32:36 +00:00
</section>
{{/if}}
{{#if @labs.subscribers}}
2019-03-03 18:32:36 +00:00
<section class="m-author">
{{else}}
<section class="m-author no-subscribers">
{{/if}}
2019-03-03 18:32:36 +00:00
<div class="m-author__content">
<div class="m-author__picture">
<a href="{{primary_author.url}}" class="m-author-picture" aria-label="Author picture">
2019-03-03 18:32:36 +00:00
{{#if primary_author.profile_image}}
2019-02-28 16:26:55 +00:00
<div style="background-image: url({{primary_author.profile_image}});"></div>
2019-03-03 18:32:36 +00:00
{{else}}
2019-02-28 16:26:55 +00:00
<div style="background-image: url({{asset "images/default-avatar-square-small.jpg"}});"></div>
2019-03-03 18:32:36 +00:00
{{/if}}
</a>
</div>
<div class="m-author__info">
<h4 class="m-author__name">
<a href="{{primary_author.url}}">{{primary_author.name}}</a>
</h4>
{{#has author="count:>1"}}
2019-02-28 16:26:55 +00:00
<p class="m-small-text in-author-along-with">
2019-08-17 18:34:39 +00:00
{{authors separator=", " prefix=(t "Among with no break line") from="2"}}
2019-02-28 16:26:55 +00:00
</p>
2019-03-03 18:32:36 +00:00
{{/has}}
{{#if primary_author.bio}}
2019-02-28 16:26:55 +00:00
<p class="m-author__bio">{{primary_author.bio}}</p>
{{/if}}
2019-03-03 18:32:36 +00:00
<ul class="m-author-links">
{{#if primary_author.website}}
<li>
<a href="{{primary_author.website}}" target="_blank" rel="noopener" aria-label="Website">
2019-03-03 18:32:36 +00:00
<span class="icon-globe"></span>
</a>
</li>
{{/if}}
{{#if primary_author.facebook}}
<li>
<a href="https://facebook.com/{{primary_author.facebook}}" target="_blank" rel="noopener" aria-label="Facebook">
2019-03-03 18:32:36 +00:00
<span class="icon-facebook"></span>
</a>
</li>
{{/if}}
{{#if primary_author.twitter}}
<li>
<a href="https://twitter.com/{{primary_author.twitter}}" target="_blank" rel="noopener" aria-label="Twitter">
2019-03-03 18:32:36 +00:00
<span class="icon-twitter"></span>
</a>
</li>
{{/if}}
</ul>
</div>
2019-02-28 16:26:55 +00:00
</div>
2019-03-03 18:32:36 +00:00
</section>
2019-04-14 18:41:25 +00:00
{{!-- If you want to embed comments, this is a good place to do it! --}}
2019-03-03 18:32:36 +00:00
{{!--
2019-03-08 09:47:48 +00:00
<section class="m-comments">
<div class="m-load-comments">
<div class="m-load-comments__line"></div>
<button class="m-icon-button filled as-load-comments js-tooltip js-load-comments" data-tippy-content="Load comments">
<span class="icon-comments"></span>
</button>
</div>
<div class="m-load-comments__iframe l-wrapper in-comments js-comments-iframe">
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = "{{url absolute="true"}}";
this.page.identifier = "ghost-{{comment_id}}"
};
(function () {
var d = document, s = d.createElement('script');
s.src = 'https://CHANGETHIS.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
</div>
</section>
--}}
{{/post}}
2019-04-14 18:41:25 +00:00
{{!-- Related posts --}}
2019-03-08 09:47:48 +00:00
{{#get "posts" limit="3" filter="tags:[{{post.tags}}]+id:-{{post.id}}" include="tags,authors" as |related|}}
2019-03-03 18:32:36 +00:00
<section class="m-recommended">
<div class="l-wrapper in-recommended">
2019-08-15 14:40:46 +00:00
<h3 class="m-section-title in-recommended">{{t "Recommended for you"}}</h3>
2019-03-03 18:32:36 +00:00
<div class="m-recommended-articles">
<div class="m-recommended-slider js-recommended-articles">
2019-04-14 18:41:25 +00:00
{{!-- The tag below iterates over all the related posts --}}
2019-03-03 18:32:36 +00:00
{{> "loop"}}
</div>
2019-03-03 18:32:36 +00:00
</div>
</div>
</section>
2019-03-08 09:47:48 +00:00
{{/get}}
2019-03-12 10:39:01 +00:00
</div>
2019-03-08 09:47:48 +00:00
</article>
</main>
</div>
2019-02-28 16:26:55 +00:00
2019-04-14 18:41:25 +00:00
{{!-- The #contentFor helper here will send everything inside it up to the matching #block helper found in default.hbs --}}
2019-02-28 16:26:55 +00:00
{{#contentFor "scripts"}}
<script defer src="{{asset "js/post.js"}}"></script>
{{/contentFor}}