You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
I want to preview an automatically generated page that matches the pattern /article/:uid. The page is unpublished and I am trying to access it on localhost.
Previewing the same page on my staging site works fine, the page is accessible under /article?uid=baz. But when previewing it on localhost, I am routed to /article/baz. This results in an error since this page is not published.
Steps to Reproduce
Add the following snippet in your gatsby-config.js (together with other settings):
exportconstlinkResolver=doc=>{if(doc.type==='article'){return`/article/${doc.uid}`}if(doc.type==='page'){return`/${doc.uid}`}// Backup for all other typesreturn'/'}
Expected behavior:
Unpublished article pages should accessible for preview on localhost under /article?uid=baz.
Actual behavior:
Unpublished article page is not accessible for preview on localhost.
when I had top level page created i.e. localhost://article , I was not able to preview the unpublished document . but when I removed article page , it worked for me . Though i need the top level page to be created.
Description
I want to preview an automatically generated page that matches the pattern
/article/:uid
. The page is unpublished and I am trying to access it onlocalhost
.Previewing the same page on my staging site works fine, the page is accessible under
/article?uid=baz
. But when previewing it on localhost, I am routed to/article/baz
. This results in an error since this page is not published.Steps to Reproduce
Add the following snippet in your
gatsby-config.js
(together with other settings):And in your
linkResolver.js
:Expected behavior:
Unpublished article pages should accessible for preview on localhost under
/article?uid=baz
.Actual behavior:
Unpublished article page is not accessible for preview on localhost.
Versions
The text was updated successfully, but these errors were encountered: