The page context doesn't work for unpublished pages - the post context is used when previewing unpublished pages instead.
Additionally, unpublished pages when previewed also incorrectly display the default members CTA.

The problem is that we're not aware if the resource is a post or a page when we render the preview at this point:
There is an old todo about figuring out how to know which type of resource to preview:
To add a little more context to the problem. The template is picked based on the shape of the object that is passed down to template renderer:
https://github.com/TryGhost/Ghost/blob/4ef019d88d1c65d15d79b9c720f45218ea34e143/core/frontend/services/routing/helpers/templates.js#L187
And currently it is always of following shape:
{
post: post
}
The key part from above is:
* In the future, we should return {page: entry} or {post:entry).
* But for now, we would break the themes if we just change it.
Suggesting there are theme layer breaking changes to consider when trying to solve post vs page distinguishing problem.
This issue is related to https://github.com/TryGhost/Ghost/issues/10042.
I've checked the full lifecycle of the request and it looks like we loose the page/post type attribute at the serialization stage
Before serialization, there is a type attribute in the response object. I think one viable option is to keep this type attribute during the serialization
@matthanley The fix is now in master :white_check_mark:
@matthanley this fix landed in ghost 3.40.0
Most helpful comment
@matthanley The fix is now in master :white_check_mark: