2013-05-11 10:16:11 +00:00
|
|
|
{{!< default}}
|
2017-05-15 20:03:47 +00:00
|
|
|
{{!-- The tag above means: insert everything in this file
|
|
|
|
into the {body} of the default.hbs template --}}
|
2013-08-20 16:53:02 +00:00
|
|
|
|
2019-10-21 05:43:34 +00:00
|
|
|
<header class="site-home-header">
|
2021-03-03 20:44:25 +00:00
|
|
|
<div class="outer site-header-background">
|
|
|
|
{{#if @site.cover_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 class="site-header-cover"
|
|
|
|
srcset="{{img_url @site.cover_image size="s"}} 300w,
|
|
|
|
{{img_url @site.cover_image size="m"}} 600w,
|
|
|
|
{{img_url @site.cover_image size="l"}} 1000w,
|
|
|
|
{{img_url @site.cover_image size="xl"}} 2000w"
|
|
|
|
sizes="100vw"
|
|
|
|
src="{{img_url @site.cover_image size="xl"}}"
|
|
|
|
alt=""
|
|
|
|
/>
|
|
|
|
{{/if}}
|
2019-10-21 05:43:34 +00:00
|
|
|
<div class="inner">
|
|
|
|
{{> "site-nav"}}
|
|
|
|
<div class="site-header-content">
|
|
|
|
<h1 class="site-title">
|
|
|
|
{{#if @site.logo}}
|
2021-03-03 20:44:25 +00:00
|
|
|
<img class="site-logo" src="{{img_url @site.logo size="m"}}" alt="{{@site.title}}" />
|
2019-10-21 05:43:34 +00:00
|
|
|
{{else}}
|
|
|
|
{{@site.title}}
|
|
|
|
{{/if}}
|
|
|
|
</h1>
|
2021-03-03 20:44:25 +00:00
|
|
|
<p>{{@site.description}}</p>
|
2019-10-21 05:43:34 +00:00
|
|
|
</div>
|
2013-08-28 12:01:39 +00:00
|
|
|
</div>
|
2013-08-20 16:53:02 +00:00
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
|
2017-05-15 20:03:47 +00:00
|
|
|
{{!-- The main content area --}}
|
2018-04-17 20:19:05 +00:00
|
|
|
<main id="site-main" class="site-main outer">
|
2019-10-21 05:43:34 +00:00
|
|
|
<div class="inner posts">
|
2013-08-10 13:06:01 +00:00
|
|
|
|
2017-06-12 09:01:00 +00:00
|
|
|
<div class="post-feed">
|
2021-01-05 07:47:56 +00:00
|
|
|
{{#foreach posts visibility="all"}}
|
2017-06-12 09:01:00 +00:00
|
|
|
|
|
|
|
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
|
|
|
|
{{> "post-card"}}
|
|
|
|
|
|
|
|
{{/foreach}}
|
|
|
|
</div>
|
2013-09-01 15:02:37 +00:00
|
|
|
|
2017-05-15 20:03:47 +00:00
|
|
|
</div>
|
2015-02-28 12:34:58 +00:00
|
|
|
</main>
|
2019-10-21 05:43:34 +00:00
|
|
|
|
2021-03-03 02:48:32 +00:00
|
|
|
<div class="outer site-nav-main">
|
|
|
|
<div class="inner">
|
|
|
|
{{> "site-nav"}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-10-21 05:43:34 +00:00
|
|
|
|
2021-03-03 02:48:32 +00:00
|
|
|
{{!-- Scripts - Sticky behaviour for the header/nav when scrolling --}}
|
2019-10-21 05:43:34 +00:00
|
|
|
<script>
|
2021-03-03 02:48:32 +00:00
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
var nav = document.querySelector('.site-nav-main .site-nav');
|
|
|
|
var feed = document.querySelector('.post-feed');
|
|
|
|
|
|
|
|
var lastScrollY = window.scrollY;
|
|
|
|
var lastWindowHeight = window.innerHeight;
|
|
|
|
var lastDocumentHeight = $(document).height();
|
|
|
|
var ticking = false;
|
|
|
|
|
|
|
|
function onScroll() {
|
|
|
|
lastScrollY = window.scrollY;
|
|
|
|
requestTick();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onResize() {
|
|
|
|
lastWindowHeight = window.innerHeight;
|
|
|
|
lastDocumentHeight = $(document).height();
|
|
|
|
requestTick();
|
|
|
|
}
|
|
|
|
|
|
|
|
function requestTick() {
|
|
|
|
if (!ticking) {
|
|
|
|
requestAnimationFrame(update);
|
2019-10-21 05:43:34 +00:00
|
|
|
}
|
2021-03-03 02:48:32 +00:00
|
|
|
ticking = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function update() {
|
|
|
|
var trigger = feed.getBoundingClientRect().top + window.scrollY;
|
|
|
|
var progressMax = lastDocumentHeight - lastWindowHeight;
|
|
|
|
|
|
|
|
// show/hide nav
|
|
|
|
if (lastScrollY >= trigger - 20) {
|
|
|
|
nav.classList.add('fixed-nav-active');
|
|
|
|
} else {
|
|
|
|
nav.classList.remove('fixed-nav-active');
|
2019-10-21 05:43:34 +00:00
|
|
|
}
|
|
|
|
|
2021-03-03 02:48:32 +00:00
|
|
|
ticking = false;
|
|
|
|
}
|
2019-10-21 05:43:34 +00:00
|
|
|
|
2021-03-03 02:48:32 +00:00
|
|
|
window.addEventListener('scroll', onScroll, { passive: true });
|
|
|
|
window.addEventListener('resize', onResize, false);
|
2019-10-21 05:43:34 +00:00
|
|
|
|
2021-03-03 02:48:32 +00:00
|
|
|
update();
|
2019-10-21 05:43:34 +00:00
|
|
|
|
2021-03-03 02:48:32 +00:00
|
|
|
});
|
2019-10-21 05:43:34 +00:00
|
|
|
</script>
|