moving share urls

This commit is contained in:
Jay V
2025-06-10 11:52:02 -05:00
parent fa7416687b
commit 0e58f488df
2 changed files with 11 additions and 3 deletions

View File

@@ -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;
---
<StarlightPage
hasSidebar={false}
frontmatter={{
title: title,
pagefind: false,
template: "splash",
tableOfContents: false,
head: [
{
tag: "meta",
attrs: {
property: "og:image",
content: ogImage,
},
},
{
tag: "meta",
attrs: {
name: "twitter:image",
content: ogImage,
},
},
],
}}
>
<Share
id={id}
api={apiUrl}
info={data.info}
messages={data.messages}
client:only="solid"
/>
</StarlightPage>
<style is:global>
body > .page > .main-frame .main-pane > main > .content-panel:first-of-type {
display: none;
}
body > .page > .main-frame .main-pane > main > .content-panel + .content-panel {
border-top: none !important;
}
</style>