Skip to content

Commit

Permalink
add Contact Page in Astro
Browse files Browse the repository at this point in the history
  • Loading branch information
milewskibogumil committed Nov 29, 2024
1 parent f2d856f commit 5dbc031
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions apps/astro/src/pages/pl/kontakt.astro
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>

0 comments on commit 5dbc031

Please sign in to comment.