mirror of
https://github.com/quartz-community/encrypted-pages.git
synced 2026-07-22 03:00:24 +00:00
Stealth pages are encrypted pages that are hidden from every listing surface permanently, even after a successful client-side decryption. Their metadata is never written to the shadow content index, so there is nothing for the client to recover -- the page remains invisible to graph, explorer, search, backlinks, recent-notes, folder-page, and tag-page for the entire browser session. This fills a gap between "unlisted" (hidden pre-decryption, revealed post-decryption via shadow index) and the desire for "secret door" pages that should only be accessible to users who already know the exact URL. Semantics: - `stealth: true` implies `unlisted: true`. Setting stealth on a page automatically hides it from listings regardless of the `unlisted` field or the `unlistWhenEncrypted` plugin option. - `stealth: true` overrides explicit `unlisted: false`. A user who writes `stealth: true, unlisted: false` gets a hidden stealth page, because stealth without unlisted is semantically incoherent. - `stealth: true` has no effect on non-encrypted pages. Stealth only controls shadow-index emission, which only happens for encrypted unlisted pages. Non-encrypted pages with `stealth: true` are silently ignored (use `unlisted: true` for non-encrypted hiding, via the `unlisted-pages` plugin). - Non-boolean stealth values are ignored. Implementation: - transformer.ts: after setting `data.unlisted`, check if `frontmatter.stealth === true` and if so set `data.stealth = true` and force `data.unlisted = true`. - emitter.ts: in the shadow-index loop, skip any page where `data.stealth === true`. Tests: 8 new (6 transformer + 2 emitter) covering stealth -> unlisted implication, stealth overriding explicit unlisted: false, stealth on non-encrypted pages being a no-op, non-boolean stealth values being ignored, stealth pages being excluded from the shadow index while non-stealth pages pass through unchanged, and mixed stealth/non-stealth content being correctly partitioned. 29 tests total passing. |
||
|---|---|---|
| .. | ||
| emitter.test.ts | ||
| helpers.ts | ||
| transformer.test.ts | ||