From 486c01a572f50c6db925ca74600ba5d4984752df Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Mon, 25 Dec 2023 00:46:05 -0800
Subject: feat(routes): route-specific head title

---
 src/lib/HeadTitle.svelte | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 src/lib/HeadTitle.svelte

(limited to 'src/lib/HeadTitle.svelte')

diff --git a/src/lib/HeadTitle.svelte b/src/lib/HeadTitle.svelte
new file mode 100644
index 00000000..892eef48
--- /dev/null
+++ b/src/lib/HeadTitle.svelte
@@ -0,0 +1,18 @@
+<script lang="ts">
+	export let route: string | undefined = undefined;
+	export let path: string | undefined = undefined;
+
+	const title = 'due.moe • 期限' + (route ? ` | ${route}` : '');
+</script>
+
+<svelte:head>
+	<!-- Facebook -->
+	<meta property="og:url" content={`https://due.moe${path}`} />
+	<meta property="og:title" content={title} />
+
+	<!-- Twitter -->
+	<meta property="twitter:url" content={`https://due.moe${path}`} />
+	<meta name="twitter:title" content={title} />
+
+	<title>{title}</title>
+</svelte:head>
-- 
cgit v1.2.3

