diff --git a/_includes/all_keypoints.html b/_includes/all_keypoints.html index e4fd289..37b0caa 100644 --- a/_includes/all_keypoints.html +++ b/_includes/all_keypoints.html @@ -1,12 +1,12 @@ {% comment %} - Display key points of all episodes for reference. +Display key points of all episodes for reference. {% endcomment %} {% include base_path.html %} -

Key Points

+

{{ include.language.keypoints }}

-{% for episode in site.episodes %} +{% for episode in include.episodes %} {% unless episode.break %}
diff --git a/_layouts/reference.html b/_layouts/reference.html index 27c9695..51372fc 100644 --- a/_layouts/reference.html +++ b/_layouts/reference.html @@ -2,5 +2,21 @@ layout: page title: "Reference" --- -{% include all_keypoints.html %} +{% comment %} +In which language is the current page? Guess from the path: locale="//". +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 //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 %} +{% comment %} Start of page {% endcomment %} +{% include all_keypoints.html language=data_language episodes=episodes %} {{content}}