-
Notifications
You must be signed in to change notification settings - Fork 1
/
tag.hbs
90 lines (90 loc) · 4.35 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
{{> head}}
{{> navbar}}
<main class="page page--tag">
<div class="wrapper">
{{#tag}}
<div class="hero">
<h1>
{{name}}
{{#if tagViewConfig.displayPostCounter}}<sup>({{postsNumber}})</sup>{{/if}}
</h1>
{{#if tagViewConfig.displayDescription}}
{{{description}}}
{{/if}}
</div>
{{#if tagViewConfig.displayPostList}}
<div class="{{#checkIf @config.custom.layoutTags '==' "grid"}}l-grid {{@config.custom.layoutTagsGrid}} {{else}}l-masonry {{@config.custom.layoutTagsMasonry}}{{/checkIf}}">
{{#each ../posts}}
<article class="c-card {{@config.custom.cardsLayout}}{{#isFeatured}} c-card--featured{{/isFeatured}}">
{{#if @config.custom.cardsImage}}
{{#featuredImage}}
{{#if url}}
<a href="{{../url}}" class="c-card__image">
<img
src="{{url}}"
{{#if @config.site.responsiveImages}}
{{responsiveImageAttributes 'featuredImage' srcset sizes}}
{{/if}}
{{ lazyload "lazy" }}
height="{{height}}"
width="{{width}}"
alt="{{alt}}">
</a>
{{/if}}
{{/featuredImage}}
{{/if}}
<div class="c-card__wrapper">
<header class="c-card__header">
{{#if @config.custom.cardsTag}}
{{#if mainTag}}
<div class="c-card__tag">
<a href="{{ mainTag.url }}">{{ mainTag.name }}</a>
</div>
{{/if}}
{{/if}}
<h2 class="c-card__title">
<a href="{{url}}" class="invert">
{{title}}
</a>
</h2>
</header>
{{#if @config.custom.cardsExcerpt}}
{{#if hasCustomExcerpt}}
<div class="c-card__text">{{{ excerpt }}}</div>
{{else}}
<p class="c-card__text">{{{ excerpt }}}</p>
{{/if}}
{{/if}}
{{#checkIfAny @config.custom.cardsDate @config.custom.cardsComments}}
<footer class="c-card__meta">
{{#if @config.custom.cardsDate}}
<time datetime="{{date createdAt 'YYYY-MM-DDTHH:mm'}}">
{{#checkIf @config.custom.formatDate '!=' 'custom'}}
{{date createdAt @config.custom.formatDate}}
{{else}}
{{date createdAt @config.custom.formatDateCustom}}
{{/checkIf}}
</time>
{{/if}}
{{#if @config.custom.cardsComments}}
<div class="c-card__comments">
<a href="{{url}}#comments" rel="nofollow" aria-label="{{ translate 'common.comments' }}">
<svg aria-hidden="true">
<title>{{ translate 'common.comments' }}</title>
<use xlink:href="{{@website.assetsUrl}}/svg/svg-map.svg#comments"/>
</svg>
</a>
</div>
{{/if}}
</footer>
{{/checkIfAny}}
</div>
</article>
{{/each}}
</div>
{{> pagination}}
{{/if}}
{{/tag}}
</div>
</main>
{{> footer}}