-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathcoursepart.html
More file actions
34 lines (30 loc) · 1.64 KB
/
coursepart.html
File metadata and controls
34 lines (30 loc) · 1.64 KB
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
---
layout: default
---
{%- assign cslug = page.path | split: '/' -%}
{%- assign cslug = cslug[1] -%}
{%- assign course = site.courses | find: "slug", cslug -%}
{%- capture f -%}c.path contains '_courses/{{ cslug }}/'{%- endcapture -%}
{%- assign subcourses = site.courses | where_exp: "c", f | sort: "order" -%}
{%- assign next = page.order | plus: 1 -%}
{%- assign prev = page.order | minus: 1 -%}
{%- assign next = subcourses | find: "order", next -%}
{%- assign prev = subcourses | find: "order", prev -%}
<article class="coursepart">
<header class="post-header">
<h1 class="post-title"><i class="{{ course.icon }}"></i> {{ page.title | escape }}</h1>
{% capture partn %} {{ page.order }} of {% endcapture %}
<i>{{ course.part_header | replace: " # of ", partn}}</i>
<select onchange="window.location.href=this.value;" id="course-parts-nav" style="max-width: 100%" name="part" form="hidden">
<option disabled selected hidden><i>Jump to section...</i></option>
<option value="{{ course.url }}">Course home</option>
{% for sub in subcourses %}<option {% if sub.url == page.url %}disabled {% endif %}value="{{ sub.url }}">{{ sub.order}}: {{ sub.title }}</option>{% endfor %}
</select>
</header>
{{ content }}
{%- if next -%}
<div class="continuecourse"><a href="{{ next.url }}">Continue to Part {{ next.order }}, <i>{{ next.title }}</i></a><br><br><a href="{% if prev %}{{ prev.url }}{% else %}{{ course.url }}{% endif %}">...or go back to {% if prev %}part {{ prev.order }}{% else %}the course homepage{% endif %}</a></div>
{%- else -%}
{% include course_footer.html course=course %}
{%- endif -%}
</article>