Compare commits

..
7 changed files with 332 additions and 194 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
The folder hierarchy used by folder pages and breadcrumbs now includes the pages of page types that render files (`.base`, `.canvas`, …): folder pages list them, and a folder that holds only such pages has its own node (#2576). Documented that while a page type's `generate` runs, `ctx.virtualPages` holds the virtual pages of the page types before it.
-12
View File
@@ -1,12 +0,0 @@
---
"@jackyzha0/quartz": minor
---
Updated default plugins (see each plugin's changelog for details):
- **Changed heading ids:** with SmartyPants on (the default), a heading containing `--` now gets the same id as on GitHub: `## Range 1--2` → `range-1--2` (was `range-12`). Links that hard-code the old id need updating; `[[page#Range 1--2]]` keeps working. Links Obsidian writes to headings containing `:`, `|`, `^`, `#` or `\` now reach them, and heading ids, links and table-of-contents entries share one slug function (GitHubFlavoredMarkdown 2.1.0, TableOfContents, CrawlLinks, utils 1.1).
- **Changed in Bases:** `file.name` includes the file's extension, as in Obsidian (`Note.md`, `Plan.canvas`); use `file.basename` for the name without it. Base views also list canvas and Excalidraw files with their real paths, `this` in a base embedded in a note is that note, `file.inFolder("")` matches the content root, and Quartz's generated pages (404, tags, folder listings) no longer appear as notes (BasesPage 1.1.0, CanvasPage, Excalidraw).
- Folder pages list folders that hold only canvas, base or other generated pages (FolderPage).
- A footnote referenced only from a table cell past the table's columns is rendered, as in Obsidian (ObsidianFlavoredMarkdown 2.1.1, with remark-obsidian 2.2.0: faster parsing and fixes for deeply nested notes and `\r\n` line endings).
- A short wikilink to an Obsidian folder note (`[[Topic]]` for `Topic/Topic.md`) reaches the folder page (utils 1.1).
- NoteProperties no longer bundles gray-matter's `eval`-based JavaScript frontmatter engine.
+153 -136
View File
@@ -13,52 +13,53 @@
"@floating-ui/dom": "^1.7.4",
"@myriaddreamin/rehype-typst": "^0.7.0",
"@napi-rs/simple-git": "1.1.0",
"@quartz-community/alias-redirects": "^1.0.2",
"@quartz-community/article-title": "^1.0.1",
"@quartz-community/backlinks": "^1.0.2",
"@quartz-community/bases-page": "^1.1.0",
"@quartz-community/breadcrumbs": "^1.0.2",
"@quartz-community/canvas-page": "^1.0.2",
"@quartz-community/citations": "^1.0.1",
"@quartz-community/cname": "^1.0.1",
"@quartz-community/comments": "^1.0.1",
"@quartz-community/content-meta": "^1.0.1",
"@quartz-community/content-page": "^1.0.2",
"@quartz-community/created-modified-date": "^1.0.2",
"@quartz-community/darkmode": "^1.0.1",
"@quartz-community/description": "^1.0.2",
"@quartz-community/encrypted-pages": "^1.0.1",
"@quartz-community/explicit-publish": "^1.0.1",
"@quartz-community/explorer": "^1.0.2",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.0.2",
"@quartz-community/footer": "^1.1.0",
"@quartz-community/github-flavored-markdown": "^2.1.0",
"@quartz-community/graph": "^1.0.2",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.0.1",
"@quartz-community/note-properties": "^1.1.3",
"@quartz-community/obsidian-flavored-markdown": "^2.1.1",
"@quartz-community/og-image": "^1.1.1",
"@quartz-community/ox-hugo": "^1.0.1",
"@quartz-community/page-title": "^1.0.1",
"@quartz-community/quartz-fonts": "^1.0.2",
"@quartz-community/reader-mode": "^1.0.1",
"@quartz-community/recent-notes": "^1.0.2",
"@quartz-community/roam": "^1.0.1",
"@quartz-community/search": "^1.0.2",
"@quartz-community/spacer": "^1.0.1",
"@quartz-community/stacked-pages": "^1.0.2",
"@quartz-community/syntax-highlighting": "^1.0.2",
"@quartz-community/table-of-contents": "^1.0.2",
"@quartz-community/tag-list": "^1.0.2",
"@quartz-community/tag-page": "^1.0.2",
"@quartz-community/unlisted-pages": "^1.0.1",
"@quartz-themes/core": "^2.0.1",
"@quartz-community/alias-redirects": "^1.0.0",
"@quartz-community/article-title": "^1.0.0",
"@quartz-community/backlinks": "^1.0.0",
"@quartz-community/bases-page": "^1.0.0",
"@quartz-community/breadcrumbs": "^1.0.0",
"@quartz-community/canvas-page": "^1.0.0",
"@quartz-community/citations": "^1.0.0",
"@quartz-community/cname": "^1.0.0",
"@quartz-community/comments": "^1.0.0",
"@quartz-community/content-meta": "^1.0.0",
"@quartz-community/content-page": "^1.0.0",
"@quartz-community/created-modified-date": "^1.0.0",
"@quartz-community/darkmode": "^1.0.0",
"@quartz-community/description": "^1.0.0",
"@quartz-community/encrypted-pages": "^1.0.0",
"@quartz-community/explicit-publish": "^1.0.0",
"@quartz-community/explorer": "^1.0.0",
"@quartz-community/favicon": "^1.0.0",
"@quartz-community/folder-page": "^1.0.0",
"@quartz-community/footer": "^1.0.0",
"@quartz-community/github-flavored-markdown": "^2.0.0",
"@quartz-community/graph": "^1.0.0",
"@quartz-community/hard-line-breaks": "^1.0.0",
"@quartz-community/latex": "^1.0.0",
"@quartz-community/note-properties": "^1.1.1",
"@quartz-community/obsidian-flavored-markdown": "^2.0.0",
"@quartz-community/og-image": "^1.0.0",
"@quartz-community/ox-hugo": "^1.0.0",
"@quartz-community/page-title": "^1.0.0",
"@quartz-community/quartz-fonts": "^1.0.0",
"@quartz-community/reader-mode": "^1.0.0",
"@quartz-community/recent-notes": "^1.0.0",
"@quartz-community/roam": "^1.0.0",
"@quartz-community/search": "^1.0.0",
"@quartz-community/spacer": "^1.0.0",
"@quartz-community/stacked-pages": "^1.0.0",
"@quartz-community/syntax-highlighting": "^1.0.1",
"@quartz-community/table-of-contents": "^1.0.0",
"@quartz-community/tag-list": "^1.0.0",
"@quartz-community/tag-page": "^1.0.0",
"@quartz-community/unlisted-pages": "^1.0.0",
"@quartz-themes/core": "^2.0.0",
"ansi-truncate": "^1.4.0",
"async-mutex": "^0.5.0",
"chokidar": "^5.0.0",
"esbuild-sass-plugin": "^3.6.0",
"github-slugger": "^2.0.0",
"globby": "^16.1.0",
"gray-matter": "^4.0.3",
"hast-util-from-html": "^2.0.0",
@@ -97,8 +98,8 @@
},
"devDependencies": {
"@changesets/cli": "^2.29.2",
"@quartz-community/types": "^1.2.0",
"@quartz-community/utils": "^1.1.1",
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.1",
"@types/hast": "^3.0.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "^26.5.1",
@@ -2354,13 +2355,13 @@
}
},
"node_modules/@quartz-community/alias-redirects": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/alias-redirects/-/alias-redirects-1.0.2.tgz",
"integrity": "sha512-QdcaorfE0UVqy4EnZel0minOHODybU+6v0ZlK4knFFV6QT8ISi8WlL79RnOV51jxRJkRBR3E7CED8kCa3l/RCA==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/alias-redirects/-/alias-redirects-1.0.1.tgz",
"integrity": "sha512-n7lI0gEWqb/9jkMO8G9JhBtRKqsxbED8MtfBC57pZYaoCOfBjVMY5MPgsH9/K5m7r18etFkSDpBV37t7tlBuzQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2398,13 +2399,13 @@
}
},
"node_modules/@quartz-community/backlinks": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/backlinks/-/backlinks-1.0.2.tgz",
"integrity": "sha512-iZ016m+fH8FbW4J7uPYEHGrgvAvKDCmZvx5OmmeqL8Cv14PQG/xuhz3FvfTA2Djxq9/pFURvYTWxh+oDDL3N2Q==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/backlinks/-/backlinks-1.0.1.tgz",
"integrity": "sha512-bdvEV3KDt7R87BHq9AmpBX8zmsFl9/IEPxS4Fm0Wjoiszv0NzS5qE9VA78dIqpAoOyOI8R2OZHsiihcoXSyLTQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2420,13 +2421,13 @@
}
},
"node_modules/@quartz-community/bases-page": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/bases-page/-/bases-page-1.1.0.tgz",
"integrity": "sha512-MBrGeHos2xSoDzgrytKIqEglx43YWxJK52YJIWHwkOod25Ii4eCH5Ox0HtpdgbOn7EnLPXtOV6xuQP9ysKWxSw==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/bases-page/-/bases-page-1.0.1.tgz",
"integrity": "sha512-pqdiXt8T5nULTUs56k+VoiWw53svRyUDAty7s4uDHxcWdoNjV67AiYs7wOYuP5+ZcDQUA7THOGBWBoZ/WKbmsg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2450,13 +2451,13 @@
}
},
"node_modules/@quartz-community/breadcrumbs": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/breadcrumbs/-/breadcrumbs-1.0.2.tgz",
"integrity": "sha512-ImEiYAFDcbayj9Yu7b7X6Yt7x9z4pAABZDwTUV5DBYfnQJmJWyuQpvqBgMHUBUgWbm9gyxT73tlXaHpLvsY56w==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/breadcrumbs/-/breadcrumbs-1.0.1.tgz",
"integrity": "sha512-IlPB+cqQPkT7YlrCGg7ndEHjISvg9XzG8GAhIIQpXnrfAWwTkxJTVFAotI3K8pqATIGaGtvGxPhCmuVXmMAwyQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2472,13 +2473,14 @@
}
},
"node_modules/@quartz-community/canvas-page": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/canvas-page/-/canvas-page-1.0.2.tgz",
"integrity": "sha512-F9kyp9PdSbUO2lKO1odINE29jA0aZw0XmIWW/p7zSGhRx4ZSvGjA+8thZHL6bIcyzjiG+09MndMebGSZiDmU1A==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/canvas-page/-/canvas-page-1.0.1.tgz",
"integrity": "sha512-Onk4OC7yy6mrP8FRgku0o5+bd0bW3RCoX3UOoHtOS8G7Qp2NMuucC3JTuAYzYE4r0gPPUUStf28khPN6SIc9/g==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0",
"github-slugger": "^2.0.0"
},
"engines": {
"node": ">=22",
@@ -2576,13 +2578,13 @@
}
},
"node_modules/@quartz-community/content-page": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/content-page/-/content-page-1.0.2.tgz",
"integrity": "sha512-+kbVhussK5n7sPc/7P5sSzLm6pDblYO3BCZ8asTxuHX43Hzv9jlj3LigphIDz/dvmHkjZNBMSdKHlvO5CcZRcg==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/content-page/-/content-page-1.0.1.tgz",
"integrity": "sha512-HqjPwTxUOC9cb1PrB01VgCVSLYWeMYfukf7Ti2I1OjGrIyxdtvcIpKQmnMQ2CDdlFzCCz7RciC9MzJVkxGZCMg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2649,13 +2651,13 @@
}
},
"node_modules/@quartz-community/description": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/description/-/description-1.0.2.tgz",
"integrity": "sha512-Mb0VqNOqiY9UQLK0y7p2/LVJAUqH8ra3Pek0Gz8q35FxJXkv2RDyjNb49qMUM0dpIaLVUkv9GBuKxeoxbwt4Yg==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/description/-/description-1.0.1.tgz",
"integrity": "sha512-DX0bSNSIajBXRtXpvEsif2RvtCS8HSOPGRDwjSje0UlOnrtmWq5Tmd7oY5//2lnxzBWk7VMdJBmN1xI/gknMEg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2710,13 +2712,13 @@
}
},
"node_modules/@quartz-community/explorer": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/explorer/-/explorer-1.0.2.tgz",
"integrity": "sha512-6u62zq/U28BBIbm9FHFheDCmfsqfCq+lEngd6JzhfBlXGn6n1I7q9vPIJ4qN/8DYLey556MjJMxh+QLPIDHuGg==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/explorer/-/explorer-1.0.1.tgz",
"integrity": "sha512-/eezCS0Ki7dSjclsPkHGoKtUxLIfneVAV022vMD8wlBSlo9Aq4Vy5KXcPuuc02iuHFMjFQvDvua0Yp3ZBGuZYQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2753,13 +2755,13 @@
}
},
"node_modules/@quartz-community/folder-page": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.0.2.tgz",
"integrity": "sha512-+h/9QFo+wEtweYyKEe4CZxJVILfC0V70z7rkGIjN9unWyxOkIB3PJh9Fw8oRDuZw07yF3HwOvAg9/bBar8q9DA==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.0.1.tgz",
"integrity": "sha512-gXhwmRU/YocRGDQX+lUYFizVdzuCeAeT77jN2uXTP60wuBV6zZ5gtAi6HUYFp4YXeLZnm6QKyXFba/6ugYFlKg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2801,13 +2803,12 @@
}
},
"node_modules/@quartz-community/github-flavored-markdown": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/github-flavored-markdown/-/github-flavored-markdown-2.1.0.tgz",
"integrity": "sha512-E2K09rOgmhHFtF/9AbnoVXrI3v0Ww82ZIVCHQUWWM7fsuktn3DYmmVs2YhJk77tSbeqGW76ZY+gl4UgJ/U9Rxg==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@quartz-community/github-flavored-markdown/-/github-flavored-markdown-2.0.0.tgz",
"integrity": "sha512-nKOYqvesGiEeuENHEPtMPgKl/YsDK0SWeSNMGXse3S3OwvDGQ74ZeE9pvDvps33B2vQoemsxvbKIE5qMUllZfw==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.1"
"@quartz-community/types": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2823,13 +2824,13 @@
}
},
"node_modules/@quartz-community/graph": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.2.tgz",
"integrity": "sha512-YmFoGizirmVkE9d66iLHgLrLgb7TYzCVaZT0kDwvh9J7/Kq8tUx/slIoFKuheJNr4gp7HGAxuNwx8WaLjqkXnQ==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.1.tgz",
"integrity": "sha512-e9T4Zjp55H8HhuFsucjscuAOGHhz0/1LooMAH1cfE3ub9uBoSPXdeaKVmvixhtWz2TaM4rQFU1UUTN8/hbteyg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2891,13 +2892,13 @@
}
},
"node_modules/@quartz-community/note-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@quartz-community/note-properties/-/note-properties-1.1.3.tgz",
"integrity": "sha512-ChzMZjvw47D+aTBDFOyaAJpfp/S+l25ndSoL8xJOf+DMgO5y+GioaEPmYRHjUOnbnZxc1/RcydSnyU68CU8yjA==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/note-properties/-/note-properties-1.1.1.tgz",
"integrity": "sha512-kURVT2PTQZTcRZxiT7o/gerI/8n0EhVogLaMznviJXYKSSvenE+8uKlPxJtZr1nbTJOn73UNBr5iNMhQIycQtg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -2917,15 +2918,15 @@
}
},
"node_modules/@quartz-community/obsidian-flavored-markdown": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/obsidian-flavored-markdown/-/obsidian-flavored-markdown-2.1.1.tgz",
"integrity": "sha512-6PvlLi1e3naAZwVRyKJ5lQW19/mHpbZIRFGN9wC+QMx+9gDiJzA/HP4uTwcPQxrH0OzyrwZ4qkR4AFizynr2Eg==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/obsidian-flavored-markdown/-/obsidian-flavored-markdown-2.1.0.tgz",
"integrity": "sha512-yOLBsYrJ5IVjxhl/ppZmXQAHianKkeIGMvDT7mwNOaalsah19p9luHrPYg0eEsn1o6IkHFP8h1LaY2WT+wIABw==",
"license": "MIT",
"dependencies": {
"@quartz-community/rehype-obsidian": "^1.2.0",
"@quartz-community/remark-obsidian": "^2.2.0",
"@quartz-community/remark-obsidian": "^2.1.0",
"@quartz-community/types": "^1.1.0",
"@quartz-community/utils": "^1.1.0",
"@quartz-community/utils": "^1.0.0",
"pele": "^1.13.0"
},
"engines": {
@@ -2942,13 +2943,13 @@
}
},
"node_modules/@quartz-community/og-image": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/og-image/-/og-image-1.1.1.tgz",
"integrity": "sha512-wZW6TgEFYUMLdQq+tF5v27tCtWySn+mTr6tzSdZTlGwcubBK2SA2E/ue8PwWXJnilfxteCwXGEF37xR1GFHqHg==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/og-image/-/og-image-1.1.0.tgz",
"integrity": "sha512-s6kcPd9ddeaQ7gygqR3+hcbXjzYdTpv2kHG6vy/mPuE5941zm9icAzwLPcTf+gXur5DyYqNdpmu3zjoLAp5BMA==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -3015,13 +3016,13 @@
}
},
"node_modules/@quartz-community/quartz-fonts": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/quartz-fonts/-/quartz-fonts-1.0.2.tgz",
"integrity": "sha512-Q0iPRAlTXNNnvCutYpF1FAPFvNlwfeXPipg1SIgD9M1vxHSyUzfAGHkLngafR/HgNMf9qREbvqQaCTjtp7grEQ==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/quartz-fonts/-/quartz-fonts-1.0.1.tgz",
"integrity": "sha512-EFiRcmnacmJe6yHIb3ZOouEpcSRvtPUdknkU5GLoBYZdZBNXj8/RJmhgyKo+M7rqogbI4Xiq6N09RiK3eJopSQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -3067,13 +3068,13 @@
}
},
"node_modules/@quartz-community/recent-notes": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/recent-notes/-/recent-notes-1.0.2.tgz",
"integrity": "sha512-CWYHOBULovmqX5rxSBeuinkEPzBcQ2xVRT96y+D8JKDHtUK6IJr3dllYbgNK8sOp/akmAm5IuGWxXvfqJ75aUw==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/recent-notes/-/recent-notes-1.0.1.tgz",
"integrity": "sha512-5vJssnScCR1s/Kuv9CFG64QzBxgqU9+wkANUX/jzx5aAQ01LmoY5ueO7SjgKS0g6R8MCOuW/DkLXFEWM6PmDNg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -3098,9 +3099,9 @@
}
},
"node_modules/@quartz-community/remark-obsidian": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@quartz-community/remark-obsidian/-/remark-obsidian-2.2.0.tgz",
"integrity": "sha512-uSuUA3CA2ebAls7IXaevgQGqqbho1fR0lORKUTmhOTEUTYt8GBkl7ipaik4Y7x3q1LzUflejgFIGl/0XO83OGw==",
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/remark-obsidian/-/remark-obsidian-2.1.1.tgz",
"integrity": "sha512-JZxT1f/xm8iEQJJJoGHosSXWN7h+xuIds7IUXjsp7ZtdRDS7nd6wmv2uMjqyOdqp7x8F+d/DTp6FW50xL+9vMw==",
"license": "MIT",
"engines": {
"node": ">=22"
@@ -3131,13 +3132,13 @@
}
},
"node_modules/@quartz-community/search": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.0.2.tgz",
"integrity": "sha512-tZcFCkoOY7AdT0pDXUVkdhwEs5JLPuoVXy+TvdpUe2Mzy91fDKQQF0eN5UV4i2awZqLGka4vsQ4k33hZAZSi8A==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.0.1.tgz",
"integrity": "sha512-av1+wMoArfY8e0S9M1SNR3FYw7ZIg1PjU422Fm45Jz3K3FaVYJmfu9eAqqNbYAmbEzi43rqcnfOpqj8HAaRUeA==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -3174,13 +3175,13 @@
}
},
"node_modules/@quartz-community/stacked-pages": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/stacked-pages/-/stacked-pages-1.0.2.tgz",
"integrity": "sha512-0QxMNeiF5AnZ0fnQxFLcqs8GJCVywIoGjK+YNhN1TOk3p6MIDO0I+AdTbJ+QlZ5JiqXnNZkNoAnQJNXVCEiIAg==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/stacked-pages/-/stacked-pages-1.0.1.tgz",
"integrity": "sha512-h3bWrQcL3nUG48rnVi3cdnx9h/VNxJa9pFDSr9NC6x5pPJgTaeoilkPeb8QrXasREpHRTRhfXE5NWxh4ngcE6Q==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.1"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -3225,13 +3226,13 @@
}
},
"node_modules/@quartz-community/table-of-contents": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/table-of-contents/-/table-of-contents-1.0.2.tgz",
"integrity": "sha512-lOwx5MwrDfDuk6rzBZdyToAZOiV6raN8JJVveSxMik8+QjdGGYA1Ery/A/HTib2riDEJZU6EgShlrYlrGpNCzg==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/table-of-contents/-/table-of-contents-1.0.1.tgz",
"integrity": "sha512-lorY0WzK57U97YOjlvUAwMDa8yZiXoWW1dPJ1Q9ope2dzZ70kilXUUvCx1lzN/AxolzbdmTDxyedTWcDHmL38Q==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.1"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -3247,13 +3248,13 @@
}
},
"node_modules/@quartz-community/tag-list": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-list/-/tag-list-1.0.2.tgz",
"integrity": "sha512-Dr4QhM/h7tV0oNjhAq7Gpto1aLiMPplwBQ6CGUs15qhW3p9je3t0qhUQQVboXMXlw1u5NZiKj/NqoDnoZSMG9w==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-list/-/tag-list-1.0.1.tgz",
"integrity": "sha512-owUIVpoAQ3WvHXeqbimO64fjthBj8J+iq3TQPPaccT7rC6NVPZleEKE2jgvWTy60bVh/rJBsAjRNKN8rjlVaYg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -3269,13 +3270,13 @@
}
},
"node_modules/@quartz-community/tag-page": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.2.tgz",
"integrity": "sha512-GkPItFn82SA6h6tW6AZ3EdavsgkLd38ado8Gi1lm0wMbtHIJCFLlgZqYoReLTg32VGGT2gAvzn+hLsuuTV/LTQ==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.1.tgz",
"integrity": "sha512-zmp/AW8RRQYGTJNF6sLmAY/Z77dg4MrYhW/iEPnyjFGdIxKwxmeIht5/gnz8IuzD1+7ZJpOjkC1wtM47EyNK8g==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.1.0"
"@quartz-community/utils": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -3343,9 +3344,9 @@
}
},
"node_modules/@quartz-community/utils": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/utils/-/utils-1.1.1.tgz",
"integrity": "sha512-iHjEOlbpqznut9YkoflXxd2Bl5TaBcMFwIouRxp2HTBcbCQbmHtAsL3sdLheC1YeM9bMxeFLAN2b7rIBR2r/og==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/utils/-/utils-1.0.2.tgz",
"integrity": "sha512-0yS+43ufTYT80+kGC0ZRsY5HQ3l7M62GVh20ukX06vh2zLrU/W1o7RcWLffzUIJfb256E169rlSWdn66EZF6vA==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0"
@@ -3355,7 +3356,17 @@
"npm": ">=10.9.2"
},
"peerDependencies": {
"github-slugger": "^2.0.0",
"hast-util-to-jsx-runtime": "^2.3.6",
"preact": "^10.0.0"
},
"peerDependenciesMeta": {
"github-slugger": {
"optional": true
},
"hast-util-to-jsx-runtime": {
"optional": true
}
}
},
"node_modules/@quartz-themes/core": {
@@ -4457,6 +4468,12 @@
"node": ">= 0.4"
}
},
"node_modules/github-slugger": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz",
"integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==",
"license": "ISC"
},
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+45 -44
View File
@@ -43,52 +43,53 @@
"@floating-ui/dom": "^1.7.4",
"@myriaddreamin/rehype-typst": "^0.7.0",
"@napi-rs/simple-git": "1.1.0",
"@quartz-community/alias-redirects": "^1.0.2",
"@quartz-community/article-title": "^1.0.1",
"@quartz-community/backlinks": "^1.0.2",
"@quartz-community/bases-page": "^1.1.0",
"@quartz-community/breadcrumbs": "^1.0.2",
"@quartz-community/canvas-page": "^1.0.2",
"@quartz-community/citations": "^1.0.1",
"@quartz-community/cname": "^1.0.1",
"@quartz-community/comments": "^1.0.1",
"@quartz-community/content-meta": "^1.0.1",
"@quartz-community/content-page": "^1.0.2",
"@quartz-community/created-modified-date": "^1.0.2",
"@quartz-community/darkmode": "^1.0.1",
"@quartz-community/description": "^1.0.2",
"@quartz-community/encrypted-pages": "^1.0.1",
"@quartz-community/explicit-publish": "^1.0.1",
"@quartz-community/explorer": "^1.0.2",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.0.2",
"@quartz-community/footer": "^1.1.0",
"@quartz-community/github-flavored-markdown": "^2.1.0",
"@quartz-community/graph": "^1.0.2",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.0.1",
"@quartz-community/note-properties": "^1.1.3",
"@quartz-community/obsidian-flavored-markdown": "^2.1.1",
"@quartz-community/og-image": "^1.1.1",
"@quartz-community/ox-hugo": "^1.0.1",
"@quartz-community/page-title": "^1.0.1",
"@quartz-community/quartz-fonts": "^1.0.2",
"@quartz-community/reader-mode": "^1.0.1",
"@quartz-community/recent-notes": "^1.0.2",
"@quartz-community/roam": "^1.0.1",
"@quartz-community/search": "^1.0.2",
"@quartz-community/spacer": "^1.0.1",
"@quartz-community/stacked-pages": "^1.0.2",
"@quartz-community/syntax-highlighting": "^1.0.2",
"@quartz-community/table-of-contents": "^1.0.2",
"@quartz-community/tag-list": "^1.0.2",
"@quartz-community/tag-page": "^1.0.2",
"@quartz-community/unlisted-pages": "^1.0.1",
"@quartz-themes/core": "^2.0.1",
"@quartz-community/alias-redirects": "^1.0.0",
"@quartz-community/article-title": "^1.0.0",
"@quartz-community/backlinks": "^1.0.0",
"@quartz-community/bases-page": "^1.0.0",
"@quartz-community/breadcrumbs": "^1.0.0",
"@quartz-community/canvas-page": "^1.0.0",
"@quartz-community/citations": "^1.0.0",
"@quartz-community/cname": "^1.0.0",
"@quartz-community/comments": "^1.0.0",
"@quartz-community/content-meta": "^1.0.0",
"@quartz-community/content-page": "^1.0.0",
"@quartz-community/created-modified-date": "^1.0.0",
"@quartz-community/darkmode": "^1.0.0",
"@quartz-community/description": "^1.0.0",
"@quartz-community/encrypted-pages": "^1.0.0",
"@quartz-community/explicit-publish": "^1.0.0",
"@quartz-community/explorer": "^1.0.0",
"@quartz-community/favicon": "^1.0.0",
"@quartz-community/folder-page": "^1.0.0",
"@quartz-community/footer": "^1.0.0",
"@quartz-community/github-flavored-markdown": "^2.0.0",
"@quartz-community/graph": "^1.0.0",
"@quartz-community/hard-line-breaks": "^1.0.0",
"@quartz-community/latex": "^1.0.0",
"@quartz-community/note-properties": "^1.1.1",
"@quartz-community/obsidian-flavored-markdown": "^2.0.0",
"@quartz-community/og-image": "^1.0.0",
"@quartz-community/ox-hugo": "^1.0.0",
"@quartz-community/page-title": "^1.0.0",
"@quartz-community/quartz-fonts": "^1.0.0",
"@quartz-community/reader-mode": "^1.0.0",
"@quartz-community/recent-notes": "^1.0.0",
"@quartz-community/roam": "^1.0.0",
"@quartz-community/search": "^1.0.0",
"@quartz-community/spacer": "^1.0.0",
"@quartz-community/stacked-pages": "^1.0.0",
"@quartz-community/syntax-highlighting": "^1.0.1",
"@quartz-community/table-of-contents": "^1.0.0",
"@quartz-community/tag-list": "^1.0.0",
"@quartz-community/tag-page": "^1.0.0",
"@quartz-community/unlisted-pages": "^1.0.0",
"@quartz-themes/core": "^2.0.0",
"ansi-truncate": "^1.4.0",
"async-mutex": "^0.5.0",
"chokidar": "^5.0.0",
"esbuild-sass-plugin": "^3.6.0",
"github-slugger": "^2.0.0",
"globby": "^16.1.0",
"gray-matter": "^4.0.3",
"hast-util-from-html": "^2.0.0",
@@ -124,8 +125,8 @@
},
"devDependencies": {
"@changesets/cli": "^2.29.2",
"@quartz-community/types": "^1.2.0",
"@quartz-community/utils": "^1.1.1",
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.1",
"@types/hast": "^3.0.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "^26.5.1",
@@ -5,6 +5,7 @@ import os from "os"
import path from "path"
import {
collectComponents,
folderTrie,
generateVirtualPages,
pageOutputPath,
removeStalePageOutput,
@@ -14,6 +15,7 @@ import { QuartzPageTypePluginInstance } from "../types"
import { QuartzComponent } from "../../components/types"
import { FilePath, FullSlug } from "../../util/path"
import { BuildCtx } from "../../util/ctx"
import { defaultProcessedContent } from "../vfile"
const StubA: QuartzComponent = (() => null) as unknown as QuartzComponent
const StubB: QuartzComponent = (() => null) as unknown as QuartzComponent
@@ -277,3 +279,89 @@ describe("generateVirtualPages", () => {
)
})
})
describe("folders of virtual pages (#2576)", () => {
const makeCtx = () => ({ cfg: { configuration: {} }, virtualPages: [] }) as unknown as BuildCtx
const page = (slug: string) => ({ slug: slug as FullSlug, title: slug, data: {} })
const note = (slug: string) =>
defaultProcessedContent({
slug: slug as FullSlug,
relativePath: `${slug}.md` as FilePath,
filePath: `content/${slug}.md` as FilePath,
frontmatter: { title: slug },
})[1].data
test("a page type sees the virtual pages of higher-priority page types in ctx.virtualPages", async () => {
const ctx = makeCtx()
let seen: string[] = []
await generateVirtualPages(
[
makePageType({ name: "bases", generate: () => [page("trips/map.base")] }),
makePageType({
name: "folders",
generate: ({ ctx }) => {
seen = ctx.virtualPages.map(([, vfile]) => vfile.data.slug!)
return []
},
}),
],
[],
ctx,
{ head: StubHead },
{},
)
assert.deepStrictEqual(seen, ["trips/map.base"])
})
test("only pages of page types that render files are file-backed", async () => {
const entries = await generateVirtualPages(
[
makePageType({
name: "bases",
fileExtensions: [".base"],
generate: () => [page("trips/map.base")],
}),
makePageType({ name: "tags", generate: () => [page("tags/a")] }),
],
[],
makeCtx(),
{ head: StubHead },
{},
)
assert.deepStrictEqual(
entries.map((e) => [e.vpSlug, e.fileBacked]),
[
["trips/map.base", true],
["tags/a", false],
],
)
})
test("the folder trie holds file-backed virtual pages, not tag or folder pages", async () => {
const entries = await generateVirtualPages(
[
makePageType({
name: "bases",
fileExtensions: [".base"],
generate: () => [page("trips/map.base"), page("mixed/board.base")],
}),
makePageType({ name: "tags", generate: () => [page("tags/a")] }),
makePageType({ name: "folders", generate: () => [page("trips/index")] }),
],
[],
makeCtx(),
{ head: StubHead },
{},
)
const trie = folderTrie([note("mixed/note")], entries)
const children = (folder: string) =>
trie
.findNode([folder, "index"])
?.children.map((c) => c.slug)
.sort()
assert.deepStrictEqual(children("trips"), ["trips/map.base"])
assert.deepStrictEqual(children("mixed"), ["mixed/board.base", "mixed/note"])
assert.strictEqual(trie.findNode(["tags", "index"]), undefined)
assert.strictEqual(trie.findNode(["trips", "index"])?.data, null)
})
})
+35 -1
View File
@@ -143,6 +143,11 @@ export type VirtualEntry = {
vfile: ProcessedContent[1]
layout: FullPageLayout
vpSlug: FullSlug
/**
* Generated by a page type that renders source files (it declares `fileExtensions`, e.g. a
* `.base` or `.canvas` file): the page stands for a file and belongs in the folder hierarchy.
*/
fileBacked: boolean
}
/**
@@ -164,6 +169,7 @@ export async function generateVirtualPages(
if (!pt.generate) continue
const virtualPages = await pt.generate({ content, cfg, ctx })
const layout = resolveLayout(pt, defaults, byPageType)
const fileBacked = (pt.fileExtensions?.length ?? 0) > 0
for (const vp of virtualPages) {
const vpSlug = vp.slug as FullSlug
const vpRelativePath = (vpSlug + ".md") as FilePath
@@ -176,12 +182,34 @@ export async function generateVirtualPages(
if (vpSlug !== "404") {
ctx.virtualPages.push([tree, vfile])
}
virtualEntries.push({ tree, vfile, layout, vpSlug })
virtualEntries.push({ tree, vfile, layout, vpSlug, fileBacked })
}
}
return virtualEntries
}
/**
* @internal Exported for testing only.
*
* The folder hierarchy (`ctx.trie`, used by folder pages and breadcrumbs): the source files plus
* the virtual pages that stand for files (`.base`, `.canvas`, …), so a folder holding only such
* files still has a node with them as children (jackyzha0/quartz#2576). Tag and folder pages
* are left out — they are listings, not files.
*/
export function folderTrie(
allFiles: ProcessedContent[1]["data"][],
virtualEntries: VirtualEntry[],
) {
const fileBacked = virtualEntries
.filter((ve) => ve.fileBacked)
// the trie takes folder display names from file paths; a virtual page has only relativePath
.map((ve) => ({
...ve.vfile.data,
filePath: ve.vfile.data.filePath ?? ve.vfile.data.relativePath,
}))
return trieFromAllFiles([...allFiles, ...fileBacked])
}
/**
* Render each virtual page's Body component to HTML and parse it to a hast tree,
* populating both the ProcessedContent tree and vfile.data.htmlAst so that
@@ -250,6 +278,10 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
byPageType,
)
if (virtualEntries.some((ve) => ve.fileBacked)) {
ctx.trie = folderTrie(allFiles, virtualEntries)
}
// Merge virtual page data into allFiles before populating htmlAst so that
// Body components rendered during populateVirtualPageHtmlAst can resolve
// cross-virtual-page embeds (e.g. a .base file embedded in a .canvas file).
@@ -334,6 +366,8 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
byPageType,
)
ctx.trie = folderTrie(allFiles, virtualEntries)
const allFilesWithVirtual = [...allFiles, ...virtualEntries.map((ve) => ve.vfile.data)]
// Render Body components to populate htmlAst for transclusion
+6 -1
View File
@@ -42,7 +42,12 @@ export interface BuildCtx {
permalinks?: Record<string, FullSlug>
trie?: FileTrieNode<BuildTimeTrieData>
incremental: boolean
/** Virtual pages generated by page type plugins (e.g. tag pages, folder pages, bases pages) */
/**
* Virtual pages generated by page type plugins (e.g. tag pages, folder pages, bases pages).
* Page types generate in priority order, so while a page type's `generate` runs this holds the
* virtual pages of the page types before it (folder pages use it to find folders that hold only
* `.base` / `.canvas` pages).
*/
virtualPages: ProcessedContent[]
/** Content-hashed asset filenames, populated by ComponentResources emitter */
hashedResourceNames?: HashedResourceNames