blog: keep a scheduled post hidden on its own URL - #5689
Open
dimitrieh wants to merge 1 commit into
Open
Conversation
A future-dated post is left out of the prerender set, so its URL is served by the deployed Netlify function instead of a static file. Netlify passes only URL, SITE_NAME and SITE_ID to a function at runtime, so the process.env.CONTEXT read in isFuturePost was always undefined there, the check switched itself off, and the post rendered in full before its date. Take the production flag from runtimeConfig, which is captured at build time where CONTEXT is set, and move it under public so the same value is available wherever the check runs. Deploy previews and local dev are unaffected: their builds capture a non-production context, exactly as before.
Contributor
Author
|
I checked out functionality for posting things in the future, while being merged. We have a small discrepancy that this PR fixes. See body description of the PR. |
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
KristopherLeads
approved these changes
Aug 27, 2026
Contributor
Author
|
@KristopherLeads let's hold off on this until next week, and test it out on production with a before test blogpost and and after test blogpost, that we both delete after. |
Yndira-E
approved these changes
Aug 28, 2026
Contributor
|
I'll leave the merge to you since you want to delay it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
A blog post dated in the future is kept out of the blog list, the feed and the sitemap until that date passes. Opening its link directly still served the whole post. This change makes that link return page not found until the date passes, so a scheduled post is unpublished everywhere rather than almost everywhere.
Review flow is unchanged. A scheduled post is still fully visible on a pull request preview and when working locally, which is how it gets read before its date.
Only the live site behaves differently, so the change can be confirmed after merge by dating a throwaway post for tomorrow and opening its link.
Related Issue(s)
None.
Checklist