-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
episode_overview.html
76 lines (63 loc) · 1.98 KB
/
episode_overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{% comment %}
Display episode's timings and learning objectives.
Regarding the `if page.*** == nil` below:
all-in-one page combines all episodes into one.
It, therefore, does not define its own objectives, exercises,
and questions, which 'normal' episodes define in the front matter.
To display episodes' teaching and exercise times, as well as episode
questions and objectives, we pass them as parameters to the Liquid's
`include` statement when we generate the page:
include episode_overview.html teaching_time=e.teaching ...
Here we obtain the information we need either from the episode itself or
from the parameters passed in.
{% endcomment %}
{% if page.teaching == nil %}
{% assign teaching_time = include.teaching_time %}
{% else %}
{% assign teaching_time = page.teaching %}
{% endif %}
{% if page.exercises == nil %}
{% assign exercise_time = include.exercise_time %}
{% else %}
{% assign exercise_time = page.exercises %}
{% endif %}
{% if page.questions == nil %}
{% assign episode_questions = include.episode_questions %}
{% else %}
{% assign episode_questions = page.questions %}
{% endif %}
{% if page.objectives == nil %}
{% assign episode_objectives = include.episode_objectives %}
{% else %}
{% assign episode_objectives = page.objectives %}
{% endif %}
<blockquote class="objectives">
<h2>Overview</h2>
<div class="row">
<div class="col-md-3">
<strong>Teaching:</strong> {{ teaching_time }} min
<br/>
<strong>Exercises:</strong> {{ exercise_time }} min
</div>
<div class="col-md-9">
<strong>Questions</strong>
<ul>
{% for question in episode_questions %}
<li>{{ question|markdownify }}</li>
{% endfor %}
</ul>
</div>
</div>
<div class="row">
<div class="col-md-3">
</div>
<div class="col-md-9">
<strong>Objectives</strong>
<ul>
{% for objective in episode_objectives %}
<li>{{ objective|markdownify }}</li>
{% endfor %}
</ul>
</div>
</div>
</blockquote>