From 9b2c63d92ff77ebce0f90a7be05437504422bf45 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Sat, 11 Feb 2023 23:37:12 +0100
Subject: feat: Render localized content from sanity

---
 src/routes/+layout.svelte | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'src/routes/+layout.svelte')

diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 30062ed..990dd94 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,8 +1,19 @@
 <script lang="ts">
-	import '../app.postcss';
-	import type { LayoutData } from './$types';
+	import { page } from "$app/stores";
+	import "../app.postcss";
+	import type { LayoutData } from "./$types";
+	import { locales, baseLocale } from "$i18n/i18n-util";
+	import { replaceLocaleInUrl } from "$lib/utils";
 
 	export let data: LayoutData;
 </script>
 
+<svelte:head>
+	<title>{$page.data.title || "auroraklinikken.no"}</title>
+	{#each locales as l}
+		<link rel="alternate" hreflang={l} href={`${replaceLocaleInUrl($page.url, l, true)}`} />
+	{/each}
+	<link rel="alternate" hreflang="x-default" href={`${replaceLocaleInUrl($page.url, baseLocale, true)}`} />
+</svelte:head>
+
 <slot />
-- 
cgit v1.3

