2 Display episode's timings and learning objectives.
4 Regarding the `if page.*** == nil` below:
5 all-in-one page combines all episodes into one.
6 It, therefore, does not define its own objectives, exercises,
7 and questions, which 'normal' episodes define in the front matter.
9 To display episodes' teaching and exercise times, as well as episode
10 questions and objectives, we pass them as parameters to the Liquid's
11 `include` statement when we generate the page:
13 include episode_overview.html teaching_time=e.teaching ...
15 Here we obtain the information we need either from the episode itself or
16 from the parameters passed in.
19 {% if page.teaching == nil %}
20 {% assign teaching_time = include.teaching_time %}
22 {% assign teaching_time = page.teaching %}
25 {% if page.exercises == nil %}
26 {% assign exercise_time = include.exercise_time %}
28 {% assign exercise_time = page.exercises %}
31 {% if page.questions == nil %}
32 {% assign episode_questions = include.episode_questions %}
34 {% assign episode_questions = page.questions %}
37 {% if page.objectives == nil %}
38 {% assign episode_objectives = include.episode_objectives %}
40 {% assign episode_objectives = page.objectives %}
44 <blockquote class="objectives">
48 <div class="col-md-3">
49 <strong>Teaching:</strong> {{ teaching_time }} min
51 <strong>Exercises:</strong> {{ exercise_time }} min
53 <div class="col-md-9">
54 <strong>Questions</strong>
56 {% for question in episode_questions %}
57 <li>{{ question|markdownify }}</li>
64 <div class="col-md-3">
66 <div class="col-md-9">
67 <strong>Objectives</strong>
69 {% for objective in episode_objectives %}
70 <li>{{ objective|markdownify }}</li>