Closed jodiedoubleday closed 4 years ago
Can you provide your linkResolver code.
I don't think you can use variables like :uid
in the previewPath
property. Maybe try this?
{
type: 'Page',
match: '/:uid/',
filter: data => data.node._meta.uid.includes('index'),
component: require.resolve('./src/templates/page.jsx'),
}
@struckm
exports.linkResolver = function linkResolver(doc) {
if (doc.type === 'blogpost') return '/blog/' + doc.uid;
if (doc.uid === 'index') return '/';
return '/' + doc.uid;
}
@mrseanbaines
I've removed the preview path but I think have the same issue.
I have a Prismic type Page with UID of Index, which just results in a white screen on the root '/' but /index/ works fine.
I need this Prismic generated page to replace pages/index.js
I think I have found the issue, generally using, I was using previewPath in a different part of the plugin which was set to '/' which was causing duplicate routes
I have 1 custom type in Prismic I want to use for all page types.
If I set the UID in Prismic to be index, localhost:9000/index works fine but localhost:9000/ (I actually get a flash of the page I want, then a white screen).
I've tried
which doesn't work. Has anyone got any suggestions on how to get this?