-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
i18n(de): tutorial #12502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
louisescher
wants to merge
69
commits into
main
Choose a base branch
from
de/tutorial
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+891
−59
Draft
i18n(de): tutorial #12502
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
6eb9f7d
i18n(de): translate 0-introduction/index to German (#7734)
josefineschaefer 34bae56
i18n(de): add 1-setup to german blog tutorial (#7602)
josefineschaefer fbf98d2
i18n(de): add `tutorial/3-components/index` (#7795)
Maxframe 00841cd
i18n(de): add `tutorial/3-components/1` (#7796)
Maxframe 5c184bb
Add missing fragment
yanthomasdev 56763fa
Merge branch 'main' into de/tutorial
yanthomasdev 49e91dd
i18n(de): add `tutorial/3-components/3` (#7975)
Maxframe 4503baf
i18n(de): add `tutorial/3-components/2` (#7885)
Maxframe e23730c
Merge branch 'main' into de/tutorial
yanthomasdev b040220
i18n(de): add `tutorial/3-components/4` (#8365)
Maxframe be0c774
Merge branch 'main' into de/tutorial
delucis d126213
Merge branch 'main' into de/tutorial
louisescher 7d9e81a
chore: Remove partial translations in preparation for new ones
louisescher 0251115
Update src/content/docs/de/tutorial/3-components/4.mdx
louisescher eb6b8d3
Update src/content/docs/de/tutorial/3-components/4.mdx
louisescher e5e8bd2
Apply suggestion from @randomguy-2650
louisescher ea446f0
Apply suggestion from @randomguy-2650
louisescher 105e265
Apply suggestion from @randomguy-2650
louisescher 10e3171
Apply suggestion from @randomguy-2650
louisescher ad860e9
Apply suggestion from @randomguy-2650
louisescher 3d23ea7
Apply suggestion from @randomguy-2650
louisescher d598ea6
Apply suggestion from @randomguy-2650
louisescher 2699a30
Apply suggestion from @randomguy-2650
louisescher 4485e15
Apply suggestion from @randomguy-2650
louisescher 994ec2a
Apply suggestion from @randomguy-2650
louisescher 883797d
Apply suggestion from @randomguy-2650
louisescher 97c64aa
Apply suggestion from @randomguy-2650
louisescher 5dc8f11
Apply suggestion from @randomguy-2650
louisescher b543ad6
Update src/content/docs/de/tutorial/3-components/4.mdx
louisescher 6c9be41
Update src/content/docs/de/tutorial/3-components/4.mdx
louisescher e179e6c
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 62479a5
Update src/content/docs/de/tutorial/3-components/1.mdx
louisescher d900679
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher b8b25ad
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher a3330d0
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 58ea258
Update src/content/docs/de/tutorial/3-components/4.mdx
louisescher 330ffe9
Update src/content/docs/de/tutorial/3-components/1.mdx
louisescher bf07125
Update src/content/docs/de/tutorial/3-components/4.mdx
louisescher 566fc4c
Update src/content/docs/de/tutorial/3-components/index.mdx
louisescher 793bf10
Update src/content/docs/de/tutorial/3-components/index.mdx
louisescher 7894985
Update src/content/docs/de/tutorial/3-components/index.mdx
louisescher 3fc47f5
Update src/content/docs/de/tutorial/3-components/1.mdx
louisescher 7eb9d2a
Update src/content/docs/de/tutorial/3-components/1.mdx
louisescher f7acb88
Update src/content/docs/de/tutorial/3-components/1.mdx
louisescher d17d5ec
Update src/content/docs/de/tutorial/3-components/1.mdx
louisescher de45193
Update src/content/docs/de/tutorial/3-components/1.mdx
louisescher 4390bac
Update src/content/docs/de/tutorial/3-components/2.mdx
louisescher 555ab68
Update src/content/docs/de/tutorial/3-components/2.mdx
louisescher 7baad00
Update src/content/docs/de/tutorial/3-components/2.mdx
louisescher a538812
Update src/content/docs/de/tutorial/3-components/2.mdx
louisescher 3eb0cc5
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher f7c5d01
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher ac81d57
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 9f95691
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 0ff7fdb
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 35cea00
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 70f0bb0
Update src/content/docs/de/tutorial/3-components/4.mdx
louisescher 8a5dae9
Update src/content/docs/de/tutorial/3-components/4.mdx
louisescher 5879616
Update src/content/docs/de/tutorial/3-components/4.mdx
louisescher afe342c
Update src/content/docs/de/tutorial/3-components/index.mdx
louisescher b199ad2
Update src/content/docs/de/tutorial/3-components/index.mdx
louisescher 6c09a3c
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 3d6f1f8
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 27f257f
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 53cafeb
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 92d4d4c
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 03ebe4d
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher db72b4d
Update src/content/docs/de/tutorial/3-components/3.mdx
louisescher 55f9d47
i18n(de): update section 3 blog tutorial (#12515)
trueberryless File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
--- | ||
type: tutorial | ||
title: Erstelle eine wiederverwendbare Navigationskomponente | ||
description: |- | ||
Tutorial: Baue deinen ersten Astro-Blog — | ||
Ersetze Elemente, die auf mehreren Seiten wiederholt werden, durch eine wiederverwendbare Komponente | ||
i18nReady: true | ||
--- | ||
|
||
import Badge from '~/components/Badge.astro'; | ||
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'; | ||
|
||
Nun, da du denselben HTML-Code auf mehreren Seiten deiner Astro-Website wiederholt hast, ist es an der Zeit, diesen doppelten Inhalt durch eine wiederverwendbare Astro-Komponente zu ersetzen! | ||
|
||
<PreCheck> | ||
- Erstelle einen neuen Ordner für Komponenten | ||
- Baue eine Astro-Komponente, um deine Navigationslinks anzuzeigen | ||
- Ersetze den bestehenden HTML-Code durch eine neue, wiederverwendbare Navigationskomponente | ||
</PreCheck> | ||
|
||
## Erstelle einen neuen `src/components/`-Ordner | ||
|
||
Um `.astro`-Dateien aufzunehmen, die HTML generieren, aber keine neuen Seiten auf deiner Website werden, benötigst du einen neuen Ordner in deinem Projekt: `src/components/`. | ||
|
||
## Erstelle eine Navigationskomponente | ||
|
||
<Steps> | ||
1. Erstelle eine neue Datei: `src/components/Navigation.astro`. | ||
|
||
2. Kopiere deine Links für die Navigation zwischen den Seiten aus dem oberen Bereich einer beliebigen Seite und füge sie in deine neue Datei `Navigation.astro` ein: | ||
|
||
```astro title="src/components/Navigation.astro" "---" | ||
--- | ||
--- | ||
<a href="/">Home</a> | ||
<a href="/about/">Über mich</a> | ||
<a href="/blog/">Blog</a> | ||
``` | ||
:::tip | ||
Wenn im Frontmatter deiner `.astro`-Datei nichts steht, musst du auch die Code-Abgrenzung nicht schreiben. Du kannst sie jederzeit wieder hinzufügen, wenn du sie brauchst. | ||
::: | ||
</Steps> | ||
|
||
### Importieren und Verwenden von Navigation.astro | ||
|
||
<Steps> | ||
1. Gehe zurück zu `index.astro` und importiere deine neue Komponente innerhalb der Code-Abgrenzung: | ||
|
||
```astro title="src/pages/index.astro" ins={2} | ||
import "../styles/global.css"; | ||
|
||
const pageTitle = "Home Page"; | ||
--- | ||
import Navigation from '../components/Navigation.astro'; | ||
--- | ||
``` | ||
|
||
2. Ersetze dann darunter die vorhandenen Navigations-HTML-Link-Elemente durch die neu importierte Navigationskomponente: | ||
|
||
```astro title="src/pages/index.astro" del={1-3} ins={4} | ||
<a href="/">Home</a> | ||
<a href="/about/">Über mich</a> | ||
<a href="/blog/">Blog</a> | ||
<Navigation /> | ||
``` | ||
|
||
3. Überprüfe die Vorschau in deinem Browser und stelle fest, dass sie genau gleich aussehen sollte … und das ist genau das, was du erreichen wolltest! | ||
</Steps> | ||
|
||
Deine Website enthält nun denselben HTML-Code wie zuvor. Aber jetzt werden diese drei Zeilen Code durch deine `<Navigation />`-Komponente bereitgestellt. | ||
|
||
<Box icon="puzzle-piece"> | ||
|
||
## Probiere es selbst aus - Füge Navigation zum Rest deiner Website hinzu | ||
|
||
Importiere die `<Navigation />`-Komponente und verwende sie auf den anderen beiden Seiten deiner Website (`about.astro` und `blog.astro`) mit derselben Methode. | ||
|
||
Vergiss nicht, | ||
- eine Import-Anweisung am Anfang des Komponenten-Skripts, innerhalb der Code-Abgrenzung, hinzuzufügen. | ||
- den vorhandenen Code durch die Navigationskomponente zu ersetzen. | ||
|
||
</Box> | ||
|
||
:::note | ||
Wenn du deinen Code umstrukturierst, aber das Aussehen deiner Seite im Browser nicht veränderst, **refaktorisierst** du. In dieser Einheit wirst du mehrmals **refaktorisieren**, indem du Teile deines Seiten-HTMLs durch Komponenten ersetzt. | ||
|
||
Das ermöglicht es dir, schnell mit beliebigem funktionierenden Code zu beginnen, der oft in deinem Projekt dupliziert wird. Dann kannst du das Design deines bestehenden Codes schrittweise verbessern, ohne das äußere Erscheinungsbild deiner Website zu verändern. | ||
::: | ||
|
||
louisescher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<Box icon="question-mark"> | ||
|
||
### Teste dein Wissen | ||
|
||
louisescher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
1. Das kannst du tun, wenn Elemente auf mehreren Seiten wiederholt werden: | ||
<MultipleChoice> | ||
<Option> | ||
den Entwicklungs-Server neu starten | ||
</Option> | ||
<Option isCorrect> | ||
Refaktorisierung, um eine wiederverwendbare Komponente zu nutzen | ||
</Option> | ||
<Option> | ||
eine neue Seite erstellen | ||
</Option> | ||
</MultipleChoice> | ||
|
||
2. Astro-Komponenten sind: | ||
<MultipleChoice> | ||
<Option> | ||
wiederverwendbar | ||
</Option> | ||
<Option> | ||
Fragmente von HTML | ||
</Option> | ||
<Option isCorrect> | ||
beides! | ||
</Option> | ||
</MultipleChoice> | ||
|
||
3. Astro-Komponenten erstellen automatisch eine neue Seite auf deiner Website, wenn du … | ||
<MultipleChoice> | ||
<Option> | ||
`<html></html>` einfügst | ||
</Option> | ||
<Option> | ||
refaktorisierst | ||
</Option> | ||
<Option isCorrect> | ||
die `.astro`-Datei innerhalb von `src/pages/` ablegst | ||
</Option> | ||
</MultipleChoice> | ||
</Box> | ||
|
||
<Box icon="check-list"> | ||
|
||
## Checkliste | ||
|
||
<Checklist> | ||
- [ ] Ich kann Inhalte in wiederverwendbare Komponenten umwandeln. | ||
- [ ] Ich kann eine neue Komponente zu einer `.astro`-Seite hinzufügen. | ||
</Checklist> | ||
|
||
</Box> | ||
|
||
### Ressourcen | ||
|
||
- [Mehr über Astro-Komponenten](/de/basics/astro-components/) | ||
|
||
- [Refactoring](https://refactoring.com/) <Badge class="neutral-badge" text="extern" /> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.