Skip to content

fix: mark generated 404 page as unlisted - #2528

Open
paulTroster wants to merge 1 commit into
jackyzha0:v5from
paulTroster:fix/404-page-missing-unlisted-flag
Open

paulTroster wants to merge 1 commit into
jackyzha0:v5from
paulTroster:fix/404-page-missing-unlisted-flag

Conversation

@paulTroster

@paulTroster paulTroster commented Aug 18, 2026 •

Copy link
Copy Markdown

Summary

The core-generated 404 page (quartz/plugins/pageTypes/404.ts) never sets the unlisted flag on its vfile data. Any plugin that relies on unlisted to exclude pages from listings likecontent-index (search, sitemap, RSS) and @quartz-community/recent-notes ends 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 unlisted flag, so this brings the 404 page type in line with that existing convention rather than introducing a new one.

Repro

  1. Enable @quartz-community/recent-notes with a minimal layout block (no other options needed).
  2. Add a single content/index.md.
  3. Build and the generated "Not Found" page shows up in the recent notes list alongside real content.

Fix

One-line change: pass unlisted: true into defaultProcessedContent when generating the 404 page, so content-index's existing if (data.unlisted === true) continue check (and any other unlisted-aware consumer) picks it up.

Test plan

  • npx quartz build with recent-notes enabled on a minimal vault, "Not Found" no longer appears in the recent notes list before vs. after this change.

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.
@github-actions

github-actions Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
quartz ✅ Ready (View Log) Visit Preview 631f6b4

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: true when creating the 404 page’s defaultProcessedContent vfile 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

1 active deployment
Branch Preview — 631f6b45 Deployed Aug 18, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants