-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2d856f
commit 5dbc031
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
import Layout from '@/src/layouts/Layout.astro' | ||
import sanityFetch from '@/utils/sanity.fetch' | ||
import metadataFetch from '@/utils/metadata.fetch' | ||
import Breadcrumbs from '@/components/ui/Breadcrumbs.astro' | ||
import Components, { Components_Query, type ComponentsProps } from '@/components/Components.astro' | ||
type QueryProps = { | ||
name: string | ||
slug: string | ||
components: ComponentsProps | ||
} | ||
const page = await sanityFetch<QueryProps>({ | ||
query: ` | ||
*[_type == "Contact_Page"][0] { | ||
name, | ||
"slug": slug.current, | ||
${Components_Query} | ||
} | ||
`, | ||
}) | ||
const metadata = await metadataFetch(page.slug) | ||
--- | ||
|
||
<Layout {...metadata}> | ||
<Breadcrumbs data={[{ name: page.name, path: page.slug }]} /> | ||
<Components data={page.components} /> | ||
</Layout> |