-
Notifications
You must be signed in to change notification settings - Fork 22
/
tag.hbs
executable file
·132 lines (115 loc) · 4.43 KB
/
tag.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
{{! Tag page; this file renders a tag page containing a list of the latest posts }}
{{> head}}
{{> navbar}}
<main>
{{! indicates the tag's context}}
{{#tag}}
{{! tag 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 'tagImage' 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}}
{{! /tag featured image }}
<h1>
{{name}}
{{! check if a 'Display post counter' tag option is enabled }}
{{#if tagViewConfig.displayPostCounter}}
<sup>({{postsNumber}})</sup>
{{/if}}
{{! /check if a 'Display post counter' tag option is enabled }}
</h1>
{{! check if a tag description exists }}
{{#if description}}
<div> {{{description}}} </div>
{{/if}}
{{! /check if a tag description exists }}
{{/tag}}
{{! /indicates the tag'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}}