forked from TryGhost/London
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.hbs
64 lines (51 loc) · 1.9 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
{{!< default}}
{{#post}}
<article class="post-content {{post_class}} {{#unless feature_image}}no-image{{/unless}}">
<header class="post-content-header">
<h1 class="post-content-title">{{title}}</h1>
</header>
{{#if custom_excerpt}}
<p class="post-content-excerpt">{{custom_excerpt}}</p>
{{/if}}
{{#if feature_image}}
<div class="post-content-image">
<img class="kg-image" src="{{feature_image}}" alt="{{title}}" />
</div>
{{/if}}
<div class="post-content-body">
{{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="[email protected]"}}
</section>
{{/if}}
<footer class="post-content-footer">
{{!-- 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. --}}
</footer>
{{!--
<section class="post-content-comments">
If you want to embed comments, this is a good place to do it!
</section>
--}}
</article>
{{/post}}
{{!-- The #contentFor helper here will send everything inside it up to the matching #block helper found in default.hbs --}}
{{#contentFor "scripts"}}
<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>
{{/contentFor}}