2013-05-11 06:16:11 -04:00
|
|
|
{{!< default}}
|
2017-06-13 14:07:26 -04:00
|
|
|
|
2017-05-15 16:03:47 -04:00
|
|
|
{{!-- The tag above means: insert everything in this file
|
|
|
|
into the {body} of the default.hbs template --}}
|
|
|
|
|
|
|
|
<header class="site-header outer">
|
|
|
|
<div class="inner">
|
2017-06-13 14:02:22 -04:00
|
|
|
{{> "site-nav"}}
|
2017-05-15 16:03:47 -04:00
|
|
|
</div>
|
|
|
|
</header>
|
2013-08-11 10:39:25 -04:00
|
|
|
|
2016-05-08 04:50:20 -04:00
|
|
|
{{!-- Everything inside the #post tags pulls data from the post --}}
|
2014-09-25 10:35:06 -04:00
|
|
|
{{#post}}
|
|
|
|
|
2018-04-17 16:19:05 -04:00
|
|
|
<main id="site-main" class="site-main outer">
|
2017-05-15 16:03:47 -04:00
|
|
|
<div class="inner">
|
2013-09-01 11:02:37 -04:00
|
|
|
|
2017-06-05 07:19:29 -04:00
|
|
|
<article class="post-full {{post_class}} {{#unless feature_image}}no-image{{/unless}}">
|
2014-08-05 15:44:31 -04:00
|
|
|
|
2017-05-15 16:03:47 -04:00
|
|
|
<header class="post-full-header">
|
|
|
|
<section class="post-full-meta">
|
|
|
|
<time class="post-full-meta-date" datetime="{{date format="YYYY-MM-DD"}}">{{date format="D MMMM YYYY"}}</time>
|
2017-08-10 10:10:17 -04:00
|
|
|
{{#primary_tag}}
|
|
|
|
<span class="date-divider">/</span> <a href="{{url}}">{{name}}</a>
|
|
|
|
{{/primary_tag}}
|
2017-05-15 16:03:47 -04:00
|
|
|
</section>
|
|
|
|
<h1 class="post-full-title">{{title}}</h1>
|
|
|
|
</header>
|
2014-07-31 09:54:34 -04:00
|
|
|
|
2017-05-15 16:03:47 -04:00
|
|
|
{{#if feature_image}}
|
2018-12-17 07:25:57 -05:00
|
|
|
<figure class="post-full-image">
|
|
|
|
{{!-- This is a responsive image, it loads different sizes depending on device
|
|
|
|
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
|
|
|
|
<img
|
|
|
|
srcset="{{img_url feature_image size="s"}} 300w,
|
|
|
|
{{img_url feature_image size="m"}} 600w,
|
|
|
|
{{img_url feature_image size="l"}} 1000w,
|
|
|
|
{{img_url feature_image size="xl"}} 2000w"
|
|
|
|
sizes="(max-width: 800px) 400px,
|
|
|
|
(max-width: 1170px) 700px,
|
|
|
|
1400px"
|
|
|
|
src="{{img_url feature_image size="xl"}}"
|
|
|
|
alt="{{title}}"
|
|
|
|
/>
|
2014-07-21 14:19:49 -04:00
|
|
|
</figure>
|
|
|
|
{{/if}}
|
2014-07-31 09:54:34 -04:00
|
|
|
|
2017-05-15 16:03:47 -04:00
|
|
|
<section class="post-full-content">
|
2018-07-23 07:20:46 -04:00
|
|
|
<div class="post-content">
|
|
|
|
{{content}}
|
|
|
|
</div>
|
2014-07-20 10:43:44 -04:00
|
|
|
</section>
|
2013-09-01 15:45:19 -04:00
|
|
|
|
2016-05-08 04:50:20 -04:00
|
|
|
{{!-- Email subscribe form at the bottom of the page --}}
|
|
|
|
{{#if @labs.subscribers}}
|
2017-05-15 16:03:47 -04:00
|
|
|
<section class="subscribe-form">
|
|
|
|
<h3 class="subscribe-form-title">Subscribe to {{@blog.title}}</h3>
|
|
|
|
<p>Get the latest posts delivered right to your inbox</p>
|
|
|
|
{{subscribe_form placeholder="youremail@example.com"}}
|
2016-05-08 04:50:20 -04:00
|
|
|
</section>
|
|
|
|
{{/if}}
|
|
|
|
|
2017-05-15 16:03:47 -04:00
|
|
|
<footer class="post-full-footer">
|
|
|
|
|
2018-04-11 05:04:32 -04:00
|
|
|
{{!-- There are two options for how we display the byline/author-info.
|
|
|
|
If the post has more than one author, we load a specific template
|
|
|
|
from includes/byline-multiple.hbs, otherwise, we just use the
|
|
|
|
default byline. --}}
|
2018-04-10 14:19:29 -04:00
|
|
|
|
2018-04-11 05:04:32 -04:00
|
|
|
{{#has author="count:>1"}}
|
|
|
|
{{> "byline-multiple"}}
|
2018-04-10 14:19:29 -04:00
|
|
|
{{else}}
|
2018-04-11 05:04:32 -04:00
|
|
|
{{> "byline-single"}}
|
2018-04-10 14:19:29 -04:00
|
|
|
{{/has}}
|
2017-05-15 16:03:47 -04:00
|
|
|
|
|
|
|
</footer>
|
|
|
|
|
2017-06-08 03:19:22 -04:00
|
|
|
{{!--
|
2017-06-05 07:19:29 -04:00
|
|
|
<section class="post-full-comments">
|
2018-04-11 05:04:32 -04:00
|
|
|
If you want to embed comments, this is a good place to do it!
|
2017-06-05 07:19:29 -04:00
|
|
|
</section>
|
2017-06-08 03:19:22 -04:00
|
|
|
--}}
|
2017-06-05 07:19:29 -04:00
|
|
|
|
2017-05-15 16:03:47 -04:00
|
|
|
</article>
|
|
|
|
|
|
|
|
</div>
|
2014-01-15 04:58:34 -05:00
|
|
|
</main>
|
2014-09-25 10:35:06 -04:00
|
|
|
|
2016-05-08 04:50:20 -04:00
|
|
|
{{!-- Links to Previous/Next posts --}}
|
2017-05-15 16:03:47 -04:00
|
|
|
<aside class="read-next outer">
|
|
|
|
<div class="inner">
|
|
|
|
<div class="read-next-feed">
|
2017-09-07 08:31:42 -04:00
|
|
|
{{#if primary_tag}}
|
2017-08-10 10:10:17 -04:00
|
|
|
{{#get "posts" filter="tags:{{primary_tag.slug}}+id:-{{id}}" limit="3" as |related_posts|}}
|
2017-07-28 11:10:54 -04:00
|
|
|
{{#if related_posts}}
|
2017-06-12 05:01:00 -04:00
|
|
|
<article class="read-next-card"
|
2017-08-10 10:10:17 -04:00
|
|
|
{{#if ../primary_tag.feature_image}}
|
2018-12-17 07:25:57 -05:00
|
|
|
style="background-image: url({{img_url ../primary_tag.feature_image size="m"}})"
|
2017-06-12 05:01:00 -04:00
|
|
|
{{else}}
|
|
|
|
{{#if @blog.cover_image}}
|
2018-12-17 07:25:57 -05:00
|
|
|
style="background-image: url({{img_url @blog.cover_image size="m"}})"{{/if}}
|
2017-06-12 05:01:00 -04:00
|
|
|
{{/if}}
|
|
|
|
>
|
|
|
|
<header class="read-next-card-header">
|
2017-06-13 13:51:08 -04:00
|
|
|
<small class="read-next-card-header-sitetitle">— {{@blog.title}} —</small>
|
2017-08-10 10:10:17 -04:00
|
|
|
{{#../primary_tag}}
|
|
|
|
<h3 class="read-next-card-header-title"><a href="{{url}}">{{name}}</a></h3>
|
|
|
|
{{/../primary_tag}}
|
2017-06-12 05:01:00 -04:00
|
|
|
</header>
|
|
|
|
<div class="read-next-divider">{{> "icons/infinity"}}</div>
|
|
|
|
<div class="read-next-card-content">
|
2017-06-13 13:51:08 -04:00
|
|
|
<ul>
|
2017-07-28 11:10:54 -04:00
|
|
|
{{#foreach related_posts}}
|
2017-06-12 05:01:00 -04:00
|
|
|
<li><a href="{{url}}">{{title}}</a></li>
|
|
|
|
{{/foreach}}
|
2017-06-13 13:51:08 -04:00
|
|
|
</ul>
|
2017-06-12 05:01:00 -04:00
|
|
|
</div>
|
2017-06-13 13:51:08 -04:00
|
|
|
<footer class="read-next-card-footer">
|
2017-08-10 10:10:17 -04:00
|
|
|
<a href="{{#../primary_tag}}{{url}}{{/../primary_tag}}">{{plural meta.pagination.total empty='No posts' singular='% post' plural='See all % posts'}} →</a>
|
2017-06-13 13:51:08 -04:00
|
|
|
</footer>
|
2017-06-12 05:01:00 -04:00
|
|
|
</article>
|
2017-07-28 11:10:54 -04:00
|
|
|
{{/if}}
|
2017-05-15 16:03:47 -04:00
|
|
|
{{/get}}
|
2017-09-07 08:31:42 -04:00
|
|
|
{{/if}}
|
2017-05-15 16:03:47 -04:00
|
|
|
|
2017-06-12 05:01:00 -04:00
|
|
|
{{!-- If there's a next post, display it using the same markup included from - partials/post-card.hbs --}}
|
2017-05-15 16:03:47 -04:00
|
|
|
{{#next_post}}
|
2017-06-12 05:01:00 -04:00
|
|
|
{{> "post-card"}}
|
2017-05-15 16:03:47 -04:00
|
|
|
{{/next_post}}
|
|
|
|
|
2017-06-12 05:01:00 -04:00
|
|
|
{{!-- If there's a previous post, display it using the same markup included from - partials/post-card.hbs --}}
|
2017-05-15 16:03:47 -04:00
|
|
|
{{#prev_post}}
|
2017-06-12 05:01:00 -04:00
|
|
|
{{> "post-card"}}
|
2017-05-15 16:03:47 -04:00
|
|
|
{{/prev_post}}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-03-27 13:10:31 -04:00
|
|
|
</aside>
|
|
|
|
|
2017-06-15 10:03:19 -04:00
|
|
|
{{!-- Floating header which appears on-scroll, included from includes/floating-header.hbs --}}
|
|
|
|
{{> floating-header}}
|
|
|
|
|
2014-09-25 10:35:06 -04:00
|
|
|
{{/post}}
|
2017-06-08 03:19:22 -04:00
|
|
|
|
|
|
|
{{!-- The #contentFor helper here will send everything inside it up to the matching #block helper found in default.hbs --}}
|
|
|
|
{{#contentFor "scripts"}}
|
|
|
|
<script>
|
2017-06-18 19:11:32 -04:00
|
|
|
|
|
|
|
// NOTE: Scroll performance is poor in Safari
|
|
|
|
// - this appears to be due to the events firing much more slowly in Safari.
|
|
|
|
// Dropping the scroll event and using only a raf loop results in smoother
|
|
|
|
// scrolling but continuous processing even when not scrolling
|
|
|
|
$(document).ready(function () {
|
|
|
|
// Start fitVids
|
|
|
|
var $postContent = $(".post-full-content");
|
|
|
|
$postContent.fitVids();
|
|
|
|
// End fitVids
|
|
|
|
|
2018-08-03 04:21:05 -04:00
|
|
|
var progressBar = document.querySelector('#reading-progress');
|
2017-06-18 19:11:32 -04:00
|
|
|
var header = document.querySelector('.floating-header');
|
|
|
|
var title = document.querySelector('.post-full-title');
|
|
|
|
|
|
|
|
var lastScrollY = window.scrollY;
|
|
|
|
var lastWindowHeight = window.innerHeight;
|
|
|
|
var lastDocumentHeight = $(document).height();
|
|
|
|
var ticking = false;
|
|
|
|
|
|
|
|
function onScroll() {
|
|
|
|
lastScrollY = window.scrollY;
|
|
|
|
requestTick();
|
2017-06-14 07:16:16 -04:00
|
|
|
}
|
|
|
|
|
2017-06-18 19:11:32 -04:00
|
|
|
function onResize() {
|
|
|
|
lastWindowHeight = window.innerHeight;
|
|
|
|
lastDocumentHeight = $(document).height();
|
|
|
|
requestTick();
|
2017-06-14 07:16:16 -04:00
|
|
|
}
|
|
|
|
|
2017-06-18 19:11:32 -04:00
|
|
|
function requestTick() {
|
|
|
|
if (!ticking) {
|
|
|
|
requestAnimationFrame(update);
|
|
|
|
}
|
|
|
|
ticking = true;
|
|
|
|
}
|
2017-06-14 07:16:16 -04:00
|
|
|
|
2017-06-18 19:11:32 -04:00
|
|
|
function update() {
|
|
|
|
var trigger = title.getBoundingClientRect().top + window.scrollY;
|
|
|
|
var triggerOffset = title.offsetHeight + 35;
|
|
|
|
var progressMax = lastDocumentHeight - lastWindowHeight;
|
2017-06-14 07:16:16 -04:00
|
|
|
|
2017-06-18 19:11:32 -04:00
|
|
|
// show/hide floating header
|
|
|
|
if (lastScrollY >= trigger + triggerOffset) {
|
|
|
|
header.classList.add('floating-active');
|
|
|
|
} else {
|
|
|
|
header.classList.remove('floating-active');
|
2017-06-14 07:16:16 -04:00
|
|
|
}
|
|
|
|
|
2017-06-18 19:11:32 -04:00
|
|
|
progressBar.setAttribute('max', progressMax);
|
|
|
|
progressBar.setAttribute('value', lastScrollY);
|
2017-06-14 07:16:16 -04:00
|
|
|
|
2017-06-18 19:11:32 -04:00
|
|
|
ticking = false;
|
2017-06-14 07:16:16 -04:00
|
|
|
}
|
2017-06-18 19:11:32 -04:00
|
|
|
|
|
|
|
window.addEventListener('scroll', onScroll, {passive: true});
|
|
|
|
window.addEventListener('resize', onResize, false);
|
|
|
|
|
|
|
|
update();
|
2018-04-10 14:19:29 -04:00
|
|
|
|
2017-06-08 03:19:22 -04:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{{/contentFor}}
|