From a74059e6d0296159f9c2af58acd3ad0ebdb07054 Mon Sep 17 00:00:00 2001 From: Zakhar Timoshenko Date: Wed, 25 Oct 2023 19:00:04 +0300 Subject: [PATCH] chore: another al test --- .vitepress/config/hooks/generateMeta.ts | 2 +- .vitepress/theme/index.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.vitepress/config/hooks/generateMeta.ts b/.vitepress/config/hooks/generateMeta.ts index 9a1e983..70bf2e0 100644 --- a/.vitepress/config/hooks/generateMeta.ts +++ b/.vitepress/config/hooks/generateMeta.ts @@ -117,7 +117,7 @@ function generateMeta(context: TransformContext, hostname: string) { head.push(["meta", { property: "al:android:url", content: "kotatsu://manga" }]) head.push(["meta", { property: "al:android:app_name", content: "Kotatsu" }]) head.push(["meta", { property: "al:android:package", content: "org.koitharu.kotatsu" }]) - head.push(["script", {}, `window.location = "kotatsu://manga"`]) + /// head.push(["script", {}, `window.location = "kotatsu://manga?${window.location.toString().split("manga/?").pop()}"`]) } return head diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 5a88542..45f6718 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -18,6 +18,9 @@ export default { watchEffect(() => { if (inBrowser) { document.cookie = `nf_lang=${lang.value}; expires=Mon, 1 Jan 2024 00:00:00 UTC; path=/` + if (document.location = "https://kotatsu.app/manga/") { + document.location = `kotatsu://manga?${window.location.toString().split("manga/?").pop()}` + } } }) },