-
-
Notifications
You must be signed in to change notification settings - Fork 146
/
post.hbs
80 lines (69 loc) · 2.45 KB
/
post.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{{!< default}}
{{!-- The tag above means: insert everything in this file
into the {body} of the default.hbs template --}}
{{#post}}
{{!-- Everything inside the #post tags pulls data from the post --}}
<section>
<header class="main content">
<span class="date">{{date format="MMMM D, YYYY"}}</span>
<h1>{{title}}</h1>
{{#if custom_excerpt}}
<p class="content">{{custom_excerpt}}</p>
{{/if}}
</header>
{{#if feature_image}}
<figure class="image main">
<img src="{{img_url feature_image}}" alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}" />
{{#if feature_image_caption}}
<figcaption>{{feature_image_caption}}</figcaption>
{{/if}}
</figure>
{{/if}}
<div class="content">
{{content}}
</div>
{{!-- Email subscribe form at the bottom of the page --}}
{{#if @labs.subscribers}}
<section class="subscribe-form">
<h3 class="subscribe-form-title">Subscribe to {{@site.title}}</h3>
<p>Get the latest posts delivered right to your inbox</p>
{{subscribe_form placeholder="youremail@example.com"}}
</section>
{{/if}}
<footer class="post-footer">
<div class="authors">
{{#foreach authors}}
<a class="author-box" href="{{url}}">
{{#if profile_image}}
<img class="author-profile-image" src="{{profile_image}}" alt="{{name}}" />
{{/if}}
<section class="author-box-content">
<div class="author-box-label">Author</div>
<h5 class="author-box-name">{{name}}</h5>
{{#if bio}}
<p>{{bio}}</p>
{{else}}
<p>Read more posts by this author.</p>
{{/if}}
</section>
</a>
{{/foreach}}
</div>
</footer>
{{!--
<section class="post-full-comments">
If you want to embed comments, this is a good place to do it!
</section>
--}}
</section>
{{/post}}
<script>
var images = document.querySelectorAll('.kg-gallery-image img');
images.forEach(function (image) {
var container = image.closest('.kg-gallery-image');
var width = image.attributes.width.value;
var height = image.attributes.height.value;
var ratio = width / height;
container.style.flex = ratio + ' 1 0%';
})
</script>