-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbase.html
67 lines (61 loc) · 3.28 KB
/
base.html
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
---
{% include base_path.html %}
{% include gh_variables.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" %}
{% assign extras = site.locale | where_exp:"item", "item.path contains pathLocale" | where_exp:"item", "item.path contains 'extra'" | sort: "path" %}
{% else %}
{% assign locale = "en" %}
{% assign pathLocale = "" %}
{% assign episodes = site.episodes %}
{% assign extras = site.extras %}
{% 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 %}
{% assign data_language_en = site.pages | where_exp:"page", "page.path contains 'i18n'" | where_exp:"page", "page.path contains 'en.md'" | first %}
<!doctype html>
<html lang="{{ locale }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="last-modified" content="{{ site.time }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- meta "search-domain" used for google site search function google_search() -->
<meta name="search-domain" value="{{ site.github.html_url }}">
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/bootstrap.css' | absolute_url }} " />
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/bootstrap-theme.css' | absolute_url }}" />
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/lesson.css' | absolute_url }}" />
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/syntax.css' | absolute_url }}" />
{% include favicons.html %}
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<title>
{% if page.title %}{{ page.title }}{% endif %}{% if page.title and site.title %} – {% endif %}{% if site.title %}{{ site.title }}{% endif %}
</title>
</head>
<body>
{% include life_cycle.html %}
<div class="container">
{% include navbar.html language=data_language language_en=data_language_en episodes=episodes extras=extras locale=locale pathLocale=pathLocale %}
{{ content }}
{% if site.kind == "workshop" %}
{% include workshop_footer.html %}
{% else %}
{% include lesson_footer.html language=data_language %}
{% endif %}
</div>
{% include javascript.html %}
</body>
</html>