forked from TryGhost/London
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.hbs
47 lines (38 loc) · 1.28 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
{{!< 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>
{{> "post-related-articles"}}
{{!--
<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}}