-
Notifications
You must be signed in to change notification settings - Fork 0
/
author.hbs
executable file
·151 lines (149 loc) · 6.17 KB
/
author.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
{{> head}}
{{> top}}
<main>
{{#author}}
<div class="hero author">
{{#featuredImage}}
{{#if url}}
<figure class="hero__image hero__image--overlay">
<img
src="{{url}}"
{{#if @config.site.responsiveImages}}
{{responsiveImageAttributes 'authorImage' srcset sizes}}
{{/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" }}
{{imageDimensions @config.custom.uploadHero}}
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 avatar}}
<img
src="{{avatarImage.url}}"
{{ lazyload "lazy" }}
height="{{avatarImage.height}}"
width="{{avatarImage.width}}"
class="author__avatar"
alt="{{avatarImage.alt}}">
{{/if}}
<h1>
{{name}}
<sup>({{postsNumber}})</sup>
</h1>
{{#if description}}
<p>{{description}}</p>
{{/if}}
{{#if website}}
<p class="post__meta post__meta--author author__website">
<svg height="24" width="24" stroke="currentColor" stroke-width="2" aria-hidden="true">
<use xlink:href="{{@website.assetsUrl}}/svg/svg-map.svg#website"/>
</svg>
<a href="{{website}}" target="_blank" rel="nofollow noreferrer noopener">{{ translate 'author.visitWebsite' }}</a>
</p>
{{/if}}
</div>
</header>
</div>
{{/author}}
<div class="feed">
{{#each posts}}
<article class="feed__item">
<header class="wrapper">
{{#checkIfAny @config.custom.authorAvatar @config.custom.authorAuthor @config.custom.authorDate}}
<div class="feed__meta">
{{#author}}
{{#if @config.custom.authorAvatar}}
{{#if avatar}}
<img
src="{{avatarImage.url}}"
{{ lazyload "lazy" }}
height="{{avatarImage.height}}"
width="{{avatarImage.width}}"
class="post__author-thumb"
alt="{{avatarImage.alt}}">
{{/if}}
{{/if}}
{{#if @config.custom.authorAuthor}}
<a href="{{url}}" class="feed__author">{{name}}</a>
{{/if}}
{{/author}}
{{#if @config.custom.authorDate}}
<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>
{{/if}}
</div>
{{/checkIfAny}}
<h2>
<a href="{{url}}">
{{title}}
</a>
</h2>
</header>
{{#if @config.custom.authorFeaturedImage}}
{{#featuredImage}}
{{#if url}}
<div class="feed__image">
<a href="{{../url}}">
<img
src="{{url}}"
{{#if @config.site.responsiveImages}}
{{responsiveImageAttributes 'featuredImage' srcset.post sizes.post}}
{{/if}}
{{ lazyload "lazy" }}
height="{{height}}"
width="{{width}}"
alt="{{alt}}">
</a>
</div>
{{/if}}
{{/featuredImage}}
{{/if}}
<div class="wrapper">
{{#if hasCustomExcerpt}}
{{{ excerpt }}}
{{else}}
<p>{{{ excerpt }}}</p>
{{/if}}
{{#if @config.custom.authorReadMore}}
<a href="{{url}}" class="readmore feed__readmore">
{{ translate 'post.readMore' }}</a>
{{/if}}
</div>
</article>
{{/each}}
{{> pagination}}
</div>
</main>
{{> footer}}