forked from TryGhost/London
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.hbs
78 lines (68 loc) · 2.46 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
{{!< default}}
{{#post}}
<article class="post-content {{post_class}} {{#unless feature_image}}no-image{{/unless}}">
{{#has tag="podcast"}}
{{> player is_external=false }}
{{else}}
{{> post-header single=true number_date=true primary=tags.[1] tags=false reading_time=true}}
{{#if custom_excerpt}}
<p class="post-excerpt">{{custom_excerpt}}</p>
{{/if}}
{{#if feature_image}}
<figure class="post-image">
<img class="kg-image" src="{{feature_image}}" alt="{{title}}" />
{{#if feature_image_caption}}
<figcaption>{{feature_image_caption}}</figcaption>
{{/if}}
</figure>
{{/if}}
{{/has}}
<div class="post-body gh-content">
{{content}}
</div>
<footer class="post-footer">
{{#has tag="podcast"}}
{{#if @member.paid}}
{{> share podcast=true }}
{{else}}
{{> share }}
{{/if}}
{{else}}
{{> share }}
{{/has}}
</footer>
{{> post-navigation}}
<section class="post-comments">
{{> "comments" }}
</section>
</article>
{{/post}}
{{> related }}
{{!-- 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}}
{{!-- The #contentFor helper here will send everything inside it up to the matching #block helper found in default.hbs --}}
{{#contentFor "scripts"}}
{{#if @member.paid}}
{{#post}}
{{#has tag="podcast"}}
<script src="{{asset 'built/player.js'}}"></script>
{{/has}}
{{/post}}
{{/if}}
<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}}