setup i18n
This commit is contained in:
parent
5dff188fa4
commit
61415ce5a7
|
@ -2,7 +2,7 @@
|
|||
<div>
|
||||
<div>[language switcher]</div>
|
||||
<nav>
|
||||
{{ collections.footerNav | eleventyNavigation | eleventyNavigationToHtml | safe }}
|
||||
{{ collections.footerNav | pageLang | eleventyNavigation | eleventyNavigationToHtml | safe }}
|
||||
</nav>
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<header>
|
||||
<a href="/" title="home">ESE Logo</a>
|
||||
<a href="{{ "/" | locale_url }}" title="home">ESE Logo</a>
|
||||
<nav>
|
||||
{{ collections.mainNav | eleventyNavigation | eleventyNavigationToHtml | safe }}
|
||||
{{ collections.mainNav | pageLang | eleventyNavigation | eleventyNavigationToHtml | safe }}
|
||||
</nav>
|
||||
</header>
|
||||
|
|
6
content/de/accessibility.md
Normal file
6
content/de/accessibility.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
layout: page.njk
|
||||
title: Barrierefreiheit
|
||||
tags: footerNav
|
||||
---
|
||||
# Barrierefreiheit
|
7
content/de/campus.md
Normal file
7
content/de/campus.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
layout: page.njk
|
||||
title: Campus & Fakultät
|
||||
tags: mainNav
|
||||
---
|
||||
# Campus & Fakultät
|
||||
|
3
content/de/de.json
Normal file
3
content/de/de.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"lang": "de"
|
||||
}
|
6
content/de/faq.md
Normal file
6
content/de/faq.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
layout: page.njk
|
||||
title: FAQ
|
||||
tags: mainNav
|
||||
---
|
||||
# Häufig gestellte Fragen
|
7
content/de/first-steps.md
Normal file
7
content/de/first-steps.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
layout: page.njk
|
||||
title: Erste Schritte
|
||||
tags: mainNav
|
||||
---
|
||||
# Erste Schritte
|
||||
|
6
content/de/guidelines.md
Normal file
6
content/de/guidelines.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
layout: page.njk
|
||||
title: Community-Leitlinien
|
||||
tags: footerNav
|
||||
---
|
||||
# Community-Leitlinien
|
6
content/de/imprint.md
Normal file
6
content/de/imprint.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
layout: page.njk
|
||||
title: Impressum
|
||||
tags: footerNav
|
||||
---
|
||||
# Impressum
|
4
content/de/index.md
Normal file
4
content/de/index.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
layout: page.njk
|
||||
---
|
||||
# Hallo Welt :)
|
6
content/de/privacy.md
Normal file
6
content/de/privacy.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
layout: page.njk
|
||||
title: Datenschutz
|
||||
tags: footerNav
|
||||
---
|
||||
# Datenschutz
|
6
content/de/program.md
Normal file
6
content/de/program.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
layout: page.njk
|
||||
title: Programm
|
||||
tags: mainNav
|
||||
---
|
||||
# Programm
|
3
content/en/en.json
Normal file
3
content/en/en.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"lang": "en"
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
|
||||
const { EleventyHtmlBasePlugin, EleventyI18nPlugin } = require("@11ty/eleventy");
|
||||
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
|
||||
|
||||
// update this :)
|
||||
|
@ -7,9 +7,16 @@ const year = 2024;
|
|||
module.exports = function(eleventyConfig) {
|
||||
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
|
||||
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
||||
eleventyConfig.addPlugin(EleventyI18nPlugin, {
|
||||
defaultLanguage: "de",
|
||||
});
|
||||
|
||||
eleventyConfig.addGlobalData("year", year);
|
||||
|
||||
eleventyConfig.addFilter("pageLang", function(value) {
|
||||
return value.filter(item => item.page.lang === this.page.lang)
|
||||
});
|
||||
|
||||
return {
|
||||
dir: {
|
||||
input: "content",
|
||||
|
|
Loading…
Reference in a new issue