Skip to content

Commit

Permalink
Set all tokens and translation links needed by break layout
Browse files Browse the repository at this point in the history
  • Loading branch information
dpshelio committed Aug 8, 2019
1 parent 7697348 commit be9f584
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _includes/episode_break.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
Display a break's timings in a box similar to a learning episode's.
{% endcomment %}
<blockquote class="objectives">
<h2>Overview</h2>
<h2>{{ include.language.overview }}</h2>

<div class="row">
<div class="col-md-3">
<strong>Break:</strong> {{ page.break }} min
<strong>{{ include.language.break }}:</strong> {{ page.break }} {{ include.language.min }}
</div>
<div class="col-md-9">
</div>
Expand Down
19 changes: 16 additions & 3 deletions _layouts/break.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
---
layout: base
---
{% include episode_navbar.html episode_navbar_title=true %}
{% 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 %}
{% else %}
{% assign locale = "en" %}
{% 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 episode_navbar.html episode_navbar_title=true language=data_language %}
<article>
{% include episode_title.html %}
{% include episode_break.html %}
{% include episode_break.html language=data_language %}
{{content}}
</article>
{% include episode_navbar.html episode_navbar_title=false %}
{% include episode_navbar.html episode_navbar_title=false language=data_language %}

0 comments on commit be9f584

Please sign in to comment.