This commit is contained in:
Felix Klement committed 2026-09-18 16:04:05 +02:00
commit 4cda1ca41b
72 files changed
+8169

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
---
import '../styles/base.css';
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import { langFromUrl, switchLang, t, type Lang } from '../i18n/ui';
interface Props {
title: string;
description: string;
lang?: Lang;
ogImage?: string;
}
const lang: Lang = Astro.props.lang ?? langFromUrl(Astro.url);
const { title, description } = Astro.props;
const ui = t(lang);
const fullTitle = title === ui.meta.home.title ? title : `${title}. ${ui.meta.siteName}`;
const canonical = new URL(Astro.url.pathname, Astro.site);
const altEn = new URL(switchLang(Astro.url, 'en'), Astro.site);
const altDe = new URL(switchLang(Astro.url, 'de'), Astro.site);
---
<!doctype html>
<html lang={lang}>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{fullTitle}</title>
<meta name="description" content={description} />
<meta name="color-scheme" content="light" />
<meta name="theme-color" content="#E9E5DF" />
<link rel="canonical" href={canonical} />
<link rel="alternate" hreflang="en" href={altEn} />
<link rel="alternate" hreflang="de" href={altDe} />
<link rel="alternate" hreflang="x-default" href={altEn} />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="preload" href="/fonts/inter-tight-latin-wght-normal.woff2" as="font" type="font/woff2" crossorigin />
<meta property="og:type" content="website" />
<meta property="og:site_name" content={ui.meta.siteName} />
<meta property="og:title" content={fullTitle} />
<meta property="og:description" content={description} />
<meta property="og:url" content={canonical} />
<meta property="og:locale" content={lang === 'de' ? 'de_DE' : 'en_GB'} />
<meta name="generator" content={Astro.generator} />
<script is:inline>document.documentElement.classList.add('js');</script>
</head>
<body>
<a class="skip-link" href="#main">{ui.nav.skip}</a>
<Header lang={lang} />
<main id="main" tabindex="-1">
<slot />
</main>
<Footer lang={lang} />
</body>
</html>