2013-05-11 06:16:11 -04:00
|
|
|
{{!< default}}
|
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 --}}
|
2013-08-20 12:53:02 -04:00
|
|
|
|
2021-03-03 20:22:45 -05:00
|
|
|
<div class="site-header-content">
|
|
|
|
{{#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}}
|
|
|
|
<h1 class="site-title">
|
|
|
|
{{#if @site.logo}}
|
|
|
|
<img class="site-logo" src="{{img_url @site.logo size="m"}}" alt="{{@site.title}}" />
|
|
|
|
{{else}}
|
|
|
|
{{@site.title}}
|
2021-03-03 15:44:25 -05:00
|
|
|
{{/if}}
|
2021-03-03 20:22:45 -05:00
|
|
|
</h1>
|
|
|
|
<p>{{@site.description}}</p>
|
|
|
|
</div>
|
2013-08-20 12:53:02 -04:00
|
|
|
|
2017-05-15 16:03:47 -04:00
|
|
|
{{!-- The main content area --}}
|
2018-04-17 16:19:05 -04:00
|
|
|
<main id="site-main" class="site-main outer">
|
2019-10-21 01:43:34 -04:00
|
|
|
<div class="inner posts">
|
2013-08-10 09:06:01 -04:00
|
|
|
|
2017-06-12 05:01:00 -04:00
|
|
|
<div class="post-feed">
|
2021-03-03 23:20:10 -05:00
|
|
|
{{#foreach posts}}
|
2017-06-12 05:01:00 -04:00
|
|
|
|
|
|
|
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
|
|
|
|
{{> "post-card"}}
|
|
|
|
|
|
|
|
{{/foreach}}
|
|
|
|
</div>
|
2013-09-01 11:02:37 -04:00
|
|
|
|
2017-05-15 16:03:47 -04:00
|
|
|
</div>
|
2015-02-28 07:34:58 -05:00
|
|
|
</main>
|
2019-10-21 01:43:34 -04:00
|
|
|
|
|
|
|
|
2021-03-02 21:48:32 -05:00
|
|
|
{{!-- Scripts - Sticky behaviour for the header/nav when scrolling --}}
|
2019-10-21 01:43:34 -04:00
|
|
|
<script>
|
2021-03-02 21:48:32 -05: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 01:43:34 -04:00
|
|
|
}
|
2021-03-02 21:48:32 -05: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 01:43:34 -04:00
|
|
|
}
|
|
|
|
|
2021-03-02 21:48:32 -05:00
|
|
|
ticking = false;
|
|
|
|
}
|
2019-10-21 01:43:34 -04:00
|
|
|
|
2021-03-02 21:48:32 -05:00
|
|
|
window.addEventListener('scroll', onScroll, { passive: true });
|
|
|
|
window.addEventListener('resize', onResize, false);
|
2019-10-21 01:43:34 -04:00
|
|
|
|
2021-03-02 21:48:32 -05:00
|
|
|
update();
|
2019-10-21 01:43:34 -04:00
|
|
|
|
2021-03-02 21:48:32 -05:00
|
|
|
});
|
2019-10-21 01:43:34 -04:00
|
|
|
</script>
|