forked from TryGhost/Casper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtag.hbs
More file actions
74 lines (66 loc) · 2.99 KB
/
tag.hbs
File metadata and controls
74 lines (66 loc) · 2.99 KB
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
{{!< default}}
{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}}
<main id="site-main" class="site-main outer">
<div class="inner posts">
<div class="post-feed">
{{#tag}}
<section class="post-card post-card-large">
{{#if feature_image}}
<div class="post-card-image-link">
{{!-- This is a responsive image, it loads different sizes depending on device
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
<img class="post-card-image"
srcset="{{img_url feature_image size="s"}} 300w,
{{img_url feature_image size="m"}} 600w,
{{img_url feature_image size="l"}} 1000w,
{{img_url feature_image size="xl"}} 2000w"
sizes="(max-width: 1000px) 400px, 800px"
src="{{img_url feature_image size="m"}}"
alt="{{title}}"
/>
</div>
{{/if}}
<div class="post-card-content">
<div class="post-card-content-link">
<header class="post-card-header">
<h2 class="post-card-title">{{name}}</h2>
</header>
<div class="post-card-excerpt">
{{#if description}}
{{description}}
{{else}}
A collection of {{plural ../pagination.total empty='zero posts' singular='% post' plural='% posts'}}
{{/if}}
</div>
</div>
</div>
</section>
{{/tag}}
{{#if @custom.tease_inaccessible_content}}
{{#get "posts" filter="tags:{{tag.slug}}" page=pagination.page limit=@config.posts_per_page include="tags"}}
{{> "post-loop"}}
</div>
{{pagination}}
{{/get}}
{{else if @member.paid}}
{{#get "posts" filter="tags:{{tag.slug}}+visibility:[paid, members, public]" page=pagination.page limit=@config.posts_per_page include="tags"}}
{{> "post-loop"}}
</div>
{{pagination}}
{{/get}}
{{else if @member}}
{{#get "posts" filter="tags:{{tag.slug}}+visibility:[members, public]" page=pagination.page limit=@config.posts_per_page include="tags"}}
{{> "post-loop"}}
</div>
{{pagination}}
{{/get}}
{{else}}
{{#get "posts" filter="tags:{{tag.slug}}+visibility:public" page=pagination.page limit=@config.posts_per_page include="tags"}}
{{> "post-loop"}}
</div>
{{pagination}}
{{/get}}
{{/if}}
{{!-- The closing div is inside each get helper because pagination must also be for the proper context. --}}
</div>
</main>