Skip to content

Conditional SSG #12470

Answered by brianlovin
tjdam asked this question in Help
May 4, 2020 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

SSG constructs pages at build time, so it wouldn't know about any kind of user data or authentication. So as far as I know, no, this isn't possible to SSG a user-specific bit of content (at least, not if it requires authentication).

It might be worth looking into how the Vercel folks have implemented SSG for their dashboard views: basically each internal page can load an SSG'd "skeleton" of the page. Once it mounts on the client, user access is validated and either populates the content of the skeleton, or redirects out to a login page.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tjdam
Comment options

@brianlovin
Comment options

@timneutkens
Comment options

Answer selected by timneutkens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants