-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtopics.html
More file actions
48 lines (41 loc) · 1.54 KB
/
topics.html
File metadata and controls
48 lines (41 loc) · 1.54 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
---
layout: default
title: "Topics"
permalink: /topics/
---
<div class="post-base post-base--wide">
<h1 class="post-base__title">Topics</h1>
<p class="post-base__summary">All topics covered across the Issues-FS News publication.</p>
{% comment %}
Collect all topics from all collections into a single sorted list.
Each topic gets an anchor section listing all content tagged with it.
{% endcomment %}
{% assign all_docs = site.articles | concat: site.daily-briefs | concat: site.interviews | concat: site.investigations | concat: site.corrections %}
{% assign all_topics = "" | split: "" %}
{% for doc in all_docs %}
{% if doc.topics %}
{% for topic in doc.topics %}
{% unless all_topics contains topic %}
{% assign all_topics = all_topics | push: topic %}
{% endunless %}
{% endfor %}
{% endif %}
{% endfor %}
{% assign sorted_topics = all_topics | sort %}
<nav class="topic-index" aria-label="Topic index">
<div class="topic-index__pills">
{% for topic in sorted_topics %}
<a class="topic-pill" href="#{{ topic | slugify }}">{{ topic }}</a>
{% endfor %}
</div>
</nav>
{% for topic in sorted_topics %}
<section id="{{ topic | slugify }}" class="topic-section">
<h2 class="section-heading">{{ topic }}</h2>
{% assign topic_docs = all_docs | where_exp: "doc", "doc.topics contains topic" | sort: "date" | reverse %}
{% for doc in topic_docs %}
{% include card.html doc=doc %}
{% endfor %}
</section>
{% endfor %}
</div>