WIP
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import directus from '~/lib/directus'
|
||||
|
||||
export const getServerSideProps = async () => {
|
||||
const { data: pages } = await directus.items('pages').readByQuery({
|
||||
limit: 1,
|
||||
})
|
||||
// export const getServerSideProps = async () => {
|
||||
// const { data: pages } = await directus.items('pages').readByQuery({
|
||||
// limit: 1,
|
||||
// })
|
||||
|
||||
return {
|
||||
paths: pages.map((p) => ({ params: { slug: p.slug } })),
|
||||
fallback: false, // false or "blocking"
|
||||
}
|
||||
}
|
||||
// return {
|
||||
// paths: pages.map((p) => ({ params: { slug: p.slug } })),
|
||||
// fallback: false, // false or "blocking"
|
||||
// }
|
||||
// }
|
||||
|
||||
export const getStaticProps = async ({ params }) => {
|
||||
export const getServerSideProps = async ({ params }) => {
|
||||
const { slug } = params
|
||||
|
||||
const {
|
||||
@@ -24,6 +24,9 @@ export const getStaticProps = async ({ params }) => {
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
if (!page) return { notFound: true }
|
||||
|
||||
return { props: { page } }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user