-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
blog.php
129 lines (128 loc) · 3.81 KB
/
blog.php
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
<@ elements/header.php @>
<div
class="page-wrapper with-navbar with-sidebar with-transitions"
data-sidebar-type="@{ :sidebarStyle | def('overlayed-all') }"
<@ if @{ :sidebarStyle | def('overlayed-all') } = 'overlayed-all' ~@>
data-sidebar-hidden="hidden"
<@~ end @>
>
<div class="sidebar-overlay" onclick="halfmoon.toggleSidebar()"></div>
<@ elements/navbar.php @>
<@ elements/sidebar.php @>
<div class="content-wrapper overflow-x-hidden pt-10">
<div class="container py-20">
<@ elements/content.php @>
<# Paglist config #>
<@~ newPagelist {
type: 'children',
context: @{ urlContextForPagelist },
excludeCurrent: true,
filter: @{ ?filter },
match: '{"url": "#@{ filterPagelistByUrl }#"}',
sort: @{ ?sort | def (@{ sortPagelist }) | def('date desc') },
limit: @{ itemsPerPage | def(12) },
page: @{ ?page | def(1) }
} ~@>
<@ if @{ checkboxShowAllPagesInPagelist } @>
<@~ pagelist { type: false } ~@>
<@ end @>
<# Search results config #>
<@~ if @{ ?search } ~@>
<@ pagelist {
type: false,
match: false,
search: @{ ?search }
} @>
<@~ end ~@>
<# Filters #>
<section id="filters" class="am-block">
<div class="dropdown">
<button
class="btn"
data-toggle="dropdown"
type="button"
id="dropdown-filter"
aria-haspopup="true"
aria-expanded="false"
>
<@~ if @{ ?filter } ~@>
@{ ?filter }
<@~ else ~@>
@{ labelShowAll | def ('Show All') }
<@~ end ~@>
<@ Automad/Bootstrap/Icon {
icon: 'filter',
w: '1.0em',
h: '1.0em',
viewBox: '0 -2 14 16'
} @>
</button>
<div class="dropdown-menu" aria-labelledby="dropdown-filter">
<a
href="?<@ queryStringMerge { filter: false, page: 1 } @>#filters"
class="dropdown-item<@ if not @{ ?filter } @> bg-primary text-light<@ end @>"
>
@{ labelShowAll | def ('Show All') }
</a>
<@ foreach in filters @>
<a
href="?<@ queryStringMerge { filter: @{ :filter }, page: 1 } @>#filters"
class="dropdown-item<@ if @{ :filter } = @{ ?filter } @> bg-primary text-light<@ end @>"
>
@{ :filter }
</a>
<@ end @>
</div>
</div>
<@ if @{ ?search } @>
<a
href="?<@ queryStringMerge { search: false } @>#filters"
class="btn"
>
"@{ ?search }" ✗
</a>
<@ end @>
</section>
<# Pagelist #>
<@ if @{ checkboxHideThumbnails } @>
<@ blocks/pagelist/cards_text.php @>
<@ else @>
<@ blocks/pagelist/cards.php @>
<@ end @>
<# Pagination #>
<@ if @{ :paginationCount } > 1 @>
<nav class="am-block my-20">
<ul class="pagination">
<@ if @{ ?page } > 1 @>
<li class="page-item">
<a href="?<@ queryStringMerge { page: @{ ?page | -1 } } @>" class="page-link">
<@ Automad/Bootstrap/Icon { icon: 'chevron-left' } @>
</a>
</li>
<@ end @>
<@ for @{ ?page | -4 } to @{ ?page | +4 } @>
<@ if @{ :i } > 0 and @{ :i } <= @{ :paginationCount } @>
<li class="page-item<@ if @{ ?page | def(1) } = @{ :i } @> active<@ end @>">
<a
href="?<@ queryStringMerge { page: @{ :i } } @>"
class="page-link"
>@{:i}</a>
</li>
<@ end @>
<@ end @>
<@ if @{ ?page } < @{ :paginationCount } @>
<li class="page-item">
<a href="?<@ queryStringMerge { page: @{ ?page | +1 } } @>" class="page-link">
<@ Automad/Bootstrap/Icon { icon: 'chevron-right' } @>
</a>
</li>
<@ end @>
</ul>
</nav>
<@ end @>
<@ elements/footer_menu.php @>
</div>
</div>
</div>
<@ elements/footer.php @>