Skip to content

Commit 96d82e6

Browse files
author
Dhruva Shaw
committed
updates
1 parent 7eba7a5 commit 96d82e6

File tree

10 files changed

+104
-155
lines changed

10 files changed

+104
-155
lines changed

.github/workflows/deploy-docker-tag.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/deploy-image.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767
steps:
6868
- name: Checkout 🛎️
6969
uses: actions/checkout@v4
70+
with:
71+
fetch-depth: 0 # Shallow clones should be disabled for a better experience
72+
submodules: recursive # Fetches submodules too (if any)
7073
- name: Setup Ruby 💎
7174
uses: ruby/setup-ruby@v1
7275
with:

.github/workflows/docker-slim.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "_courses"]
2+
path = _courses
3+
url = https://github.com/Creatrix-Net/courses

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ collections:
152152
products:
153153
output: true
154154
permalink: /products/:path/
155+
courses:
156+
parse: false # CRITICAL: Ensures course HTML is copied as-is (no Al-folio theme)
157+
output: true
158+
permalink: /courses/:path/
155159

156160
announcements:
157161
enabled: true

_courses

Submodule _courses added at b55146d
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{% comment %}
2+
Lists static course files from the 'courses' collection, filtering by archive status.
3+
4+
Usage:
5+
Current: {% include course_listing_loop.html archive_status="current" %}
6+
Archived: {% include course_listing_loop.html archive_status="archived" %}
7+
{% endcomment %}
8+
9+
{% assign target_status = include.archive_status %}
10+
{% assign course_files = site.static_files | where: 'collection', 'courses' | sort: 'path' %}
11+
12+
<div class="course-list">
13+
{% for file in course_files %}
14+
{% comment %}
15+
1. Check if the file is the index.html we want to link to.
16+
2. Skip system directories like .github.
17+
{% endcomment %}
18+
{% if file.path contains '/index.html' and file.path contains '/.github/' == false %}
19+
20+
{% comment %}
21+
Determine the status based on the path.
22+
{% endcomment %}
23+
{% assign is_archived = false %}
24+
{% if file.path contains '/expired/' %}
25+
{% assign is_archived = true %}
26+
{% endif %}
27+
28+
{% comment %}
29+
Only show the file if it matches the requested status.
30+
{% endcomment %}
31+
{% if (target_status == 'archived' and is_archived) or (target_status == 'current' and is_archived == false) %}
32+
33+
{% assign full_path_parts = file.path | split: '/' %}
34+
35+
{% comment %}
36+
Extract the course directory name.
37+
If path is: /_courses/course-A/index.html -> name is 'course-A'
38+
If path is: /_courses/expired/course-Z/index.html -> name is 'course-Z'
39+
{% endcomment %}
40+
{% assign course_folder_name = full_path_parts | slice: -2, 1 | first %}
41+
42+
<div class="course-entry">
43+
<h3>
44+
<a href="{{ file.url | relative_url }}">
45+
{{ course_folder_name | replace: "-", " " | capitalize }}
46+
</a>
47+
48+
{% if is_archived %}
49+
<span class="badge badge-secondary float-right">Archived</span>
50+
{% endif %}
51+
</h3>
52+
<hr>
53+
</div>
54+
{% endif %}
55+
{% endif %}
56+
{% endfor %}
57+
</div>

_pages/archive.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: page
3+
title: Archived Courses
4+
permalink: /courses/archive/
5+
---
6+
7+
<ul class="nav nav-tabs" id="courseTabs" role="tablist">
8+
<li class="nav-item">
9+
<a class="nav-link" href="/courses/">Current Courses</a>
10+
</li>
11+
<li class="nav-item">
12+
<a class="nav-link active" href="/courses/archive/">Archived Courses</a>
13+
</li>
14+
</ul>
15+
<br>
16+
17+
<h2>Archived Course List</h2>
18+
{% include course_listing_loop.html archive_status="archived" %}

_pages/courses.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: page
3+
title: Courses Offered
4+
permalink: /courses/
5+
---
6+
7+
<ul class="nav nav-tabs" id="courseTabs" role="tablist">
8+
<li class="nav-item">
9+
<a class="nav-link active" href="/courses/">Current Courses</a>
10+
</li>
11+
<li class="nav-item">
12+
<a class="nav-link" href="/courses/archive/">Archived Courses</a>
13+
</li>
14+
</ul>
15+
<br>
16+
17+
<h2>Current Course List</h2>
18+
{% include course_listing_loop.liquid archive_status="current" %}

0 commit comments

Comments
 (0)