Repository navigation
Fix blog listing going empty when a post is scheduled - #6041
Open
sumitshinde-84 wants to merge 2 commits into
Open
sumitshinde-84 wants to merge 2 commits into
sumitshinde-84 wants to merge 2 commits into
Conversation
isFuturePost() called useRuntimeConfig() only for future-dated posts, and several callers run it inside useAsyncData after an await, where there is no Nuxt instance. The call threw, the blog listing came back empty, and the nav's /blog/#sign-up anchor broke the link check on every page. Read the production flag in setup via useIsFuturePost() and pass it in. Also leave scheduled posts out of the post page's related-posts payload.
5 tasks
A heading that starts with an emoji ("🇬🇧 Overview (English)") slugs to
"-overview-english", so the README's own "#overview-english" link missed it
and failed the anchor check on /integrations/node-red-contrib-anker-solix.
✅ Deploy Preview for flowfuse-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for flowfuse-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This branch has not been deployed
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
Any future-dated (scheduled) post empties the blog listing and fails the link check. This is what's failing #6035.
isFuturePost()calleduseRuntimeConfig(), but only for future-dated posts. InuseBlogList, the author page andExploreMoreContentit runs inside auseAsyncDatacallback after anawait, where there's no Nuxt instance (NUXT_E1001), so the call throws. The listing then comes back empty, theid="sign-up"anchor that only renders with a featured post disappears, and every page linking to/blog/#sign-upfrom the nav fails the link checker (~1,360 errors).mainonly passes because no post is currently scheduled.Change
isFuturePost(date, isProductionContext)no longer calls a composable.useIsFuturePost()reads the flag in setup and returns a check that is safe to call after anawait. All four callers use it.Also fixed: integration README anchors
The anchor check was also failing on
/integrations/node-red-contrib-anker-solix. Its README headings start with a flag emoji ("🇬🇧 Overview (English)"), which slugs to-overview-english, so the README's own#overview-englishlink missed it.rewriteIntegrationLinksalready repairs links that differ from a heading ID only by dots; it now also ignores a leading or trailing hyphen.