Skip to content

Commit

Permalink
Merge pull request #308 from blz-it/add-youtube-redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasWanke authored Nov 16, 2024
2 parents e98d36b + 6e3540c commit 1dcc73b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const localeDescription =
/>
))
}
<slot name="head" />
</head>
<body class="flex min-h-screen flex-col">
<Header />
Expand Down
30 changes: 30 additions & 0 deletions src/layouts/Redirect.astro
Original file line number Diff line number Diff line change
@@ -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);
---

<Layout title={title}>
<meta slot="head" http-equiv="refresh" content={`0; url=${url}`} />
<div class="mx-4 sm:mx-auto sm:max-w-xl sm:space-y-4 lg:max-w-5xl">
<p>
{
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:",
})
}
<Link href={url}>{url}</Link>
</p>
</div>
</Layout>
5 changes: 5 additions & 0 deletions src/pages/youtube.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
import Redirect from "../layouts/Redirect.astro";
---

<Redirect url="https://youtube.de/@GermanITSkills" />

0 comments on commit 1dcc73b

Please sign in to comment.