-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathcategory-posts.html
More file actions
43 lines (42 loc) · 1.58 KB
/
category-posts.html
File metadata and controls
43 lines (42 loc) · 1.58 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
<div class="pl-sm-4 ml-sm-5 pt-2">
<div class="row">
<div class="col-12">
{{ $recent := 7 }}
{{ if isset .Site.Params "recent_posts" }}
{{ $recent = .Site.Params.recent_posts }}
{{ end }}
{{ if gt $recent 0 }}
<div class="pb-3">
<h5><span class="badge category">Recent</span></h5>
<ul class="list-unstyled">
{{ range first $recent (where .Site.RegularPages "Type" "in" site.Params.mainSections) }}
<li>
{{ .Date.Format "Jan 2 2006" }}
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if or (not (isset .Site.Params "category_list")) (.Site.Params.category_list) }}
{{ range $key, $taxonomy := .Site.Taxonomies.categories.Alphabetical }}
<div class="pb-3">
<h5>
<span class="badge category text-capitalize">
{{ .Name | humanize }}
</span>
</h5>
<ul class="list-unstyled">
{{ range $taxonomy.Pages }}
<li>
{{ .Date.Format "Jan 2 2006" }}
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ end }}
</div>
</div>
</div>