Skip to content

Commit ddc7c65

Browse files
committed
first draft with small tutorials
1 parent 10951d2 commit ddc7c65

16 files changed

+240
-69
lines changed

_data/categories.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
symbols:
2+
name:
3+
de: Symbole
4+
en: Symbols
5+
description:
6+
de: Weder lesen noch Schreiben - lerne Programmieren mit Symbolen
7+
en: Neither reading nor writing - learn programming with symbols.
8+
blocks:
9+
name:
10+
de: Blöcke
11+
en: Blocks
12+
description:
13+
de: Schreibe eigene Programme, indem du Blöcke zusammen steckst.
14+
en: Write your own programs by plugging building blocks together.
15+
syntax:
16+
name:
17+
de: Syntax
18+
en: Syntax
19+
description:
20+
en: In text based programming you write your program with the keyboard.
21+
de: In textbasierten Programmiersprachen schreibst du dein Programm mit der Tastatur.
22+
python:
23+
name: Python
24+
url: https://python.org/
25+
description:
26+
de: Python is eine Allzweckprogramiersprache.

_data/languages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
de:
1+
- id: de
22
name: Deutsch
33
# TODO: add flag
4-
en:
4+
- id: en
55
name: English

_data/tags.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

_includes/category.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div class="category grid-whole padded equalize">
2+
{%- assign category_id = include.structure.id -%}
3+
{%- assign category = site.data.categories[category_id] %}
4+
<div class="heading">
5+
{%- include lang.html text=category.name -%}
6+
</div>
7+
<div class="description">
8+
{%- include lang.html text=category.description %}
9+
</div>
10+
{%- if include.structure.structure %}
11+
{% include structure.html structure=include.structure.structure %}
12+
{%- endif %}
13+
</div>

_includes/entry.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

_includes/lang-link.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{%- assign translated = false -%}
2+
{%- for language in site.data.languages -%}
3+
{%- if include.href[language.id] -%}
4+
{%- assign translated = true -%}
5+
<a class="translation translation-{{ language.id | escape }}" href="{{ include.href[language.id] | escape }}">
6+
{%- if include.text[language.id] -%}
7+
{{- include.text[language.id] -}}
8+
{%- else -%}
9+
{{- include.text -}}
10+
{%- endif -%}
11+
</a>
12+
{%- endif -%}
13+
{%- endfor -%}
14+
{%- if translated == false -%}
15+
<a class="translation" href="{{ include.href }}">
16+
{%- include lang.html text=include.text %}
17+
</a>
18+
{%- endif -%}

_includes/lang.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{%- assign translated = false -%}
2+
{%- for language in site.data.languages -%}
3+
{%- if include.text[language.id] -%}
4+
{%- assign translated = true -%}
5+
<span class="translation translation-{{ language.id | escape }}">{{ include.text[language.id] }}</span>
6+
{%- endif -%}
7+
{%- endfor -%}
8+
{%- if translated == false -%}
9+
<span class="translation">{{ include.text }}</span>
10+
{%- endif -%}

_includes/structure.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
2-
<div class="structure">
3-
Structure: {{ include.structure | jsonify }}
4-
{% for entry in include.structure %}
5-
{% include entry.html entry=entry %}
6-
{% endfor %}
7-
</div>
1+
<div class="structure grid-whole padded equalize">
2+
{%- for entry in include.structure -%}
3+
{%- if entry.id %}
4+
{% include category.html structure=entry -%}
5+
{%- else %}
6+
{% include tutorial.html structure=entry -%}
7+
{%- endif -%}
8+
{%- endfor %}
9+
</div>

_includes/tutorial.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div class="tutorial s-grid-whole m-grid-half l-grid-third padded equalize">
2+
{%- assign tutorial_id = include.structure -%}
3+
{%- assign tutorial = site.data.tutorials[tutorial_id] %}
4+
<div class="heading">
5+
{%- include lang-link.html text=tutorial.title href=tutorial.url -%}
6+
</div>
7+
<div class="description">
8+
{%- include lang.html text=tutorial.description %}
9+
</div>
10+
{%- if structure.structure %}
11+
{% include structure.html structure=structure.structure %}
12+
{%- endif %}
13+
</div>

_layouts/overview.html

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@
22
---
33
<html>
44
<head>
5-
<meta http-equiv="refresh" content="2">
5+
<meta http-equiv="refresh" content="5">
66
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
77
<meta charset="UTF-8">
8+
<link href="css/overview.css" rel="stylesheet"/>
9+
<link href="css/fonts.css" rel="stylesheet"/>
10+
<link href="css/grid.css" rel="stylesheet"/>
811
</head>
912
<body>
10-
<img src="{{ page.image | escape }}"/>
11-
<h1>{{ page.title | escape }}</h1>
13+
<div class="header">
14+
<img class="page-logo" src="{{ page.image | escape }}"/>
15+
<span class="page-title">{{ page.title | escape }}</span>
16+
{%- for language in site.data.languages %}
17+
<a class="language-link" href="#section-{{ language.id | escape }}">{{ language.name | escape }}</a>
18+
{%- endfor %}
19+
</div>
1220
{{ page.content }}
13-
{{ page | jsonify }}
14-
{% include structure.html structure=page.structure %}
21+
{%- for language in site.data.languages -%}
22+
<div class="show-language show-language-{{ language.id | escape }} grid-whole padded equalize" id="section-{{ language.id | escape }}">
23+
<div class="show-language-heading">{{ language.name | escape }}</div>
24+
{% include structure.html structure=page.structure %}
25+
</div>
26+
{%- endfor -%}
1527
</body>
1628
</html>

css/fonts.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* from https://fonts.googleapis.com/css?family=Ubuntu */
2+
/* latin-ext */
3+
@font-face {
4+
font-family: 'Ubuntu';
5+
font-style: normal;
6+
font-weight: 400;
7+
src: local('Ubuntu'), url(fonts/Ubuntu/latin-ext.woff2) format('woff2');
8+
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
9+
}
10+
/* latin */
11+
@font-face {
12+
font-family: 'Ubuntu';
13+
font-style: normal;
14+
font-weight: 400;
15+
src: local('Ubuntu'), url(fonts/Ubuntu/latin.woff2) format('woff2');
16+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
17+
}
18+
19+
body {
20+
font-family: 'Ubuntu', sans-serif;
21+
}

css/fonts/Ubuntu/latin-ext.woff2

45.4 KB
Binary file not shown.

css/fonts/Ubuntu/latin.woff2

33 KB
Binary file not shown.

css/grid.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/overview.css

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
---
3+
/*******************************************************
4+
* switch on languages
5+
*/
6+
{%- for language in site.data.languages -%}
7+
{%- assign language_id = language | first -%}
8+
.translation-{{ language.id }} {
9+
display: none;
10+
}
11+
.show-language-{{ language.id }} .translation-{{ language.id }} {
12+
display: inline;
13+
}
14+
{%- endfor -%}
15+
16+
/*******************************************************
17+
* header
18+
*/
19+
.header {
20+
right: 0px;
21+
left: 0px;
22+
top: 0px;
23+
border: 0px;
24+
box-shadow: 0px 1px 5px #989898;
25+
overflow: hidden;
26+
padding: 0.2em;
27+
margin-bottom: 1em;
28+
}
29+
30+
.header .page-logo {
31+
height: 2em;
32+
margin-right: 1em;
33+
vertical-align: middle;
34+
padding-left: 0.2em;
35+
}
36+
37+
.header .page-title {
38+
font-size: 2em;
39+
}
40+
41+
body {
42+
padding-top: 0px; /* header */
43+
padding-right: 0px;
44+
padding-left: 0px;
45+
margin: 0px;
46+
}
47+
48+
/*******************************************************
49+
* language
50+
*/
51+
52+
.language-link { /* in header */
53+
float: right;
54+
padding-right: 0.2em;
55+
}
56+
57+
.show-language {
58+
}
59+
60+
.show-language-heading {
61+
62+
}
63+
64+
/*******************************************************
65+
* tutorial
66+
*/
67+
68+
.tutorial {
69+
70+
}
71+
72+
.tutorial > .heading {
73+
text-align: center;
74+
}
75+
76+
.tutorial > .description {
77+
78+
}
79+
80+
/*******************************************************
81+
* tutorial
82+
*/
83+
84+
.category {
85+
86+
}
87+
88+
.category > .heading {
89+
text-align: center;
90+
}
91+
92+
.category > .description {
93+
94+
}

potsdam.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33
image: https://raw.githubusercontent.com/CoderDojoPotsdam/organize/master/logo/logo-256.png
44
title: CoderDojo Potsdam
55
structure:
6-
- name: symbols
7-
structure:
8-
- lightbot
9-
- spritebox
10-
- name: blocks
11-
structure:
12-
- blockly
13-
- code.org
14-
- name: syntax
15-
structure:
16-
- codecombat
17-
- name: python
18-
structure:
19-
- waterloo
6+
- id: symbols
7+
structure:
8+
- lightbot
9+
- spritebox
10+
- id: blocks
11+
structure:
12+
- blockly
13+
- code.org
14+
- id: syntax
15+
structure:
16+
- codecombat
17+
- waterloo
2018
---

0 commit comments

Comments
 (0)