-
Notifications
You must be signed in to change notification settings - Fork 22
/
author.hbs
executable file
·156 lines (135 loc) · 5.03 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
152
153
154
155
156
{{! Author page; this file renders a tag page containing a list of the latest posts }}
{{> head}}
{{> navbar}}
<main>
{{! indicates the author's context }}
{{#author}}
{{! author featured image }}
{{#featuredImage}}
{{! checks if an image exists }}
{{#if url}}
<figure>
<img
src="{{url}}"
{{! checks if the Responsive Images option (located in Site Settings -> Website Speed) is enabled }}
{{#if @config.site.responsiveImages}}
{{responsiveImageAttributes 'authorImage' srcset sizes}}
{{/if}}
{{! generates a native loading attribute; if the Media Lazy Load option (located in Site Settings -> Website Speed) is disabled, the loading attribute is not generated }}
{{lazyload "lazy"}}
height="{{height}}"
width="{{width}}"
alt="{{alt}}">
{{! checks if a caption and credits exist }}
{{#checkIfAny caption credits}}
<figcaption>
{{caption}}
{{credits}}
</figcaption>
{{/checkIfAny}}
{{! /checks if a caption and credits exist }}
</figure>
{{/if}}
{{! /checks if an image exists }}
{{/featuredImage}}
{{! /author featured image }}
{{! check if an author avatar exists }}
{{#if avatar}}
<img
src="{{avatarImage.url}}"
{{ lazyload "eager" }}
alt="{{avatarImage.alt}}"
height="{{avatarImage.height}}"
width="{{avatarImage.width}}">
{{/if}}
{{! /check if an author avatar exists }}
<h1>
{{name}}
{{! check if a 'Display post counter' author option is enabled }}
{{#if authorViewConfig.displayPostCounter}}
<sup>({{postsNumber}})</sup>
{{/if}}
{{! /check if a 'Display post counter' author option is enabled }}
</h1>
{{! check if an author description exists }}
{{#if description}}
<div> {{{description}}} </div>
{{/if}}
{{! /check if a author description exists }}
{{! check if an author email address exists }}
{{#if email}}
<p>{{email}}</p>
{{/if}}
{{! /check if a author email address exists }}
{{! check if an author website URL exists }}
{{#if website}}
<p>{{website}}</p>
{{/if}}
{{! /check if a author website URL exists }}
{{/author}}
{{! /indicates the author's context }}
{{! loop that generates a list of posts }}
{{#each posts}}
<article>
{{! featured image }}
{{#featuredImage}}
{{! checks if an image exists }}
{{#if url}}
<img
src="{{url}}"
{{! checks if the Responsive Images option (located in Site Settings -> Website Speed) is enabled }}
{{#if @config.site.responsiveImages}}
{{responsiveImageAttributes 'featuredImage' srcset sizes}}
{{/if}}
{{! generates a native loading attribute; if the Media Lazy Load option (located in Site Settings -> Website Speed) is disabled, the loading attribute is not generated }}
{{lazyload "lazy"}}
height="{{height}}"
width="{{width}}"
alt="{{alt}}">
{{/if}}
{{! /checks if an image exists }}
{{/featuredImage}}
{{! /featured image }}
{{! post title }}
<h2>
<a href="{{url}}">{{title}}</a>
</h2>
{{! /post title }}
{{! post creation date }}
<time datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}">
{{date createdAt}}
</time>
{{! /post creation date }}
{{! post author }}
{{#author}}
<img
src="{{avatarImage.url}}"
{{lazyload "lazy"}}
alt="{{avatarImage.alt}}"
height="{{avatarImage.height}}"
width="{{avatarImage.width}}">
<a href="{{url}}">{{name}}</a>
{{/author}}
{{! /post author }}
{{! main tag - if not selected, the first tag in the list of all tags
will be displayed }}
{{#if mainTag}}
<a href="{{mainTag.url}}">{{mainTag.name}}</a>
{{/if}}
{{! /main tag }}
{{! post excerpt - the Custom excerpt is generated when the Read More button is used when editing a post }}
{{#if hasCustomExcerpt}}
{{{ excerpt }}}
{{else}}
<p>{{{ excerpt }}}</p>
{{/if}}
{{! /post excerpt }}
</article>
{{/each}}
{{! /loop that generates a list of posts }}
</main>
<aside>
{{> sidebar}}
</aside>
{{> pagination}}
{{> footer}}