forked from SimonPadbury/Publii-Bootstrap-Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.hbs
More file actions
210 lines (181 loc) · 8.87 KB
/
Copy pathpost.hbs
File metadata and controls
210 lines (181 loc) · 8.87 KB
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
{{> site-head}}
<main>
{{#if @customHTML.beforePost}}
{{@customHTML.beforePost}}
{{/if}}
<div class="container my-5">
<div class="row">
<div class="sidebar col-md-4 order-md-last">
{{> site-sidebar}}
</div>
{{#post}}
<article class="post col-md">
<header>
<h1>
{{title}}
</h1>
{{#checkIfAny
@config.post.displayDate
@config.post.displayAuthor }}
<div class="mb-5">
{{#isFeatured}}
<span class="badge badge-primary">
<i class="fas fa-star"></i>
Featured Post
</span> 
{{/isFeatured}}
{{#if @config.post.displayDate}}
{{ translate 'post.publishedOn' }}
<time datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}">
{{date createdAt @config.custom.formatDate}}
</time>
{{/if}}
{{#if @config.post.displayAuthor}}
{{#if @config.post.displayDate}} / by {{else}} By {{/if}}
{{#author}}
<a href="{{url}}" rel="author" title="{{name}}">{{name}}</a>
{{/author}}
{{/if}}
{{#if tags}}
/ in 
<style>
.tag:after { content: "," }
.tag:last-of-type:after { content: "" }
</style>
{{#each tags}} <a class="tag" href="{{url}}">{{name}}</a> {{/each}}
{{/if}}
</div>
{{/checkIfAny}}
</header>
<div class="post-entry">
{{#featuredImage}}
{{#if url}}
<figure>
<img
src="{{url}}"
sizes="{{sizes.post}}"
srcset="{{srcset.post}}"
alt="{{alt}}">
{{#checkIfAny caption credits}}
<figcaption>
{{caption}}
{{credits}}
</figcaption>
{{/checkIfAny}}
</figure>
{{/if}}
{{/featuredImage}}
{{!-- The POST CONTENT text (and embedded images, etc.) --}}
{{{text}}}
</div>
{{#checkIfAny
@config.post.displayLastUpdatedDate
@config.post.displayShareButtons
@config.post.displayAuthorBio
@config.post.displayPostNavigation
@config.post.displayRelatedPosts}}
<footer class="post-meta-footer mt-5 pt-3">
<p>
{{#if @config.post.displayLastUpdatedDate}}
{{#if modifiedAt}}
{{ translate 'post.lastUpdatedDate' }}
{{date modifiedAt @config.custom.formatDate}}
{{/if}}
{{/if}}
</p>
{{> social-share-buttons}}
<div class="mt-4">
{{#if @config.post.displayAuthorBio}}
{{#author}}
<div class="media border rounded p-3">
{{#if avatar}}
<img src="{{avatar}}" alt="{{name}}" class="mr-3" style="max-height: 100px; max-width: 100px; border-radius: 50%;">
{{/if}}
<div class="media-body">
{{#if name}}
<h3>Written by {{name}}</h3>
{{/if}}
{{#if description}}
<p class="mb-2">
{{description}}
</p>
{{/if}}
<p class="m-0">
<a href="{{url}}">
{{ translate 'post.viewAuthorPosts' }} by {{name}}
</a>
</p>
</div>
</div>
{{/author}}
{{/if}}
{{#if @config.post.displayRelatedPosts}}
{{#if ../relatedPosts}}
<div class="mt-4">
<h3>
{{ translate 'post.relatedPosts' }}
</h3>
<ul>
{{#each ../relatedPosts}}
<li class="mb-3">
<h5 class="mb-0">
<a href="{{url}}">{{title}}</a>
</h5>
<time class="small" datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}">
{{date createdAt @config.custom.formatDate}}
</time>
</li>
{{/each}}
</ul>
</div>
{{/if}}
{{/if}}
</div>
{{#if @config.post.displayPostNavigation}}
{{#checkIfAny ../previousPost ../nextPost}}
<nav class="row mt-5">
{{#../previousPost}}
<div class="col-sm-6 post-prev">
<a href="{{url}}" class="btn btn-light btn-block post-nav-link" rel="prev">
<div class="row">
<i class="col-auto text-left far fa-chevron-left fa-3x"></i>
<div class="col text-left">
{{ translate 'post.previousPost' }}
<h5 class="mb-0">
{{title}}
</h5>
</div>
</div>
</a>
</div>
{{/../previousPost}}
{{#../nextPost}}
<div class="col-sm-6 post-next">
<a href="{{url}}" class="btn btn-light btn-block post-nav-link" rel="next">
<div class="row">
<i class="col-auto order-last text-right far fa-chevron-right fa-3x"></i>
<div class="col order-first text-right">
{{ translate 'post.nextPost' }}
<h5 class="mb-0">
{{title}}
</h5>
</div>
</div>
</a>
</div>
{{/../nextPost}}
</nav>
{{/checkIfAny}}
{{/if}}
</footer>
{{/checkIfAny}}
{{!-- Disqus --}}
</article>
{{/post}}
</div>
</div>
{{#if @customHTML.afterPost}}
{{@customHTML.afterPost}}
{{/if}}
</main>
{{> site-footer}}