From 0e58f488df63f2143fdc5efa9ea85b1751bf7c10 Mon Sep 17 00:00:00 2001 From: Jay V Date: Tue, 10 Jun 2025 11:52:02 -0500 Subject: moving share urls --- packages/web/src/pages/s/[id].astro | 58 ++++++++++++++++++++++++++++++++++++ packages/web/src/pages/s/index.astro | 52 -------------------------------- 2 files changed, 58 insertions(+), 52 deletions(-) create mode 100644 packages/web/src/pages/s/[id].astro delete mode 100644 packages/web/src/pages/s/index.astro (limited to 'packages/web/src/pages') diff --git a/packages/web/src/pages/s/[id].astro b/packages/web/src/pages/s/[id].astro new file mode 100644 index 000000000..523fa7e6c --- /dev/null +++ b/packages/web/src/pages/s/[id].astro @@ -0,0 +1,58 @@ +--- +import config from "virtual:starlight/user-config"; + +import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; +import Share from "../../components/Share.tsx"; + +const apiUrl = import.meta.env.VITE_API_URL; + +const { id } = Astro.params; +const res = await fetch(`${apiUrl}/share_data?id=${id}`); +const data = await res.json(); + +const title = data.info.title; +const ogImage = data.ogImage; + +--- + + + + + diff --git a/packages/web/src/pages/s/index.astro b/packages/web/src/pages/s/index.astro deleted file mode 100644 index a6b74ecde..000000000 --- a/packages/web/src/pages/s/index.astro +++ /dev/null @@ -1,52 +0,0 @@ ---- -import config from "virtual:starlight/user-config"; - -import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; -import Share from "../../components/Share.tsx"; - -const apiUrl = import.meta.env.VITE_API_URL; - -const id = Astro.url.searchParams.get('id') -const res = await fetch(`${apiUrl}/share_data?id=${id}`); -const data = await res.json(); - -const title = data.info.title; -const ogImage = data.ogImage; - ---- - - - - - -- cgit v1.2.3