File indexing completed on 2024-11-15 10:02:52
0001 {% comment %}
0002 Display episode's timings and learning objectives.
0003
0004 Regarding the `if page.*** == nil` below:
0005 all-in-one page combines all episodes into one.
0006 It, therefore, does not define its own objectives, exercises,
0007 and questions, which 'normal' episodes define in the front matter.
0008
0009 To display episodes' teaching and exercise times, as well as episode
0010 questions and objectives, we pass them as parameters to the Liquid's
0011 `include` statement when we generate the page:
0012
0013 include episode_overview.html teaching_time=e.teaching ...
0014
0015 Here we obtain the information we need either from the episode itself or
0016 from the parameters passed in.
0017 {% endcomment %}
0018
0019 {% if page.teaching == nil %}
0020 {% assign teaching_time = include.teaching_time %}
0021 {% else %}
0022 {% assign teaching_time = page.teaching %}
0023 {% endif %}
0024
0025 {% if page.exercises == nil %}
0026 {% assign exercise_time = include.exercise_time %}
0027 {% else %}
0028 {% assign exercise_time = page.exercises %}
0029 {% endif %}
0030
0031 {% if page.questions == nil %}
0032 {% assign episode_questions = include.episode_questions %}
0033 {% else %}
0034 {% assign episode_questions = page.questions %}
0035 {% endif %}
0036
0037 {% if page.objectives == nil %}
0038 {% assign episode_objectives = include.episode_objectives %}
0039 {% else %}
0040 {% assign episode_objectives = page.objectives %}
0041 {% endif %}
0042
0043
0044 <blockquote class="objectives">
0045 <h2>Overview</h2>
0046
0047 <div class="row">
0048 <div class="col-md-3">
0049 <strong>Teaching:</strong> {{ teaching_time }} min
0050 <br/>
0051 <strong>Exercises:</strong> {{ exercise_time }} min
0052 </div>
0053 <div class="col-md-9">
0054 <strong>Questions</strong>
0055 <ul>
0056 {% for question in episode_questions %}
0057 <li>{{ question|markdownify }}</li>
0058 {% endfor %}
0059 </ul>
0060 </div>
0061 </div>
0062
0063 <div class="row">
0064 <div class="col-md-3">
0065 </div>
0066 <div class="col-md-9">
0067 <strong>Objectives</strong>
0068 <ul>
0069 {% for objective in episode_objectives %}
0070 <li>{{ objective|markdownify }}</li>
0071 {% endfor %}
0072 </ul>
0073 </div>
0074 </div>
0075
0076 </blockquote>