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.
98 lines
2.5 KiB
JSON
98 lines
2.5 KiB
JSON
{
|
|
"name": "@quartz-community/unlisted-pages",
|
|
"version": "0.1.0",
|
|
"description": "Bridges `frontmatter.unlisted` to `file.data.unlisted` so any page can opt out of discovery surfaces (contentIndex, RSS, sitemap, graph, explorer, search, backlinks, recent-notes, folder-page, tag-page) while remaining accessible by direct URL.",
|
|
"type": "module",
|
|
"license": "MIT",
|
|
"author": "Quartz Community",
|
|
"homepage": "https://quartz.jzhao.xyz",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/quartz-community/unlisted-pages"
|
|
},
|
|
"keywords": [
|
|
"quartz",
|
|
"quartz-plugin",
|
|
"unlisted-pages",
|
|
"unlisted",
|
|
"hidden",
|
|
"rehype",
|
|
"hast",
|
|
"frontmatter"
|
|
],
|
|
"files": [
|
|
"dist",
|
|
"README.md",
|
|
"LICENSE",
|
|
"CHANGELOG.md"
|
|
],
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"import": "./dist/index.js"
|
|
},
|
|
"./types": {
|
|
"types": "./dist/types.d.ts",
|
|
"import": "./dist/types.js"
|
|
},
|
|
"./package.json": "./package.json"
|
|
},
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"sideEffects": false,
|
|
"scripts": {
|
|
"build": "tsup",
|
|
"dev": "tsup --watch",
|
|
"lint": "eslint . --max-warnings=0",
|
|
"format": "prettier . --check",
|
|
"test": "vitest run",
|
|
"typecheck": "tsc --noEmit",
|
|
"check": "npm run typecheck && npm run lint && npm run format && npm run test"
|
|
},
|
|
"peerDependencies": {
|
|
"@jackyzha0/quartz": "^4.5.2",
|
|
"vfile": "^6.0.3"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"@jackyzha0/quartz": {
|
|
"optional": true
|
|
},
|
|
"vfile": {
|
|
"optional": true
|
|
}
|
|
},
|
|
"dependencies": {
|
|
"@quartz-community/types": "github:quartz-community/types",
|
|
"@quartz-community/utils": "github:quartz-community/utils"
|
|
},
|
|
"devDependencies": {
|
|
"@types/hast": "^3.0.4",
|
|
"@types/node": "^24.10.0",
|
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
"@typescript-eslint/parser": "^7.18.0",
|
|
"eslint": "^8.57.0",
|
|
"eslint-config-prettier": "^9.1.0",
|
|
"prettier": "^3.6.2",
|
|
"tsup": "^8.5.0",
|
|
"typescript": "^5.9.3",
|
|
"unified": "^11.0.5",
|
|
"vfile": "^6.0.3",
|
|
"vitest": "^2.1.9"
|
|
},
|
|
"quartz": {
|
|
"name": "unlisted-pages",
|
|
"displayName": "Unlisted Pages",
|
|
"category": "transformer",
|
|
"version": "1.0.0",
|
|
"quartzVersion": ">=5.0.0",
|
|
"dependencies": [],
|
|
"defaultOrder": 45,
|
|
"defaultEnabled": true,
|
|
"defaultOptions": {},
|
|
"optionSchema": {}
|
|
},
|
|
"engines": {
|
|
"node": ">=22",
|
|
"npm": ">=10.9.2"
|
|
}
|
|
}
|