Skip to content

Commit 870bf02

Browse files
authored
Create original projects.md
1 parent 80a673a commit 870bf02

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

_pages/projects.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
layout: page
3+
title: projects
4+
permalink: /projects/
5+
description: A growing collection of your cool projects.
6+
nav: true
7+
nav_order: 3
8+
display_categories: [work, fun]
9+
horizontal: false
10+
---
11+
12+
<!-- pages/projects.md -->
13+
<div class="projects">
14+
{% if site.enable_project_categories and page.display_categories %}
15+
<!-- Display categorized projects -->
16+
{% for category in page.display_categories %}
17+
<a id="{{ category }}" href=".#{{ category }}">
18+
<h2 class="category">{{ category }}</h2>
19+
</a>
20+
{% assign categorized_projects = site.projects | where: "category", category %}
21+
{% assign sorted_projects = categorized_projects | sort: "importance" %}
22+
<!-- Generate cards for each project -->
23+
{% if page.horizontal %}
24+
<div class="container">
25+
<div class="row row-cols-1 row-cols-md-2">
26+
{% for project in sorted_projects %}
27+
{% include projects_horizontal.liquid %}
28+
{% endfor %}
29+
</div>
30+
</div>
31+
{% else %}
32+
<div class="row row-cols-1 row-cols-md-3">
33+
{% for project in sorted_projects %}
34+
{% include projects.liquid %}
35+
{% endfor %}
36+
</div>
37+
{% endif %}
38+
{% endfor %}
39+
40+
{% else %}
41+
42+
<!-- Display projects without categories -->
43+
44+
{% assign sorted_projects = site.projects | sort: "importance" %}
45+
46+
<!-- Generate cards for each project -->
47+
48+
{% if page.horizontal %}
49+
50+
<div class="container">
51+
<div class="row row-cols-1 row-cols-md-2">
52+
{% for project in sorted_projects %}
53+
{% include projects_horizontal.liquid %}
54+
{% endfor %}
55+
</div>
56+
</div>
57+
{% else %}
58+
<div class="row row-cols-1 row-cols-md-3">
59+
{% for project in sorted_projects %}
60+
{% include projects.liquid %}
61+
{% endfor %}
62+
</div>
63+
{% endif %}
64+
{% endif %}
65+
</div>

0 commit comments

Comments
 (0)