From f3480efaae4a1ff6c4d785cb390764f0da1eaa6d Mon Sep 17 00:00:00 2001 From: randomguy-2650 <150704902+randomguy-2650@users.noreply.github.com> Date: Sun, 12 Oct 2025 11:37:36 +0200 Subject: [PATCH 01/20] Create index page: section 4 of 6 --- .../docs/de/tutorial/4-layouts/index.mdx | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/content/docs/de/tutorial/4-layouts/index.mdx diff --git a/src/content/docs/de/tutorial/4-layouts/index.mdx b/src/content/docs/de/tutorial/4-layouts/index.mdx new file mode 100644 index 0000000000000..8c102acc5b27e --- /dev/null +++ b/src/content/docs/de/tutorial/4-layouts/index.mdx @@ -0,0 +1,37 @@ +--- +type: tutorial +unitTitle: Zeit und Energie sparen mit wiederverwendbaren Seiten-Layouts +title: 'Check-in: Einheit 4 – Layouts' +description: >- + Tutorial: Erstelle deinen ersten Astro-Blog — + Verwende Astro-Layouts, um gemeinsame Elemente und Styles über deine Seiten und Blog-Beiträge hinweg zu teilen +i18nReady: true +head: + - tag: title + content: 'Blog-Tutorial erstellen: Einheit 4 – Layouts | Doku' +--- + +import Box from '~/components/tutorial/Box.astro'; +import Checklist from '~/components/Checklist.astro'; + +Jetzt, da du mit Komponenten bauen kannst, ist es Zeit, eigene Layouts zu erstellen! + +## Ein Blick nach vorne + +In dieser Einheit erstellst du Layouts, um gemeinsame Elemente und Styles über deine Seiten und Blog-Beiträge hinweg zu teilen. + +Dazu wirst du: + +- Wiederverwendbare Layout-Komponenten erstellen +- Inhalte mit `` an deine Layouts übergeben +- Daten aus Markdown-Frontmatter an deine Layouts übergeben +- Mehrere Layouts verschachteln + + + +## Checkliste + + +- [ ] Ich bin bereit, mein Seiten-Design mit Layouts auf die nächste Stufe zu bringen! + + From b241adea446f7036d67b27d98bc2a206ec89cccd Mon Sep 17 00:00:00 2001 From: randomguy-2650 <150704902+randomguy-2650@users.noreply.github.com> Date: Sun, 12 Oct 2025 11:44:54 +0200 Subject: [PATCH 02/20] Create page 1: section 4 of 6 --- src/content/docs/de/tutorial/4-layouts/1.mdx | 229 +++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 src/content/docs/de/tutorial/4-layouts/1.mdx diff --git a/src/content/docs/de/tutorial/4-layouts/1.mdx b/src/content/docs/de/tutorial/4-layouts/1.mdx new file mode 100644 index 0000000000000..86c5e77ac150f --- /dev/null +++ b/src/content/docs/de/tutorial/4-layouts/1.mdx @@ -0,0 +1,229 @@ +--- +type: tutorial +title: Erstelle dein erstes Layout +description: |- + Tutorial: Erstelle deinen ersten Astro-Blog — + Refaktoriere gemeinsame Elemente in ein wiederverwendbares Seiten-Layout +i18nReady: true +--- + +import Box from '~/components/tutorial/Box.astro'; +import Checklist from '~/components/Checklist.astro'; +import MultipleChoice from '~/components/tutorial/MultipleChoice.astro'; +import Option from '~/components/tutorial/Option.astro'; +import PreCheck from '~/components/tutorial/PreCheck.astro'; +import { Steps } from '@astrojs/starlight/components'; + + + - Refaktoriere gemeinsame Elemente in ein Seiten-Layout + - Verwende ein Astro-``-Element, um Seiteninhalte innerhalb eines Layouts zu platzieren + - Übergib seiten-spezifische Werte als Props an dein Layout + + +Du hast noch einige Astro-Komponenten, die auf jeder Seite wiederholt gerendert werden. Es ist Zeit für eine weitere Refaktorierung, um ein gemeinsames Seiten-Layout zu erstellen! + +## Erstelle deine erste Layout-Komponente + + +1. Erstelle eine neue Datei unter `src/layouts/BaseLayout.astro`. (Du musst vorher einen neuen Ordner `layouts` anlegen.) + +2. Kopiere den **gesamten Inhalt** von `index.astro` in deine neue Datei `BaseLayout.astro`. + + ```astro title="src/layouts/BaseLayout.astro" + --- + import Header from '../components/Header.astro'; + import Footer from '../components/Footer.astro'; + import '../styles/global.css'; + const pageTitle = "Startseite"; + --- + + + + + + + {pageTitle} + + +
+

{pageTitle}

+