From 6e3540c5317a997be84bcecb1d7d0f702df994d0 Mon Sep 17 00:00:00 2001 From: Jonas Wanke Date: Sat, 16 Nov 2024 17:50:02 +0100 Subject: [PATCH] Add YouTube redirect --- src/layouts/Layout.astro | 1 + src/layouts/Redirect.astro | 30 ++++++++++++++++++++++++++++++ src/pages/youtube.astro | 5 +++++ 3 files changed, 36 insertions(+) create mode 100644 src/layouts/Redirect.astro create mode 100644 src/pages/youtube.astro diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 14539cc..e883b41 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -40,6 +40,7 @@ const localeDescription = /> )) } +
diff --git a/src/layouts/Redirect.astro b/src/layouts/Redirect.astro new file mode 100644 index 0000000..2f5fc28 --- /dev/null +++ b/src/layouts/Redirect.astro @@ -0,0 +1,30 @@ +--- +import Link from "~/components/Link.astro"; +import { getLangFromUrl, useTranslations } from "~/i18n"; +import Layout from "./Layout.astro"; + +interface Props { + title?: string; + url: string; +} + +const { title, url } = Astro.props; + +const lang = getLangFromUrl(Astro.url); +const t = useTranslations(lang); +--- + + + +
+

+ { + t({ + de: "Falls du nicht automatisch weitergeleitet wirst, klicke bitte auf diesen Link:", + en: "If you are not automatically redirected, please click on this link:", + }) + } + {url} +

+
+
diff --git a/src/pages/youtube.astro b/src/pages/youtube.astro new file mode 100644 index 0000000..ea77090 --- /dev/null +++ b/src/pages/youtube.astro @@ -0,0 +1,5 @@ +--- +import Redirect from "../layouts/Redirect.astro"; +--- + +