- Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathresources.html
111 lines (94 loc) · 3.37 KB
/
resources.html
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
---
title: Resources
description: Current and Upcoming NCCS Projects, Publications, and Tools
layout: default
permalink: /resources/
activeLink: /resources/
---
{% include components/page-header.html
header = page.title
description = page.description
%}
<divclass="feature flow flow-4">
{% include components/divider.html
header = "Featured"
%}
{% assign featured_posts = site.resources | where: "featured", "true" | sort: "featuredOrder" | limit: "5" %}
{% include components/content-feature.html
entries = featured_posts
%}
</div>
{% comment %}
FILTERS
Because of the work needed to set up, the filters cannot be fully componentized
{% endcomment %}
<divdata-module="filter" class="flow flow-4 full grid-content">
{% comment %}
Build array of categories and types, whitespace matters in captures!
{% endcomment %}
{% for post in site.resources %}
{% for category in post.categories %}
{% capture all_categories %}{% if all_categories %}{{ all_categories }},{{ category }}{% else %}{{ category }}{% endif %}{% endcapture %}
{% endfor %}
{% for type in post.type %}
{% capture all_types %}{% if all_types %}{{ all_types }},{{ type }}{% else %}{{ type }}{% endif %}{% endcapture %}
{% endfor %}
{% endfor %}
{% assign all_categories = all_categories | split: "," | uniq %}
{% assign all_types = all_types | split: "," | uniq %}
{% include components/filter-controls.html
header = "Search All Resources"
categoryTitle = "Category"
categories = all_categories
typeTitle = "Type"
types = all_types
style = "light"
%}
<divclass="feature flow flow-4">
{% include components/divider.html
header = "Projects"
%}
{% assign projects = site.resources | where: "type", "project" | reverse %}
<divclass="grid-cols-3 gap-lg mt-2" data-filter-entry-section>
{% for post in projects %}
{% assign url = post.url | relative_url %}
{% assign iconIndex = forloop.index | modulo: 3 %}
{% include components/card-vertical.html
header = post.title
description = post.description
href = url
icon = "project"
iconIndex = iconIndex
categories = post.categories
type = post.type
%}
{% endfor %}
{% comment %} No result message {% endcomment %}
<divdata-filter-nulldata-active="false" class="col-span-3 text-center color-neutral-800">
Sorry, no results in Projects.
</div>
</div>
{% include components/divider.html
header = "Publications and Tools"
%}
{% assign resources = site.resources | where_exp: "post", "post.type != 'project'" | reverse %}
<divclass="grid-cols-3 gap-lg mt-2" data-filter-entry-section>
{% for post in resources %}
{% assign url = post.url | relative_url %}
{% assign eyebrow = post.type | join: " " %}
{% include components/card-vertical.html
eyebrow = eyebrow
header = post.title
description = post.description
href = url
categories = post.categories
type = post.type
%}
{% endfor %}
{% comment %} No result message {% endcomment %}
<divdata-filter-nulldata-active="false" class="col-span-3 text-center color-neutral-800">
Sorry, no results in Publications and Tools.
</div>
</div>
</div>
</div>