-
Notifications
You must be signed in to change notification settings - Fork 2
/
tag.hbs
60 lines (54 loc) · 1.72 KB
/
tag.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{{!< default}}
{{#tag}}
{{> site-header}}
{{> sub-header}}
<div class="header_banner" data-header-cover-image="{{img_url feature_image}}">
<div class="header_banner_inner">
<div class="container">
<h2 class="site_description">#{{name}}</h2>
</div>
</div>
</div>
<script>
var pagetitle = '{{name}}';
var pagecoverimg = '{{img_url feature_image}}';
</script>
{{/tag}}
<main id="site-main" class="site-main outer">
<div class="container">
<div class="post-feed">
{{#foreach posts}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
</div>
<div class="next_posts_btn">
<button>{{t "Load more"}}</button>
</div>
</div>
</main>
{{#contentFor "scripts"}}
<script>
$(document).ready(function () {
var headerCoverImage = $(".header_banner").data("header-cover-image");
if(headerCoverImage){
$('.header_banner').css('background', 'url(' + headerCoverImage + ')');
}
loadPostCardFeaturedImages();
});
var subheaderrender = false;
$(window).scroll(function() {
var height = $(window).scrollTop();
if(height > 300) {
$("body").addClass("showing_sub_header");
if(subheaderrender == false){
$(".sub_header_page_title").html("#"+pagetitle);
$(".sub_header_page_featured_image").html('<span style="background:url('+pagecoverimg+')"></span>');
subheaderrender = true;
}
} else {
$("body").removeClass("showing_sub_header");
}
});
</script>
{{/contentFor}}