-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.hbs
executable file
·234 lines (215 loc) · 9.25 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
{{> head}}
{{> top}}
<main>
{{#post}}
<article class="post">
<div class="hero">
{{#featuredImage}}
{{#if url}}
<figure class="hero__image hero__image--overlay">
<img
src="{{url}}"
{{#if @config.site.responsiveImages}}
{{responsiveImageAttributes 'featuredImage' srcset.post sizes.post}}
{{/if}}
{{ lazyload "eager" }}
height="{{height}}"
width="{{width}}"
alt="{{alt}}">
{{#checkIfAny caption credits}}
<figcaption>
{{caption}}
{{credits}}
</figcaption>
{{/checkIfAny}}
</figure>
{{else}}
{{#checkIfAll @config.custom.uploadHero @config.custom.displayHeroImage}}
<figure class="hero__image hero__image--overlay">
<img
src="{{@config.custom.uploadHero}}"
{{#if @config.site.responsiveImages}}
{{responsiveImageAttributes @config.custom.uploadHero}}
{{/if}}
{{ lazyload "eager" }}
alt="{{@config.custom.uploadHeroAlt}}">
{{#if @config.custom.uploadHeroCaption}}
<figcaption>
{{@config.custom.uploadHeroCaption}}
</figcaption>
{{/if}}
</figure>
{{/checkIfAll}}
{{/if}}
{{/featuredImage}}
<header class="hero__content">
<div class="wrapper">
{{#if @config.post.displayDate}}
<div class="post__meta">
<time datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}">
{{#checkIf @config.custom.formatDate '!=' 'custom'}}
{{date createdAt @config.custom.formatDate}}
{{else}}
{{date createdAt @config.custom.formatDateCustom}}
{{/checkIf}}
</time>
</div>
{{/if}}
<h1>
{{title}}
</h1>
{{#if @config.post.displayAuthor}}
<div class="post__meta post__meta--author">
{{#author}}
{{#if avatar}}
<img
src="{{avatarImage.url}}"
{{ lazyload "eager" }}
height="{{avatarImage.height}}"
width="{{avatarImage.width}}"
class="post__author-thumb"
alt="{{avatarImage.alt}}">
{{/if}}
<a href="{{url}}" class="feed__author">{{name}}</a>
{{/author}}
</div>
{{/if}}
</div>
</header>
</div>
<div class="wrapper post__entry">
{{{text}}}
</div>
{{#checkIfAny @config.post.displayLastUpdatedDate @config.post.displayTags @config.post.displayShareButtons @config.post.displayAuthorBio}}
<footer class="wrapper post__footer">
{{#if @config.post.displayLastUpdatedDate}}
{{#if modifiedAt}}
<p class="post__last-updated">
{{ translate 'post.lastUpdatedDate' }}
{{#checkIf @config.custom.formatDate '!=' 'custom'}}
{{date modifiedAt @config.custom.formatDate}}
{{else}}
{{date modifiedAt @config.custom.formatDateCustom}}
{{/checkIf}}
</p>
{{/if}}
{{/if}}
{{#if @config.post.displayTags}}
{{#if tags}}
<ul class="post__tag">
{{#each tags}}
<li>
<a href="{{url}}">{{name}}</a>
</li>
{{/each}}
</ul>
{{/if}}
{{/if}}
{{#if @config.post.displayShareButtons}}
<div class="post__share">
{{> share-buttons}}
</div>
{{/if}}
{{#if @config.post.displayAuthorBio}}
<div class="post__bio bio">
{{#author}}
{{#if avatar}}
<img
src="{{avatarImage.url}}"
{{ lazyload "lazy" }}
height="{{avatarImage.height}}"
width="{{avatarImage.width}}"
class="bio__avatar"
alt="{{avatarImage.alt}}">
{{/if}}
<div class="bio__info">
<h3 class="bio__name">
<a href="{{url}}" rel="author">{{name}}</a>
</h3>
{{#if description}}
<p>{{description}}
</p>
{{/if}}
</div>
{{/author}}
</div>
{{/if}}
</footer>
{{/checkIfAny}}
</article>
{{#if @config.post.displayPostNavigation}}
{{#checkIfAny ../previousPost ../nextPost}}
<nav class="post__nav">
<div class="post__nav-inner">
{{#../previousPost}}
<div class="post__nav-prev">
<svg width="1.041em" height="0.416em" aria-hidden="true">
<use xlink:href="{{@website.assetsUrl}}/svg/svg-map.svg#arrow-prev"/>
</svg>
<a href="{{url}}" class="post__nav-link" rel="prev">
<span>{{ translate 'post.previousPost' }}</span>
{{title}}
</a>
</div>
{{/../previousPost}}
{{#../nextPost}}
<div class="post__nav-next">
<a href="{{url}}" class="post__nav-link" rel="next">
<span>{{ translate 'post.nextPost' }}</span>
{{title}}
</a>
<svg width="1.041em" height="0.416em" aria-hidden="true">
<use xlink:href="{{@website.assetsUrl}}/svg/svg-map.svg#arrow-next"/>
</svg>
</div>
{{/../nextPost}}
</div>
</nav>
{{/checkIfAny}}
{{/if}}
{{#if @config.post.displayRelatedPosts}}
{{#if ../relatedPosts}}
<div class="post__related related">
<div class="wrapper">
<h2 class="h5 related__title">
{{ translate 'post.relatedPosts' }}
</h2>
{{#each ../relatedPosts}}
<article class="related__item">
<div class="feed__meta">
<time datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}" class="feed__date">
{{#checkIf @config.custom.formatDate '!=' 'custom'}}
{{date createdAt @config.custom.formatDate}}
{{else}}
{{date createdAt @config.custom.formatDateCustom}}
{{/checkIf}}
</time>
</div>
<h3 class="h1">
<a href="{{url}}">
{{title}}
</a>
</h3>
</article>
{{/each}}
</div>
</div>
{{/if}}
{{/if}}
{{#if @config.post.displayComments}}
<div class="post__comments">
<div class="wrapper">
{{{@commentsCustomCode}}}
</div>
</div>
{{/if}}
{{#if @customHTML.afterPost}}
<div class="banner banner--after-post">
<div class="wrapper">
{{{@customHTML.afterPost}}}
</div>
</div>
{{/if}}
{{/post}}
</main>
{{> footer}}