From 61415ce5a767c57971f674c78bc1daaa2620eba7 Mon Sep 17 00:00:00 2001 From: Lyn Fugmann Date: Sat, 14 Sep 2024 10:59:22 +0200 Subject: [PATCH] setup i18n --- _includes/footer.njk | 2 +- _includes/header.njk | 4 ++-- content/de/accessibility.md | 6 ++++++ content/de/campus.md | 7 +++++++ content/de/de.json | 3 +++ content/de/faq.md | 6 ++++++ content/de/first-steps.md | 7 +++++++ content/de/guidelines.md | 6 ++++++ content/de/imprint.md | 6 ++++++ content/de/index.md | 4 ++++ content/de/privacy.md | 6 ++++++ content/de/program.md | 6 ++++++ content/{ => en}/accessibility.md | 0 content/{ => en}/campus.md | 0 content/en/en.json | 3 +++ content/{ => en}/faq.md | 0 content/{ => en}/first-steps.md | 0 content/{ => en}/guidelines.md | 0 content/{ => en}/imprint.md | 0 content/{ => en}/index.md | 0 content/{ => en}/privacy.md | 0 content/{ => en}/program.md | 0 eleventy.config.js | 9 ++++++++- 23 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 content/de/accessibility.md create mode 100644 content/de/campus.md create mode 100644 content/de/de.json create mode 100644 content/de/faq.md create mode 100644 content/de/first-steps.md create mode 100644 content/de/guidelines.md create mode 100644 content/de/imprint.md create mode 100644 content/de/index.md create mode 100644 content/de/privacy.md create mode 100644 content/de/program.md rename content/{ => en}/accessibility.md (100%) rename content/{ => en}/campus.md (100%) create mode 100644 content/en/en.json rename content/{ => en}/faq.md (100%) rename content/{ => en}/first-steps.md (100%) rename content/{ => en}/guidelines.md (100%) rename content/{ => en}/imprint.md (100%) rename content/{ => en}/index.md (100%) rename content/{ => en}/privacy.md (100%) rename content/{ => en}/program.md (100%) diff --git a/_includes/footer.njk b/_includes/footer.njk index 36d8766..5cd1698 100644 --- a/_includes/footer.njk +++ b/_includes/footer.njk @@ -2,7 +2,7 @@
[language switcher]
diff --git a/_includes/header.njk b/_includes/header.njk index 4519008..8e809ff 100644 --- a/_includes/header.njk +++ b/_includes/header.njk @@ -1,6 +1,6 @@
- ESE Logo + ESE Logo
diff --git a/content/de/accessibility.md b/content/de/accessibility.md new file mode 100644 index 0000000..9efd435 --- /dev/null +++ b/content/de/accessibility.md @@ -0,0 +1,6 @@ +--- +layout: page.njk +title: Barrierefreiheit +tags: footerNav +--- +# Barrierefreiheit diff --git a/content/de/campus.md b/content/de/campus.md new file mode 100644 index 0000000..031c07d --- /dev/null +++ b/content/de/campus.md @@ -0,0 +1,7 @@ +--- +layout: page.njk +title: Campus & Fakultät +tags: mainNav +--- +# Campus & Fakultät + diff --git a/content/de/de.json b/content/de/de.json new file mode 100644 index 0000000..8885221 --- /dev/null +++ b/content/de/de.json @@ -0,0 +1,3 @@ +{ + "lang": "de" +} diff --git a/content/de/faq.md b/content/de/faq.md new file mode 100644 index 0000000..99445f7 --- /dev/null +++ b/content/de/faq.md @@ -0,0 +1,6 @@ +--- +layout: page.njk +title: FAQ +tags: mainNav +--- +# Häufig gestellte Fragen diff --git a/content/de/first-steps.md b/content/de/first-steps.md new file mode 100644 index 0000000..4f8a3e4 --- /dev/null +++ b/content/de/first-steps.md @@ -0,0 +1,7 @@ +--- +layout: page.njk +title: Erste Schritte +tags: mainNav +--- +# Erste Schritte + diff --git a/content/de/guidelines.md b/content/de/guidelines.md new file mode 100644 index 0000000..a05f14d --- /dev/null +++ b/content/de/guidelines.md @@ -0,0 +1,6 @@ +--- +layout: page.njk +title: Community-Leitlinien +tags: footerNav +--- +# Community-Leitlinien diff --git a/content/de/imprint.md b/content/de/imprint.md new file mode 100644 index 0000000..a1be408 --- /dev/null +++ b/content/de/imprint.md @@ -0,0 +1,6 @@ +--- +layout: page.njk +title: Impressum +tags: footerNav +--- +# Impressum diff --git a/content/de/index.md b/content/de/index.md new file mode 100644 index 0000000..02b2c22 --- /dev/null +++ b/content/de/index.md @@ -0,0 +1,4 @@ +--- +layout: page.njk +--- +# Hallo Welt :) diff --git a/content/de/privacy.md b/content/de/privacy.md new file mode 100644 index 0000000..04a4fe1 --- /dev/null +++ b/content/de/privacy.md @@ -0,0 +1,6 @@ +--- +layout: page.njk +title: Datenschutz +tags: footerNav +--- +# Datenschutz diff --git a/content/de/program.md b/content/de/program.md new file mode 100644 index 0000000..88d9187 --- /dev/null +++ b/content/de/program.md @@ -0,0 +1,6 @@ +--- +layout: page.njk +title: Programm +tags: mainNav +--- +# Programm diff --git a/content/accessibility.md b/content/en/accessibility.md similarity index 100% rename from content/accessibility.md rename to content/en/accessibility.md diff --git a/content/campus.md b/content/en/campus.md similarity index 100% rename from content/campus.md rename to content/en/campus.md diff --git a/content/en/en.json b/content/en/en.json new file mode 100644 index 0000000..e791844 --- /dev/null +++ b/content/en/en.json @@ -0,0 +1,3 @@ +{ + "lang": "en" +} diff --git a/content/faq.md b/content/en/faq.md similarity index 100% rename from content/faq.md rename to content/en/faq.md diff --git a/content/first-steps.md b/content/en/first-steps.md similarity index 100% rename from content/first-steps.md rename to content/en/first-steps.md diff --git a/content/guidelines.md b/content/en/guidelines.md similarity index 100% rename from content/guidelines.md rename to content/en/guidelines.md diff --git a/content/imprint.md b/content/en/imprint.md similarity index 100% rename from content/imprint.md rename to content/en/imprint.md diff --git a/content/index.md b/content/en/index.md similarity index 100% rename from content/index.md rename to content/en/index.md diff --git a/content/privacy.md b/content/en/privacy.md similarity index 100% rename from content/privacy.md rename to content/en/privacy.md diff --git a/content/program.md b/content/en/program.md similarity index 100% rename from content/program.md rename to content/en/program.md diff --git a/eleventy.config.js b/eleventy.config.js index d750560..7b7aff0 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -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",