Files
leim-maps/src/layouts/Layout.astro
2025-03-20 15:44:11 +01:00

69 lines
2.5 KiB
Plaintext

---
import { defaultLang, type Language } from '@/i18n/ui';
import { getLangFromUrl } from '@/i18n/utils';
import type { Head } from '@/types/Head';
interface Props {
title: string
head?: Head
}
const { title, head } = Astro.props;
const lang = getLangFromUrl(Astro.url) || defaultLang;
---
<!doctype html>
<html lang={lang}>
<head>
<script>
import { setLang } from "@/i18n/store";
import { defaultLang, type Language } from "@/i18n/ui";
import { getLangFromUrl } from "@/i18n/utils";
const currentLang: Language = getLangFromUrl(new URL(window.location.href)) || defaultLang;
setLang(currentLang || defaultLang);
</script>
<meta charset="UTF-8" />
<meta name="author" content="Alexis Pelé" />
{head?.description && <meta name="description" content={head.description} /> }
<meta name="viewport" content="width=device-width; initial-scale=1" />
<meta name="generator" content={Astro.generator} />
<title>{title} — Leim Wiki</title>
<link rel="canonical" href={Astro.url}>
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#6595b4">
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="theme-color" content="#a9d1eb">
<meta property="og:title" content={title} />
<meta property="og:type" content="website" />
<meta property="og:url" content={Astro.url} />
{head?.image && <meta property="og:image" content={head.image} />}
{head?.description && <meta name="twitter:description" content={head.description} /> }
{head?.image && <meta property="twitter:image" content={head.image} />}
<link rel="stylesheet" href="/leaflet/leaflet.css" rel="preload" />
<script is:inline src="/leaflet/leaflet.js" />
<script is:inline type="text/javascript" src="/js/leaflet-zoomify.min.js"></script>
<link rel="stylesheet" href="/leaflet-measure/leaflet-measure.css" rel="preload" />
<script is:inline type="text/javascript" src="/js/leaflet-measure.min.js"></script>
</head>
<body>
<slot />
</body>
</html>
<style lang="scss" is:global>
@use '../assets/scss/theme.scss';
</style>