Skip to content
Snippets Groups Projects
Commit 86aa5e5e authored by Kevin Lin's avatar Kevin Lin :sparkles:
Browse files

Define module data as content via kramdown definition lists

parent 6f0fb36e
No related branches found
No related tags found
No related merge requests found
<div class="module"> <div class="module">
<h2 class="module-header"> <h2>{{ page.title }}</h2>
{% if page.week %} {{ content }}
<strong class="module-meta">Week {{ page.week }}</strong>
{% endif %}
{{ page.title }}
</h2>
{% if page.days %}
<dl class="module-days">
{% for day in page.days %}
{% assign date = day | first %}
{% assign events = day | last %}
<dt class="module-day">{{ date | date: '%b %e' }}</dt>
{% for event in events %}
{% assign main = event | first %}
{% assign info = event | last %}
{% capture main %}{% include eval.liquid content=main %}{% endcapture %}
{% capture info %}{% include eval.liquid content=info %}{% endcapture %}
<dd class="module-event">{{ main | markdownify }}{{ info | markdownify }}</dd>
{% endfor %}
{% endfor %}
</dl>
{% endif %}
{% assign content_strip = content | strip %}
{% if content_strip != "" %}
<div class="module-body">
{{ content }}
</div>
{% endif %}
</div> </div>
--- ---
week: 1
title: Introduction to Java title: Introduction to Java
days:
2019-04-01:
"[Java & Git](#)":
"[1.1](#)"
"**HW 1 out**{: .label .label-hw-out }":
null
2019-04-02:
"**Section**{: .label .label-section }[Intro to Java](#)":
"Solution"
2019-04-03:
"[Variables & Objects](#)":
"[1.2](#), [2.1](#)"
2019-04-04:
"**Lab**{: .label } [Intro to Java](#)":
null
2019-04-05:
"[Tracing, IntLists, & Recursion](#)":
"[2.1](#)"
"**HW 1 due**{: .label .label-hw-due }":
null
--- ---
Sep 28
: [Java & Git](#)
: [1.1](#)
Sep 29
: **Section**{: .label .label-purple }[Intro to Java](#)
: [Solution](#)
Sep 30
: [Variables & Objects](#)
: [1.2](#), [2.1](#)
Oct 1
: **Lab**{: .label .label-purple } [Intro to Java](#)
Oct 2
: [Tracing, IntLists, & Recursion](#)
: [2.1](#)
: **HW 1 due**{: .label .label-red }
--- ---
week: 2
title: Basic Data Structures title: Basic Data Structures
days:
2019-04-08:
"[Linked Lists & Encapsulation](#)":
"[3.1](#), [2.2](#), [2.3](#)"
"**HW 2 out**{: .label .label-hw-out }":
null
2019-04-09:
"**Section**{: .label .label-section }[Linked Lists](#)":
"Solution"
2019-04-10:
"[Resizing Arrays](#)":
"[2.4](#), [2.5](#)"
2019-04-11:
"**Lab**{: .label } [Resizing Arrays](#)":
null
2019-04-12:
"[Runtime Analysis](#)":
"[8.1](#), [8.2](#), [8.3](#), [8.4](#)"
"**HW 2 due**{: .label .label-hw-due }":
null
--- ---
Oct 5
: [Linked Lists & Encapsulation](#)
: [3.1](#), [2.2](#), [2.3](#)
Oct 6
: **Section**{: .label .label-purple }[Linked Lists](#)
: [Solution](#)
Oct 7
: [Resizing Arrays](#)
: [2.4](#), [2.5](#)
Oct 8
: **Lab**{: .label .label-purple } [Resizing Arrays](#)
Oct 9
: [Runtime Analysis](#)
: [8.1](#), [8.2](#), [8.3](#), [8.4](#)
: **HW 2 due**{: .label .label-red }
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
} }
%card-meta { %card-meta {
@extend .label;
border-radius: $border-radius; border-radius: $border-radius;
padding-bottom: 0; padding-bottom: 0;
user-select: none; user-select: none;
......
.main-content .module,
.module { .module {
@extend %card; @extend %card;
.module-days { h1, h2 {
@extend .text-gamma;
}
.label {
@extend %card-meta;
margin-left: 0;
}
>dl {
border-bottom: $border $border-color; border-bottom: $border $border-color;
border-top: $border $border-color; border-top: $border $border-color;
display: grid; display: grid;
...@@ -25,21 +35,20 @@ ...@@ -25,21 +35,20 @@
} }
} }
.module-day { >dt {
@extend %module-item; @extend %module-item;
border-top: $border $border-color; border-top: $border $border-color;
font-weight: normal; font-weight: normal;
grid-column-start: 1;
text-align: right; text-align: right;
+.module-event { +dd {
border-top: $border $border-color; border-top: $border $border-color;
} }
&:first-child { &:first-child {
border-top: none; border-top: none;
+.module-event { +dd {
border-top: none; border-top: none;
} }
} }
...@@ -49,63 +58,32 @@ ...@@ -49,63 +58,32 @@
} }
} }
.module-event { >dd {
@extend %module-item; @extend %module-item;
display: flex; font-weight: 700;
flex-direction: column;
grid-column-start: 2;
@include mq(sm) {
flex-direction: row;
}
+.module-event { +dd {
padding-top: 0; padding-top: 0;
} }
p,
ol,
ul,
dl { dl {
display: flex;
flex-direction: column;
margin: 0; margin: 0;
flex: 1 0 62.5%;
}
p {
font-weight: 500;
+p { @include mq(sm) {
flex-shrink: 1; flex-direction: row;
} }
}
}
.label {
@extend %card-meta;
margin-left: 0;
&.label-hw-out { dt {
@extend .label-yellow; flex: 0 0 62.5%;
} margin: 0;
}
&.label-hw-due {
@extend .label-red;
}
&.label-section { dd {
@extend .label-purple; margin: 0;
}
} }
} }
} }
} }
.module-meta {
@extend %card-meta, .text-grey-dk-100, .bg-grey-lt-200;
}
.module-header {
@extend .text-gamma;
}
.module-body {
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment