3D Public Preview Initial Test
This commit is contained in:
33
src/pages/publics/[schem].astro
Normal file
33
src/pages/publics/[schem].astro
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
import {createGetStaticPaths} from "astro-i18n";
|
||||
import { getCollection, CollectionEntry } from "astro:content";
|
||||
import PageLayout from "../../layouts/PageLayout.astro";
|
||||
import PublicPreview from "@components/3d/PublicPreview.svelte";
|
||||
import { Image } from "astro:assets";
|
||||
|
||||
export const getStaticPaths = createGetStaticPaths(async () => {
|
||||
const pages = await getCollection("publics");
|
||||
|
||||
return pages.map((entry) => ({
|
||||
props: {
|
||||
schem: entry,
|
||||
},
|
||||
params: {
|
||||
schem: entry.id,
|
||||
},
|
||||
}));
|
||||
});
|
||||
|
||||
const { schem }: { schem: CollectionEntry<"publics">} = Astro.props;
|
||||
---
|
||||
|
||||
<PageLayout title={schem.data.name}>
|
||||
<h1 class="text-5xl font-bold" transition:name={schem.data.name + "-title"}>{schem.data.name}</h1>
|
||||
<PublicPreview client:idle file={schem.id}>
|
||||
<Image transition:name={schem.data.name + "-img"} src={schem.data.image} alt={schem.data.name}></Image>
|
||||
</PublicPreview>
|
||||
<p transition:name={schem.data.name + "-desc"}>{schem.data.description}</p>
|
||||
<p>
|
||||
Erbauer: {schem.data.creator.join(", ")}
|
||||
</p>
|
||||
</PageLayout>
|
||||
Reference in New Issue
Block a user