-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathpost.hbs
96 lines (93 loc) · 4.75 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
{{!< default}}
{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}}
{{!-- The main content area on the single post --}}
<main class="main">
{{!-- Everything inside the #post tags pulls data from the page --}}
{{#post}}
<article class="{{post_class}}">
<header class="post-header">
<div class="post-meta">
{{#if featured}}
<span class="post-featured-badge">{{t "Featured"}}</span>
{{/if}}
<time datetime="{{date format='YYYY-MM-DD'}}">{{date format="DD MMMM YYYY"}}</time>
</div>
<h1 class="post-title">{{title}}</h1>
<div class="post-byline">
{{authors separator=", " prefix=(t "Posted by ")}}
{{tags separator=", " prefix=(t "in ")}}
</div>
{{#if feature_image}}
<figure class="post-image">
<img
srcset="{{img_url feature_image size="s" format="webp"}} 400w,
{{img_url feature_image size="m" format="webp"}} 600w,
{{img_url feature_image size="l" format="webp"}} 800w,
{{img_url feature_image size="xl" format="webp"}} 1200w"
sizes="(min-width: 850px) 760px, 100vw"
src="{{img_url feature_image size="l" format="webp"}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{/if}}"
/>
{{#if feature_image_caption}}
<figcaption>{{feature_image_caption}}</figcaption>
{{/if}}
</figure>
{{/if}}
</header>
{{!-- If the user has access, show post content, authors, comments --}}
{{#if access}}
<div class="post-content">
{{content}}
</div>
<div class="post-share">
<span class="post-share-title">{{t "Share this post:"}}</span>
<a target="_blank" href="https://twitter.com/intent/tweet?text={{encode title}}&url={{url absolute="true"}}" rel="noopener">X</a>
<a target="_blank" href="https://www.facebook.com/sharer.php?u={{url absolute="true"}}" rel="noopener">Facebook</a>
<a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url={{url absolute="true"}}&title={{encode title}}&source={{encode @site.title}}" rel="noopener">LinkedIn</a>
</div>
<div class="author-box">
{{#foreach authors}}
<div class="author-profile">
{{#if profile_image}}
<div class="author-image">
<img src="{{img_url profile_image size="xs" format="webp"}}" alt="{{name}}" />
</div>
{{/if}}
<div class="author-details">
<h2 class="author-title">{{t "About"}} <a href="{{url}}">{{name}}</a></h2>
{{#if bio}}
<p class="author-bio">{{bio}}</p>
{{/if}}
<div class="author-links">
{{#if location}}
<span>{{location}}</span>
{{/if}}
{{#if website}}
<a href="{{website}}" target="_blank" rel="noopener">{{website}}</a>
{{/if}}
{{#if facebook}}
<a href="{{facebook_url}}" target="_blank" rel="noopener" aria-label="Facebook">{{> "icons/facebook"}}</a>
{{/if}}
{{#if twitter}}
<a href="{{twitter_url}}" target="_blank" rel="noopener" aria-label="X">{{> "icons/x"}}</a>
{{/if}}
</div>
</div>
</div>
{{/foreach}}
</div>
{{!-- If Disqus enabled, includes the Disqus comments - partials/comments-disqus.hbs --}}
{{#if @custom.enable_disqus}}
{{#if @custom.disqus_shortname}}
{{> "comments-disqus"}}
{{/if}}
{{!-- If Disqus not enabled and Ghost comments enabled, include ghost comments - partials/comments.hbs --}}
{{else}}
{{#if comments}}
{{> comments}}
{{/if}}
{{/if}}
{{/if}}
</article>
{{/post}}
</main>