Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypernova101 committed Sep 9, 2024
1 parent a8d47bc commit b95aef1
Show file tree
Hide file tree
Showing 6 changed files with 700 additions and 263 deletions.
131 changes: 131 additions & 0 deletions _includes/schedule.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{%comment%}
Setup course data
- Extract data by course
- Within course create units
{%endcomment%}

{% assign course = site.data[page.course] %} <!-- Load YML data -->
{% assign units = page.units | split: ',' %}
<h1>{{page.title}}</h1>
<br>

{%comment%}
Load all posts with site
{%endcomment%}

{% assign posts = null | compact %}
{% assign posts = posts | concat:site.posts | concat:site.pages %}

{%comment%}
<!-- Iterate through Course Units -->
{%endcomment%}

{% for unit in units %}
{% assign unitKey = "Unit " | append: unit %}
{% assign unitData = course[unitKey] %}
<h2>
{{ unitKey }}: {{ unitData.title }}
</h2>
<p> {{ unitData.description }} </p>

{% assign start = unitData.start %}
{% assign end = unitData.end %}

{%comment%}
<!-- Output Column Headings for Blogs -->
{%endcomment%}

<table>
<tr>
<th>Week</th>
<th>Plans</th>
<th>Hacks(Todo)</th>
<th>Tangibles</th>
</tr>

{%comment%}
<!-- These loops group blogs according to Row (week) and Column (category)
units = empty array
sym = value to be used as a separator
deli = sym forced to array
-->
{%endcomment%}

{% assign units = null | compact %}
{% assign sym = "|||" %}
{% assign deli = sym | compact %}

{% for index in (start..end) -%}
{% assign plans = null | compact %}
{% assign hacks = null | compact %}
{% assign tangibles = null | compact %}


{%comment%}
<!-- looping through all posts -->
{%endcomment%}

{% for post in posts %}
{% if post.courses[page.course] %}
{%comment%}
<!-- prepare data blog post data for evaluation -->
{%endcomment%}
{% assign week = post.courses[page.course].week | tangibles: 0 %}
{% assign title = post.title | compact %}
{% assign url = post.url | compact %}

{%comment%}
<!-- process posts for current week -->
{%endcomment%}
{% if week == index %}

{%comment%}
<!-- organizing blogs by type -->
{%endcomment%}
{% if post.type == "plans" %}
{% assign plans = plans | unshift: title %}
{% assign plans = plans | unshift: url %}
{% elsif post.type == "hacks" %}
{% assign hacks = hacks | unshift: title %}
{% assign hacks = hacks | unshift: url %}
{% elsif post.type == "tangibles" %}
{% assign tangibles = tangibles | unshift: title %}
{% assign tangibles = tangibles | unshift: url %}
{% else %}
{% assign uk = uk | unshift: title %}
{% assign uk = uk | unshift: url %}
{% endif %}

{% endif %}
{% endif %}
{% endfor %}

{%comment%}
<!-- ordering units and inserting column delimiters -->
{%endcomment%}
{% assign units = units | concat:plans | concat:deli | concat:hacks | concat:deli | concat:tangibles %}

{%comment%}
<!-- This Loop is maximum iterationss, since elements are pairs it will decrement a extra times at the end -->
{%endcomment%}
<tr>
<td> {{ index }} </td>
<td>
{% for i in (0..units.size) -%}
{% if units.size == 0 %}
{% break %}
{% elsif units[0] == sym %} <!-- make new column -->
</td>
<td>
{% assign units = units | shift %} <!-- remove delimiter -->
{% else %} <!-- make a link in the column -->
- <a href="{{site.baseurl}}/{{units[0]}}">{{units[1]}}</a> <br/>
{% assign units = units | shift | shift %} <!-- remove title and url -->
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}

</table>
{% endfor %}
131 changes: 131 additions & 0 deletions _layouts/schedule.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{%comment%}
Setup course data
- Extract data by course
- Within course create units
{%endcomment%}

{% assign course = site.data[page.course] %} <!-- Load YML data -->
{% assign units = page.units | split: ',' %}
<h1>{{page.title}}</h1>
<br>

{%comment%}
Load all posts with site
{%endcomment%}

{% assign posts = null | compact %}
{% assign posts = posts | concat:site.posts | concat:site.pages %}

{%comment%}
<!-- Iterate through Course Units -->
{%endcomment%}

{% for unit in units %}
{% assign unitKey = "Unit " | append: unit %}
{% assign unitData = course[unitKey] %}
<h2>
{{ unitKey }}: {{ unitData.title }}
</h2>
<p> {{ unitData.description }} </p>

{% assign start = unitData.start %}
{% assign end = unitData.end %}

{%comment%}
<!-- Output Column Headings for Blogs -->
{%endcomment%}

<table>
<tr>
<th>Week</th>
<th>Plans</th>
<th>Hacks(Todo)</th>
<th>Tangibles</th>
</tr>

{%comment%}
<!-- These loops group blogs according to Row (week) and Column (category)
units = empty array
sym = value to be used as a separator
deli = sym forced to array
-->
{%endcomment%}

{% assign units = null | compact %}
{% assign sym = "|||" %}
{% assign deli = sym | compact %}

{% for index in (start..end) -%}
{% assign plans = null | compact %}
{% assign hacks = null | compact %}
{% assign tangibles = null | compact %}


{%comment%}
<!-- looping through all posts -->
{%endcomment%}

{% for post in posts %}
{% if post.courses[page.course] %}
{%comment%}
<!-- prepare data blog post data for evaluation -->
{%endcomment%}
{% assign week = post.courses[page.course].week | tangibles: 0 %}
{% assign title = post.title | compact %}
{% assign url = post.url | compact %}

{%comment%}
<!-- process posts for current week -->
{%endcomment%}
{% if week == index %}

{%comment%}
<!-- organizing blogs by type -->
{%endcomment%}
{% if post.type == "plans" %}
{% assign plans = plans | unshift: title %}
{% assign plans = plans | unshift: url %}
{% elsif post.type == "hacks" %}
{% assign hacks = hacks | unshift: title %}
{% assign hacks = hacks | unshift: url %}
{% elsif post.type == "tangibles" %}
{% assign tangibles = tangibles | unshift: title %}
{% assign tangibles = tangibles | unshift: url %}
{% else %}
{% assign uk = uk | unshift: title %}
{% assign uk = uk | unshift: url %}
{% endif %}

{% endif %}
{% endif %}
{% endfor %}

{%comment%}
<!-- ordering units and inserting column delimiters -->
{%endcomment%}
{% assign units = units | concat:plans | concat:deli | concat:hacks | concat:deli | concat:tangibles %}

{%comment%}
<!-- This Loop is maximum iterationss, since elements are pairs it will decrement a extra times at the end -->
{%endcomment%}
<tr>
<td> {{ index }} </td>
<td>
{% for i in (0..units.size) -%}
{% if units.size == 0 %}
{% break %}
{% elsif units[0] == sym %} <!-- make new column -->
</td>
<td>
{% assign units = units | shift %} <!-- remove delimiter -->
{% else %} <!-- make a link in the column -->
- <a href="{{site.baseurl}}/{{units[0]}}">{{units[1]}}</a> <br/>
{% assign units = units | shift | shift %} <!-- remove title and url -->
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}

</table>
{% endfor %}
15 changes: 13 additions & 2 deletions _notebooks/Foundation/2024-09-05-emoji.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand All @@ -43,7 +43,18 @@
]
}
],
"source": []
"source": [
"from emoji import emojize \n",
"print(emojize(\":thumbs_up: Liverpool Football Club is the best soccer team in the world. :grinning_face:\"))\n",
"\n",
"print(\"\")\n",
"print(emojize(\"Liverpool FC is one of the most iconic football clubs in the world! :soccer_ball::red_circle:\"))\n",
"print(emojize(\"Known for their passionate fans, the famous Kop :musical_notes: and their rich history,\"))\n",
"print(emojize(\"They've won numerous Premier League :trophy: and Champions League titles :globe_showing_Europe-Africa:\"))\n",
"print(emojize(\"Legends like Steven Gerrard and Mohamed Salah have graced the pitch at Anfield :stadium:\"))\n",
"print(emojize(\"Where the atmosphere is electric! YNWA (You'll Never Walk Alone) :musical_note::fire: is not just a motto,\"))\n",
"print(\"It's a way of life for the Reds!\")"
]
},
{
"cell_type": "markdown",
Expand Down
Loading

0 comments on commit b95aef1

Please sign in to comment.