-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathpatterns-browser.html
More file actions
70 lines (67 loc) · 2.88 KB
/
patterns-browser.html
File metadata and controls
70 lines (67 loc) · 2.88 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
<div class="pf-c-page__sidebar">
<div class="pf-c-page__sidebar-body">
<div class="pf-l-flex filter-title-div">
<span class="pf-c-title pf-m-md filter-title pf-l-flex__item pf-m-grow">Filter by</span>
<!-- <span class="pf-l-flex__item reset-title">Reset filters</span> -->
</div>
{{ partial "menu-patterns-browser.html" . }}
</div>
</div>
<main class="pf-c-page__main">
<section class="pf-c-page__main-section">
<div class="pf-l-grid__item pf-m-9-col">
<div class="pf-u-text-align-center">
<div class="pf-c-content" style="--pf-c-content--FontSize: 1rem;">
<h1 class="pf-c-title pf-m-4xl">
{{- .Title -}}
</h1>
<div class="page-abstract">
{{ .Content }}
</div>
</div>
</div>
<div class="pf-c-content" >
{{ $patterns := where $.Pages "Type" "patterns"}}
{{ $patterns := where $patterns "BundleType" "branch"}}
<div class="pf-l-stack pf-m-gutter">
<div class="pf-l-stack__item pf-u-text-align-right pattern-count-style">
<span id="pattern-count">{{- len $patterns -}}</span> of {{ len $patterns }} patterns displayed
</div>
<div class="pf-l-stack__item">
<div class="pf-l-gallery pf-m-gutter" style="--pf-l-gallery--GridTemplateColumns--min: 300px;">
{{ range $pattern := $patterns.ByTitle }}
{{ $data := newScratch }}
{{ $data.Set "tags" slice }}
{{ $params := .Params }}
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies }}
{{ if isset $params $taxonomyname }}
{{ range $term := $pattern.Param $taxonomyname }}
{{ $taglist := $data.Get "tags" }}
{{ $taglist := $taglist | append (string (printf "%s:%s" $taxonomyname ($term | urlize) | printf "%s" )) }}
{{ $data.Set "tags" $taglist }}
{{ end }}
{{ end }}
{{ end }}
{{ $taglist := $data.Get "tags" }}
{{ $validated := .Param "tier" }}
{{ if (eq $validated "maintained" ) }}
{{ .Scratch.Set "patterntype" "type:maintained" }}
{{ else if (eq $validated "tested" ) }}
{{ .Scratch.Set "patterntype" "type:tested" }}
{{ else }}
{{ .Scratch.Set "patterntype" "type:sandbox" }}
{{ end }}
{{ $patterntype := .Scratch.Get "patterntype" }}
<div class="pf-l-gallery__item filterDiv" tag-data="{{ delimit $taglist " " }} {{ $patterntype }}" style="display: grid;">
{{ .Render "summary-with-image" }}
</div>
{{ end }}
</div>
</div>
</div>
</div>
</div>
<script src="{{ "js/filter.js" | relURL }}"></script>
</section>
{{ partial "footer.html" . }}
</main>