Add support for multilingual page
This commit is contained in:
parent
6bf5aa707f
commit
59359ce62b
6 changed files with 21 additions and 0 deletions
|
@ -4,3 +4,6 @@ defaults:
|
|||
path: ""
|
||||
values:
|
||||
layout: "page"
|
||||
langs:
|
||||
de: "Deutsch"
|
||||
en: "English"
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{% for node in site.pages %}
|
||||
{% if node.lang == page.lang %}
|
||||
{% if node.url == page.url %}
|
||||
<li><a href="{{ node.url }}" class="is-active">{{ node.menutitle }}</a></li>
|
||||
{% else %}
|
||||
<li><a href="{{ node.url }}">{{ node.menutitle }}</a></li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<li><a href="https://git.zom.bi/explore/projects">Git</a></li>
|
||||
<li><a href="https://wiki.zom.bi/">Wiki</a></li>
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
{% include header.html %}
|
||||
<div class="medium-12 columns content-box">
|
||||
<div class="whitebox">
|
||||
<div class="lang-list">
|
||||
{% assign translations = site.pages | where: "ref", page.ref | sort: 'lang' %}
|
||||
{% for node in translations %}
|
||||
<a href="{{ node.url }}">{{ site.langs[node.lang] | escape }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -122,6 +122,11 @@ body {
|
|||
.whitebox h2 { color: #1eb513; font-size: 1.5em; }
|
||||
.whitebox h3 { color: #1eb513; font-size: 1em; }
|
||||
|
||||
.whitebox .lang-list {
|
||||
font-size: 0.8rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sidebar .boxhead {
|
||||
font-size:1.1rem;
|
||||
text-transform: uppercase;
|
||||
|
|
2
index.md
2
index.md
|
@ -1,6 +1,8 @@
|
|||
---
|
||||
title: The friendly neighborhood undead tech community
|
||||
menutitle: Startseite
|
||||
lang: de
|
||||
ref: home
|
||||
---
|
||||
|
||||
# Willkommen bei Zombi
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
---
|
||||
title: Mumble
|
||||
menutitle: Mumble
|
||||
lang: de
|
||||
ref: mumble
|
||||
---
|
||||
|
||||
# Mumble
|
||||
|
|
Loading…
Reference in a new issue