Publication workflow - How would you enforce SSG Preview Mode be enabled on a particular stage? #14819
Unanswered
Vadorequest
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to implement a "publication workflow" where my Customer uses the "staging" stage to preview the site as it will be released upon next build onto the production stage.
I would like to enforce the SSG Preview Mode to be enabled when navigating in my staging stage, and have it disabled in the production stage.
During development stage, I'd probably need to toggle enabled/disabled in order to test both behaviours.
It doesn't make sense with such workflow not to have the Preview Mode enabled in staging, because it'd display the site as it was last built for the staging stage, which may be very much older than the production stage. Thus, I must make sure Preview Mode is always "on" there.
How would you do that? I'm not sure if I should check in
getStaticProps
what stage is being used, and redirect the user to the API endpoint that enables the Preview Mode, or if it should be done client side, or any other way.Beta Was this translation helpful? Give feedback.
All reactions