fix: mark generated 404 page as unlisted - #2528
Open
paulTroster wants to merge 1 commit into
Open
paulTroster wants to merge 1 commit into
paulTroster wants to merge 1 commit into
Conversation
The core-generated 404 page never set the `unlisted` flag on its vfile data, so any plugin that relies on `unlisted` to exclude pages from listings (recent-notes, content-index/search, sitemap, RSS) would incorrectly include the error page. Unlike tag/folder index pages, which some users may legitimately want listed, there's no scenario where the 404 page should appear in search results, feeds, or "recent posts" widgets. Other synthetic/ non-content pages (drafts, encrypted pages, explicitly unlisted notes) already rely on this same `unlisted` flag, so this brings the 404 page type in line with that existing convention. Repro: enable @quartz-community/recent-notes with a single content page and no other config changes - the generated "Not Found" page shows up in the recent notes list.
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Contributor
There was a problem hiding this comment.
Pull request overview
Ensures the core-generated 404 page is excluded from discovery/listing surfaces by marking it as unlisted in its vfile data, aligning it with the existing file.data.unlisted convention used by listing-aware plugins.
Changes:
- Set
unlisted: truewhen creating the 404 page’sdefaultProcessedContentvfile data so downstream consumers can filter it out.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch was successfully 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.
Summary
The core-generated 404 page (
quartz/plugins/pageTypes/404.ts) never sets theunlistedflag on its vfile data. Any plugin that relies onunlistedto exclude pages from listings likecontent-index(search, sitemap, RSS) and@quartz-community/recent-notesends up including the error page.Unlike generated tag/folder index pages nobody wants the 404 page to appear in search results, feeds, or a "recent posts" widget. Other synthetic/non-content pages (drafts, encrypted pages, explicitly unlisted notes) already rely on this same
unlistedflag, so this brings the 404 page type in line with that existing convention rather than introducing a new one.Repro
@quartz-community/recent-noteswith a minimal layout block (no other options needed).content/index.md.Fix
One-line change: pass
unlisted: trueintodefaultProcessedContentwhen generating the 404 page, socontent-index's existingif (data.unlisted === true) continuecheck (and any otherunlisted-aware consumer) picks it up.Test plan
npx quartz buildwithrecent-notesenabled on a minimal vault, "Not Found" no longer appears in the recent notes list before vs. after this change.