/
list.hbs
75 lines (70 loc) · 2.94 KB
/
list.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
{{!--
Parameters:
* layout (grid, magazine)
* count (number)
* columns (number)
* slug (tag)
* showHeader (true, false)
* showPrimaryTag (true, false)
* showPrimaryAuthor (true, false)
* showExcerpt (true, false)
* showPublishedAt (true, false)
* showReadingTime (true, false)
* hasPagination (true, false)
--}}
<div class="gh-list{{#match layout "magazine"}} grid magazine{{else match layout "grid"}} grid{{else match layout "simple"}} simple{{/match}} gh-outer" data-column="{{column}}">
<div class="gh-list-inner gh-inner">
{{#if showHeader}}
{{#if slug}}
{{#get "tags" filter="slug:{{slug}}"}}
{{#foreach tags}}
<header class="gh-list-header">
<a href="{{url}}"><h2 class="gh-list-title">{{name}}</h2></a>
<a class="gh-list-action" href="{{url}}">View all →</a>
</header>
{{/foreach}}
{{/get}}
{{else}}
<header class="gh-list-header">
<a href="{{url}}"><h2 class="gh-list-title">Latest</h2></a>
<a class="gh-list-action" href="{{url}}">View all →</a>
</header>
{{/if}}
{{/if}}
{{#if hasPagination}}
<div class="gh-list-feed gh-feed">
{{#foreach posts}}
{{> components/list-item
showPrimaryTag=../showPrimaryTag
showExcerpt=../showExcerpt
showPrimaryAuthor=../showPrimaryAuthor
showPublishedAt=../showPublishedAt}}
{{/foreach}}
</div>
{{else}}
<div class="gh-list-feed">
{{#if slug}}
{{#get "posts" include="tags,authors" filter="tag:{{slug}}" limit=count}}
{{#foreach posts}}
{{> components/list-item
showPrimaryTag=../../showPrimaryTag
showExcerpt=../../showExcerpt
showPrimaryAuthor=../../showPrimaryAuthor
showPublishedAt=../../showPublishedAt}}
{{/foreach}}
{{/get}}
{{else}}
{{#get "posts" include="tags,authors" limit=count}}
{{#foreach posts}}
{{> components/list-item
showPrimaryTag=../../showPrimaryTag
showExcerpt=../../showExcerpt
showPrimaryAuthor=../../showPrimaryAuthor
showPublishedAt=../../showPublishedAt}}
{{/foreach}}
{{/get}}
{{/if}}
</div>
{{/if}}
</div>
</div>