Meta titles and desc
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Box, Heading } from '@chakra-ui/react'
|
||||
import Head from 'next/head'
|
||||
|
||||
export const getStaticPaths = async () => {
|
||||
const url = new URL(`${process.env.NEXT_PUBLIC_DIRECTUS_API_URL}/items/pages`)
|
||||
@@ -26,12 +27,13 @@ export const getStaticProps = async ({ params: { slug } }) => {
|
||||
data: [page],
|
||||
} = await res.json()
|
||||
|
||||
return { props: page }
|
||||
return { props: { page } }
|
||||
}
|
||||
|
||||
export default function Page(page) {
|
||||
export default function Page({ globals, page }) {
|
||||
return (
|
||||
<Box className="page">
|
||||
<Head>{page.title && <title>{[page.title, globals.meta_title].join(' — ')}</title>}</Head>
|
||||
<Heading>{page.title}</Heading>
|
||||
<div dangerouslySetInnerHTML={{ __html: page.content }}></div>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user