Skip to content

Commit

Permalink
Set all tokens and translation links needed by page layout
Browse files Browse the repository at this point in the history
  • Loading branch information
dpshelio committed Aug 8, 2019
1 parent be9f584 commit 199316c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 3 additions & 3 deletions _includes/all_keypoints.html
Original file line number Diff line number Diff line change
@@ -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 %}

<h2>Key Points</h2>
<h2>{{ include.language.keypoints }}</h2>
<table class="table table-striped">
{% for episode in site.episodes %}
{% for episode in include.episodes %}
{% unless episode.break %}
<tr>
<td class="col-md-3">
Expand Down
18 changes: 17 additions & 1 deletion _layouts/reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -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="/<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 %}
{% comment %} Start of page {% endcomment %}
{% include all_keypoints.html language=data_language episodes=episodes %}
{{content}}

0 comments on commit 199316c

Please sign in to comment.