Separate posts & pages previews

This commit is contained in:
tobias
2024-06-24 13:52:06 +02:00
parent 7943ffbd55
commit 689c21b69a
3 changed files with 29 additions and 2 deletions

View File

@ -42,8 +42,10 @@ export default buildConfig({
prefillOnly: true,
},
livePreview: {
url: ({ data, locale }) =>
`${process.env.BASE_URL}/preview${data.path}${locale ? `?locale=${locale.code}` : ''}`,
url: ({ data, locale, collectionConfig }) =>
`${process.env.BASE_URL}/${collectionConfig?.slug || ''}/preview${data.path}${
locale ? `?locale=${locale.code}` : ''
}`,
collections: [COLLECTION_SLUG_PAGE, COLLECTION_SLUG_POST],
},
},