-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathsection.html
More file actions
30 lines (25 loc) · 1.26 KB
/
section.html
File metadata and controls
30 lines (25 loc) · 1.26 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
{% assign urlParts = page.url | split: '/' %}
{% assign activePlatform = urlParts[1] %}
{% assign platform = site.data.routes.platforms | where: "href", activePlatform | first %}
{% assign activeHub = urlParts[3] %}
{% assign hub = platform.hubs | where: "href", activeHub | first %}
{% assign hubPrefix = "/" | append: activePlatform | append: "/hubs/" | append: activeHub | append: "/" %}
{% assign activeSectionPath = page.url | replace: ".html", "" | replace: hubPrefix, "" %}
{% assign section = hub.flatSections | where: "href", activeSectionPath | first %}
<h1 class="title">
{{ section.title }}
</h1>
<section>
<div class="cards-group">
{% if section.sections %}
{% for subsection in section.sections %}
{% include section-card.html platform=activePlatform hub=hub.href section=subsection.href title=subsection.title %}
{% endfor %}
{% endif %}
{% assign sortedArticles = section.articles | default: empty %}
{% for article in sortedArticles %}
{% assign article_href = section.href | append: '/' | append: article.href %}
{% include article-card.html hub=hub.href href=article_href title=article.title platform=activePlatform %}
{% endfor %}
</div>
</section>