-
Notifications
You must be signed in to change notification settings - Fork 14
/
stories.html
87 lines (73 loc) · 2.57 KB
/
stories.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
---
title: Stories
description: Shortform articles communicating the latest analysis and methods from the NCCS team.
layout: default
permalink: /stories/
activeLink: /stories/
---
{% include components/page-header.html
header = page.title
description = page.description
%}
<div class="feature flow flow-4">
{% include components/divider.html
header = "Featured"
%}
{% assign featured_posts = site.stories | where: "featured", "true" | sort: "featuredOrder" | limit: "5" %}
{% include components/content-feature.html
entries = featured_posts
style = "image"
%}
</div>
{% comment %}
FILTERS
Because of the work needed to set up, the filters cannot be fully componentized
{% endcomment %}
<div data-module="filter" class="flow flow-4 full grid-content">
{% for post in site.stories %}
{% 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 = "All Stories"
categoryTitle = "Topics"
categories = all_categories
style = "dark"
%}
<div class="feature flow flow-4">
{% include components/divider.html
header = "Stories"
%}
{% assign posts = site.stories | reverse %}
<div class="grid-cols-3 gap-lg mt-2" data-filter-entry-section>
{% for post in posts %}
{% comment %}
Images
To activate images in this loop, remove the `and activateImages` from the condition
{% endcomment %}
{% assign imageUrl = nil %}
{% if post.image and activateImages %}
{% assign imageUrl = "/public/img/" | append: post.image | relative_url %}
{% endif %}
{% assign url = post.url | relative_url %}
{% include components/card-vertical.html
header = post.title
description = post.description
href = url
categories = post.categories
type = post.type
image = imageUrl
%}
{% endfor %}
{% comment %} No result message {% endcomment %}
<div data-filter-null data-active="false" class="col-span-3 text-center color-neutral-800">
Sorry, no results in Stories.
</div>
</div>
</div>