mirror of
https://github.com/quartz-community/unlisted-pages.git
synced 2026-07-22 03:00:26 +00:00
Zero-config rehype plugin that copies file.data.frontmatter.unlisted onto file.data.unlisted when the value is a boolean. Enables the unlisted convention respected by content-index, search, backlinks, recent-notes, folder-page, and tag-page to work for any page, not only encrypted ones. Before this plugin, file.data.unlisted was only set by @quartz-community/encrypted-pages, inside the encryption branch of its transformer. Pages that had unlisted: true in frontmatter but no password were silently listed everywhere -- the frontmatter field was dead weight. This plugin fixes that with a four-line rehype pass. Composes cleanly with encrypted-pages. If both are installed, the two plugins write the same value to file.data.unlisted; if only one is installed, the other's behavior is unaffected. Strips the template scaffolding (filter/emitter/component/i18n/util/build) since this is a single zero-config transformer. Manifest declares category: "transformer", defaultOrder: 45 (runs before encrypted-pages at 900, independent of crawl-links at 60), defaultEnabled: true, no options. 10 unit tests covering boolean true, boolean false, missing frontmatter, missing unlisted field, non-boolean values (string, number, null), preservation of other file.data fields, transformer name, and zero-arg instantiation. |
||
|---|---|---|
| .. | ||
| helpers.ts | ||
| transformer.test.ts | ||