From bf720b79ee3e269ab36f35d5cfbc3f0aef9cdba5 Mon Sep 17 00:00:00 2001 From: Alexander Daichendt Date: Mon, 30 Jun 2025 17:58:41 +0200 Subject: [PATCH 1/8] fix: cleanup component structure --- src/components/Footer.astro | 14 - src/components/ImpressumContent.astro | 275 ++++++++++++++++++ src/components/Logo.astro | 168 +++++++++++ src/components/NavMenu.astro | 85 ------ src/components/PageHeadline.astro | 22 ++ src/components/{ => nav}/DarkModeToggle.astro | 0 src/components/nav/DesktopNav.astro | 22 ++ src/components/nav/Footer.astro | 39 +++ src/components/nav/MobileNav.astro | 40 +++ src/components/nav/MobileNavDrawer.astro | 130 +++++++++ src/components/nav/TopHeader.astro | 41 +++ src/layouts/BaseLayout.astro | 66 ++--- src/pages/blog/index.astro | 3 +- .../{contact.astro => contact/index.astro} | 4 +- src/pages/impressum/index.astro | 34 +++ src/pages/index.astro | 10 +- src/pages/projects/index.astro | 4 +- src/pages/publications.astro | 97 ------ src/pages/publications/index.astro | 95 ++++++ 19 files changed, 899 insertions(+), 250 deletions(-) delete mode 100644 src/components/Footer.astro create mode 100644 src/components/ImpressumContent.astro create mode 100644 src/components/Logo.astro delete mode 100644 src/components/NavMenu.astro create mode 100644 src/components/PageHeadline.astro rename src/components/{ => nav}/DarkModeToggle.astro (100%) create mode 100644 src/components/nav/DesktopNav.astro create mode 100644 src/components/nav/Footer.astro create mode 100644 src/components/nav/MobileNav.astro create mode 100644 src/components/nav/MobileNavDrawer.astro create mode 100644 src/components/nav/TopHeader.astro rename src/pages/{contact.astro => contact/index.astro} (96%) create mode 100644 src/pages/impressum/index.astro delete mode 100644 src/pages/publications.astro create mode 100644 src/pages/publications/index.astro diff --git a/src/components/Footer.astro b/src/components/Footer.astro deleted file mode 100644 index 6cee9c2..0000000 --- a/src/components/Footer.astro +++ /dev/null @@ -1,14 +0,0 @@ ---- -const today = new Date(); ---- - - - diff --git a/src/components/ImpressumContent.astro b/src/components/ImpressumContent.astro new file mode 100644 index 0000000..b142439 --- /dev/null +++ b/src/components/ImpressumContent.astro @@ -0,0 +1,275 @@ +--- +interface Props { + companyName?: string; + ownerName?: string; + address?: { + street?: string; + city?: string; + postalCode?: string; + country?: string; + }; + contact?: { + phone?: string; + email: string; + website: string; + }; + business?: { + vatId?: string; + registrationOffice?: string; + }; + responsiblePerson?: { + name: string; + address: { + street: string; + city: string; + postalCode: string; + country: string; + }; + }; +} + +const { + companyName, + ownerName, + address, + contact, + business, + responsiblePerson, +} = Astro.props; +--- + +
+
+

+ Diensteanbieter +

+
+
+
Firmenname:
+
+ {companyName} +
+
+
+
Inhaber:
+
+ {ownerName} +
+
+
+
Anschrift:
+
+ {address?.street}
+ {address?.postalCode} + {address?.city}
+ {address?.country} +
+
+
+
+ + +
+

+ Kontaktdaten +

+
+ { + contact?.phone && ( +
+
+ Telefon: +
+
+ {contact?.phone} +
+
+ ) + } +
+
E-Mail:
+
+ + {contact?.email} + +
+
+
+
Website:
+
+ + {contact?.website} + +
+
+
+
+ + + { + (business?.vatId || business?.registrationOffice) && ( +
+

+ Gewerbliche Angaben +

+
+ {business?.vatId && ( +
+
+ Umsatzsteuer-ID: +
+
+ {business.vatId} +
+ + gemäß § 27a Umsatzsteuergesetz + +
+
+ )} + {business.registrationOffice && ( +
+
+ Gewerbeanmeldung: +
+
+ {business?.registrationOffice} +
+
+ )} +
+
+ ) + } + + +
+

+ Verantwortlich für den Inhalt +

+
+
+ Verantwortlich nach § 55 Abs. 2 RStV: +
+
+ {responsiblePerson?.name}
+ {responsiblePerson?.address.street}
+ {responsiblePerson?.address.postalCode} + {responsiblePerson?.address.city}
+ {responsiblePerson?.address.country} +
+
+
+ + +
+

+ EU-Streitschlichtung +

+
+
+
+ Online-Streitbeilegung: +
+
+ Die Europäische Kommission stellt eine Plattform zur + Online-Streitbeilegung (OS) bereit:
+ + https://ec.europa.eu/consumers/odr/ + +
+
+
+
+ Verbraucherschlichtung: +
+
+ Wir sind nicht bereit oder verpflichtet, an Streitbeilegungsverfahren + vor einer Verbraucherschlichtungsstelle teilzunehmen. +
+
+
+
+ + +
+

+ Haftungsausschluss +

+ + +
+

+ Haftung für Inhalte +

+

+ Als Diensteanbieter sind wir gemäß § 7 Abs.1 TMG für eigene Inhalte auf + diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 + bis 10 TMG sind wir als Diensteanbieter jedoch nicht unter der + Verpflichtung, übermittelte oder gespeicherte fremde Informationen zu + überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige + Tätigkeit hinweisen. +

+
+ + +
+

+ Haftung für Links +

+

+ Unser Angebot enthält Links zu externen Websites Dritter, auf deren + Inhalte wir keinen Einfluss haben. Deshalb können wir für diese fremden + Inhalte auch keine Gewähr übernehmen. Für die Inhalte der verlinkten + Seiten ist stets der jeweilige Anbieter oder Betreiber der Seiten + verantwortlich. +

+
+ + +
+

+ Urheberrecht +

+

+ Die durch die Seitenbetreiber erstellten Inhalte und Werke auf diesen + Seiten unterliegen dem deutschen Urheberrecht. Die Vervielfältigung, + Bearbeitung, Verbreitung und jede Art der Verwertung außerhalb der + Grenzen des Urheberrechtes bedürfen der schriftlichen Zustimmung des + jeweiligen Autors bzw. Erstellers. +

+
+
+ + +
+

+ Letzte Aktualisierung: + {new Date().toLocaleDateString("de-DE")} + +

+
+
diff --git a/src/components/Logo.astro b/src/components/Logo.astro new file mode 100644 index 0000000..4c193a0 --- /dev/null +++ b/src/components/Logo.astro @@ -0,0 +1,168 @@ + + + diff --git a/src/components/NavMenu.astro b/src/components/NavMenu.astro deleted file mode 100644 index ab9e47e..0000000 --- a/src/components/NavMenu.astro +++ /dev/null @@ -1,85 +0,0 @@ ---- -import { Icon } from "astro-icon/components"; -import HeaderLink from "./HeaderLink.astro"; ---- - - - - -
-
- Home - Blog - Projects - Publications - Contact -
-
- - diff --git a/src/components/PageHeadline.astro b/src/components/PageHeadline.astro new file mode 100644 index 0000000..ff9d5f3 --- /dev/null +++ b/src/components/PageHeadline.astro @@ -0,0 +1,22 @@ +--- +interface Props { + title: string; + subtitle?: string; +} + +const { title, subtitle } = Astro.props; +--- + +
+

+ {title} +

+ { + subtitle && ( +

+ {subtitle} +

+ ) + } +
+
diff --git a/src/components/DarkModeToggle.astro b/src/components/nav/DarkModeToggle.astro similarity index 100% rename from src/components/DarkModeToggle.astro rename to src/components/nav/DarkModeToggle.astro diff --git a/src/components/nav/DesktopNav.astro b/src/components/nav/DesktopNav.astro new file mode 100644 index 0000000..9033326 --- /dev/null +++ b/src/components/nav/DesktopNav.astro @@ -0,0 +1,22 @@ +--- +import HeaderLink from "../HeaderLink.astro"; + +export const navItems = [ + { href: "/", label: "Home" }, + { href: "/blog", label: "Blog" }, + { href: "/projects", label: "Projects" }, + { href: "/publications", label: "Publications" }, + { href: "/contact", label: "Contact" }, +]; +--- + + + diff --git a/src/components/nav/Footer.astro b/src/components/nav/Footer.astro new file mode 100644 index 0000000..b821399 --- /dev/null +++ b/src/components/nav/Footer.astro @@ -0,0 +1,39 @@ +--- +const today = new Date(); +const lastUpdated = new Date(); // You can set this to a specific date or pull from your build process +--- + + diff --git a/src/components/nav/MobileNav.astro b/src/components/nav/MobileNav.astro new file mode 100644 index 0000000..cfd76a4 --- /dev/null +++ b/src/components/nav/MobileNav.astro @@ -0,0 +1,40 @@ +--- + +--- + + +
+ +
+ + diff --git a/src/components/nav/MobileNavDrawer.astro b/src/components/nav/MobileNavDrawer.astro new file mode 100644 index 0000000..b2c3763 --- /dev/null +++ b/src/components/nav/MobileNavDrawer.astro @@ -0,0 +1,130 @@ +--- +import { navItems } from "./DesktopNav.astro"; +import HeaderLink from "../HeaderLink.astro"; +import DarkModeToggle from "./DarkModeToggle.astro"; +--- + + +
+ +
+
+ + + +
+ diff --git a/src/components/nav/TopHeader.astro b/src/components/nav/TopHeader.astro new file mode 100644 index 0000000..cfcd139 --- /dev/null +++ b/src/components/nav/TopHeader.astro @@ -0,0 +1,41 @@ +--- +import DarkModeToggle from "./DarkModeToggle.astro"; +import DesktopNav from "./DesktopNav.astro"; +import Logo from "../Logo.astro"; +import MobileNav from "./MobileNav.astro"; +--- + +
+
+
+ +

+ + + +

+ + +
+
+ + +
+
+ + +
+ + + + + +
+
+
+
diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index f36ae67..5388731 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -1,18 +1,24 @@ --- import BaseHead from "../components/BaseHead.astro"; -import NavMenu from "../components/NavMenu.astro"; -import Footer from "../components/Footer.astro"; +import Footer from "../components/nav/Footer.astro"; import { SITE_TITLE, SITE_DESCRIPTION } from "../consts"; -import DarkModeToggle from "../components/DarkModeToggle.astro"; import "@fontsource/ubuntu"; import "@fontsource/ubuntu/700.css"; +import TopHeader from "../components/nav/TopHeader.astro"; +import PageHeadline from "../components/PageHeadline.astro"; +import MobileNavDrawer from "../components/nav/MobileNavDrawer.astro"; interface Props { title?: string; description?: string; + subtitle?: string; } -const { title = SITE_TITLE, description = SITE_DESCRIPTION } = Astro.props; +const { + title = SITE_TITLE, + description = SITE_DESCRIPTION, + subtitle, +} = Astro.props; --- @@ -20,7 +26,7 @@ const { title = SITE_TITLE, description = SITE_DESCRIPTION } = Astro.props; - - -
-
-

- {SITE_TITLE} -

-
- - -
-
-
+ + + + + + + + +
+
+ -
-
- - - +