Skip to content

Commit 74f85ec

Browse files
authored
Merge pull request #412 from typelevel/filter-projects
Add filter tabs to Projects page
2 parents 3a74a5a + b70094f commit 74f85ec

File tree

7 files changed

+101
-7
lines changed

7 files changed

+101
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
_site
2+
*.sw?
23
.idea
34
/vendor/bundle
45
css/main.css
@@ -9,3 +10,4 @@ target
910
.jekyll-cache/
1011
.metals
1112
.DS_Store
13+
.direnv/

_data/filter-projects.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- title: All Projects
2+
url: /projects/
3+
category: allProjects
4+
- title: Organization
5+
url: /projects/organization/
6+
category: organization
7+
- title: Affiliate
8+
url: /projects/affiliate/
9+
category: affiliate

_includes/_project_membership.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div class="project-membership">
2+
{% if project.affiliate %}
3+
<img src="https://img.shields.io/badge/typelevel-affiliate%20project-FFB4B5.svg" alt="Typelevel Affiliate Project" />
4+
{% else %}
5+
<img src="https://img.shields.io/badge/typelevel-organization%20project-FF6169.svg" alt="Typelevel Organization Project" />
6+
{% endif %}
7+
</div>

_includes/_tab-projects.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ul class="tab">
2+
{% for tabItem in site.data.filter-projects %}
3+
<li><a href="{{ site.baseurl }}{{tabItem.url}}" {% if tabItem.url == page.url %} class="active" {% endif %}>{{tabItem.title}}</a></li>
4+
{% endfor %}
5+
</ul>

projects/affiliate.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: page
3+
title: Projects
4+
permalink: /projects/affiliate/
5+
---
6+
7+
<div id="section-page">
8+
<div class="container">
9+
<div class="masthead-page">
10+
<h1><span>{{ page.title }}</span></h1>
11+
<p>{{site.data.description.projectsDescription}}</p>
12+
{% include _tab-projects.html %}
13+
</div>
14+
15+
<div class="projects-list">
16+
{% for project in site.projects %}
17+
{% if project.affiliate %}
18+
<a href="{{ project.github }}" class="project-item">
19+
<div class="project-item-content">
20+
<div>
21+
<img src="{{ site.baseurl }}/img/assets/icon-project.svg" alt="">
22+
<h3>{{ project.title }}</h3>
23+
</div>
24+
<p>{{ project.description }}</p>
25+
</div>
26+
{% if project.category %}
27+
<div class="project-item-tag">
28+
<p>{{ project.category }}</p>
29+
</div>
30+
{% endif %}
31+
{% include _project_membership.html %}
32+
</a>
33+
{% endif %}
34+
{% endfor %}
35+
</div>
36+
</div>
37+
</div>
38+
{% include _cta-projects.html %}

projects/index.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<div class="masthead-page">
88
<h1><span>{{ page.title }}</span></h1>
99
<p>{{site.data.description.projectsDescription}}</p>
10+
{% include _tab-projects.html %}
1011
</div>
1112
<div class="projects-list">
1213
{% for project in site.projects %}
@@ -23,13 +24,7 @@ <h3>{{ project.title }}</h3>
2324
<p>{{ project.category }}</p>
2425
</div>
2526
{% endif %}
26-
<div class="project-membership">
27-
{% if project.affiliate %}
28-
<img src="https://img.shields.io/badge/typelevel-affiliate-FFB4B5" alt="Typelevel affiliate" />
29-
{% else %}
30-
<img src="https://img.shields.io/badge/typelevel-member-FF6169" alt="Typelevel member" />
31-
{% endif %}
32-
</div>
27+
{% include _project_membership.html %}
3328
</a>
3429
{% endfor %}
3530
</div>

projects/organization.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: page
3+
title: Projects
4+
permalink: /projects/organization/
5+
---
6+
7+
<div id="section-page">
8+
<div class="container">
9+
<div class="masthead-page">
10+
<h1><span>{{ page.title }}</span></h1>
11+
<p>{{site.data.description.projectsDescription}}</p>
12+
{% include _tab-projects.html %}
13+
</div>
14+
15+
<div class="projects-list">
16+
{% for project in site.projects %}
17+
{% if project.affiliate != true %}
18+
<a href="{{ project.github }}" class="project-item">
19+
<div class="project-item-content">
20+
<div>
21+
<img src="{{ site.baseurl }}/img/assets/icon-project.svg" alt="">
22+
<h3>{{ project.title }}</h3>
23+
</div>
24+
<p>{{ project.description }}</p>
25+
</div>
26+
{% if project.category %}
27+
<div class="project-item-tag">
28+
<p>{{ project.category }}</p>
29+
</div>
30+
{% endif %}
31+
{% include _project_membership.html %}
32+
</a>
33+
{% endif %}
34+
{% endfor %}
35+
</div>
36+
</div>
37+
</div>
38+
{% include _cta-projects.html %}

0 commit comments

Comments
 (0)