opencode/packages/web/src/pages/s/index.astro

53 lines
1.2 KiB
Plaintext

---
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;
---
<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 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>