-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpost.hbs
99 lines (95 loc) · 3.54 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{{!< default}}
{{#post}}
<div class="post-wrapper">
<main id="site-main">
<article class="post {{post_class}}">
<header class="post-header">
<div class="post-header-details">
{{!-- Post Primary Tag --}}
{{#primary_tag}}
<a href="{{url}}" style="color:{{accent_color}};"
class="post-primary-tag">
{{name}}
</a>
{{/primary_tag}}
{{!-- Post Title --}}
<h1 class="post-title">{{title}}</h1>
{{!-- Post Summary --}}
{{#if custom_excerpt}}
<p class="post-excerpt">{{custom_excerpt}}</p>
{{/if}}
{{!-- Post Metadata --}}
<div class="post-meta">
{{#primary_author}}
<div class="post-meta-author-avatar">
{{#if profile_image}}
<img class="post-meta-author-img" src="{{img_url profile_image}}" alt="{{name}}" />
{{else}}
<i class="fa-sharp fa-solid fa-user-pen"></i>
{{/if}}
</div>
{{/primary_author}}
<div class="post-published-meta">
{{#primary_author}}
<a href="{{url}}" class="post-meta-author-name">{{name}}</a>
{{/primary_author}}
<div class="post-published-time-meta">
<time datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time>
<span class="post-meta-separator"> • </span>
{{#if reading_time}}
<span class="reading-time">{{reading_time}}</span>
{{/if}}
</div>
</div>
</div>
{{!-- Post Image --}}
{{#if feature_image}}
<div class="post-image">
<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}}
</div>
{{/if}}
{{!-- Post Series TOC --}}
{{> "series/toc" }}
</div>
</header>
<section class="post-content">
{{content}}
</section>
{{> "post/post-tags"}}
{{!--
This is currently not possible with Ghost's dynamic routing. See discussion:
https://forum.ghost.org/t/dynamic-routing-for-next-previous-post-helper/9279
{{> "series/nextprev" }}
--}}
{{> "post/author-info"}}
</article>
</main>
</div>
{{!-- Post Footer --}}
<div class="post-after">
<div class="post-after-wrapper">
{{> "post/post-comments"}}
{{> "post/support" }}
{{!-- The {#get} helper below fetches some of the latest posts here
so that people have something else to read when they finish this one.
This query gets the latest 3 posts on the site, but adds a filter to
exclude the post we're currently on from being included. --}}
{{#get "posts" filter="id:-{{id}}" limit="3" as |more_posts|}}
{{#if more_posts}}
<section class="related-posts">
<h4 class="related-posts-header">Related Posts</h4>
<div class="related-posts-wrapper">
{{#foreach more_posts}}
{{> "post-card"}}
{{/foreach}}
</div>
</section>
{{/if}}
{{/get}}
</div>
</div>
{{/post}}