-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlesson.html
23 lines (23 loc) · 1.15 KB
/
lesson.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
layout: base
---
{% comment %}
In which language is the current page? Guess from the path: locale="/<lang>/".
Load language tockens for menus {{ data_language }}. Translations need to provide a lang.md file that translates what's under _data/language.yaml
Generate list of episodes and extras for the language shown. - NOTE: _extras need in the permlinks /<language>/page!!
{% endcomment %}
{% if page.path contains "_locale" %}
{% assign locale = page.path | remove: "_locale/" | split: "/" | first | downcase %}
{% assign pathLocale = locale | append: '/' | prepend: '/' %}
{% assign episodes = site.locale | where_exp:"item", "item.path contains pathLocale" | where_exp:"item", "item.path contains 'episode'" | sort: "path" %}
{% else %}
{% assign locale = "en" %}
{% assign episodes = site.episodes %}
{% endif %}
{% assign lang_file = locale | append: '.md' %}
{% assign data_language = site.pages | where_exp:"page", "page.path contains 'i18n'" | where_exp:"page", "page.path contains lang_file" | first %}
{% include main_title.html %}
<article>
{{ content }}
</article>
{% include syllabus.html language=data_language episodes=episodes %}