mirror of
https://github.com/jackyzha0/quartz
synced 2026-11-30 22:44:41 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01bc5c5c88 |
No files matched your search
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"@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.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
"@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.
|
||||
Generated
+136
-153
@@ -13,53 +13,52 @@
|
||||
"@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.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",
|
||||
"@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",
|
||||
"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",
|
||||
@@ -98,8 +97,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.29.2",
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.1",
|
||||
"@quartz-community/types": "^1.2.0",
|
||||
"@quartz-community/utils": "^1.1.1",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^26.5.1",
|
||||
@@ -2355,13 +2354,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/alias-redirects": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/alias-redirects/-/alias-redirects-1.0.1.tgz",
|
||||
"integrity": "sha512-n7lI0gEWqb/9jkMO8G9JhBtRKqsxbED8MtfBC57pZYaoCOfBjVMY5MPgsH9/K5m7r18etFkSDpBV37t7tlBuzQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/alias-redirects/-/alias-redirects-1.0.2.tgz",
|
||||
"integrity": "sha512-QdcaorfE0UVqy4EnZel0minOHODybU+6v0ZlK4knFFV6QT8ISi8WlL79RnOV51jxRJkRBR3E7CED8kCa3l/RCA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2399,13 +2398,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/backlinks": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/backlinks/-/backlinks-1.0.1.tgz",
|
||||
"integrity": "sha512-bdvEV3KDt7R87BHq9AmpBX8zmsFl9/IEPxS4Fm0Wjoiszv0NzS5qE9VA78dIqpAoOyOI8R2OZHsiihcoXSyLTQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/backlinks/-/backlinks-1.0.2.tgz",
|
||||
"integrity": "sha512-iZ016m+fH8FbW4J7uPYEHGrgvAvKDCmZvx5OmmeqL8Cv14PQG/xuhz3FvfTA2Djxq9/pFURvYTWxh+oDDL3N2Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2421,13 +2420,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/bases-page": {
|
||||
"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==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/bases-page/-/bases-page-1.1.0.tgz",
|
||||
"integrity": "sha512-MBrGeHos2xSoDzgrytKIqEglx43YWxJK52YJIWHwkOod25Ii4eCH5Ox0HtpdgbOn7EnLPXtOV6xuQP9ysKWxSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2451,13 +2450,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/breadcrumbs": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/breadcrumbs/-/breadcrumbs-1.0.1.tgz",
|
||||
"integrity": "sha512-IlPB+cqQPkT7YlrCGg7ndEHjISvg9XzG8GAhIIQpXnrfAWwTkxJTVFAotI3K8pqATIGaGtvGxPhCmuVXmMAwyQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/breadcrumbs/-/breadcrumbs-1.0.2.tgz",
|
||||
"integrity": "sha512-ImEiYAFDcbayj9Yu7b7X6Yt7x9z4pAABZDwTUV5DBYfnQJmJWyuQpvqBgMHUBUgWbm9gyxT73tlXaHpLvsY56w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2473,14 +2472,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/canvas-page": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/canvas-page/-/canvas-page-1.0.1.tgz",
|
||||
"integrity": "sha512-Onk4OC7yy6mrP8FRgku0o5+bd0bW3RCoX3UOoHtOS8G7Qp2NMuucC3JTuAYzYE4r0gPPUUStf28khPN6SIc9/g==",
|
||||
"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==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0",
|
||||
"github-slugger": "^2.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2578,13 +2576,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/content-page": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/content-page/-/content-page-1.0.1.tgz",
|
||||
"integrity": "sha512-HqjPwTxUOC9cb1PrB01VgCVSLYWeMYfukf7Ti2I1OjGrIyxdtvcIpKQmnMQ2CDdlFzCCz7RciC9MzJVkxGZCMg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/content-page/-/content-page-1.0.2.tgz",
|
||||
"integrity": "sha512-+kbVhussK5n7sPc/7P5sSzLm6pDblYO3BCZ8asTxuHX43Hzv9jlj3LigphIDz/dvmHkjZNBMSdKHlvO5CcZRcg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2651,13 +2649,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/description": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/description/-/description-1.0.1.tgz",
|
||||
"integrity": "sha512-DX0bSNSIajBXRtXpvEsif2RvtCS8HSOPGRDwjSje0UlOnrtmWq5Tmd7oY5//2lnxzBWk7VMdJBmN1xI/gknMEg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/description/-/description-1.0.2.tgz",
|
||||
"integrity": "sha512-Mb0VqNOqiY9UQLK0y7p2/LVJAUqH8ra3Pek0Gz8q35FxJXkv2RDyjNb49qMUM0dpIaLVUkv9GBuKxeoxbwt4Yg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2712,13 +2710,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/explorer": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/explorer/-/explorer-1.0.1.tgz",
|
||||
"integrity": "sha512-/eezCS0Ki7dSjclsPkHGoKtUxLIfneVAV022vMD8wlBSlo9Aq4Vy5KXcPuuc02iuHFMjFQvDvua0Yp3ZBGuZYQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/explorer/-/explorer-1.0.2.tgz",
|
||||
"integrity": "sha512-6u62zq/U28BBIbm9FHFheDCmfsqfCq+lEngd6JzhfBlXGn6n1I7q9vPIJ4qN/8DYLey556MjJMxh+QLPIDHuGg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2755,13 +2753,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/folder-page": {
|
||||
"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==",
|
||||
"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==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2803,12 +2801,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/github-flavored-markdown": {
|
||||
"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==",
|
||||
"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==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0"
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2824,13 +2823,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/graph": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.1.tgz",
|
||||
"integrity": "sha512-e9T4Zjp55H8HhuFsucjscuAOGHhz0/1LooMAH1cfE3ub9uBoSPXdeaKVmvixhtWz2TaM4rQFU1UUTN8/hbteyg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.2.tgz",
|
||||
"integrity": "sha512-YmFoGizirmVkE9d66iLHgLrLgb7TYzCVaZT0kDwvh9J7/Kq8tUx/slIoFKuheJNr4gp7HGAxuNwx8WaLjqkXnQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2892,13 +2891,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/note-properties": {
|
||||
"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==",
|
||||
"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==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2918,15 +2917,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/obsidian-flavored-markdown": {
|
||||
"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==",
|
||||
"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==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/rehype-obsidian": "^1.2.0",
|
||||
"@quartz-community/remark-obsidian": "^2.1.0",
|
||||
"@quartz-community/remark-obsidian": "^2.2.0",
|
||||
"@quartz-community/types": "^1.1.0",
|
||||
"@quartz-community/utils": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.1.0",
|
||||
"pele": "^1.13.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2943,13 +2942,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/og-image": {
|
||||
"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==",
|
||||
"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==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3016,13 +3015,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/quartz-fonts": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/quartz-fonts/-/quartz-fonts-1.0.1.tgz",
|
||||
"integrity": "sha512-EFiRcmnacmJe6yHIb3ZOouEpcSRvtPUdknkU5GLoBYZdZBNXj8/RJmhgyKo+M7rqogbI4Xiq6N09RiK3eJopSQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/quartz-fonts/-/quartz-fonts-1.0.2.tgz",
|
||||
"integrity": "sha512-Q0iPRAlTXNNnvCutYpF1FAPFvNlwfeXPipg1SIgD9M1vxHSyUzfAGHkLngafR/HgNMf9qREbvqQaCTjtp7grEQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3068,13 +3067,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/recent-notes": {
|
||||
"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==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/recent-notes/-/recent-notes-1.0.2.tgz",
|
||||
"integrity": "sha512-CWYHOBULovmqX5rxSBeuinkEPzBcQ2xVRT96y+D8JKDHtUK6IJr3dllYbgNK8sOp/akmAm5IuGWxXvfqJ75aUw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3099,9 +3098,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/remark-obsidian": {
|
||||
"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==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/remark-obsidian/-/remark-obsidian-2.2.0.tgz",
|
||||
"integrity": "sha512-uSuUA3CA2ebAls7IXaevgQGqqbho1fR0lORKUTmhOTEUTYt8GBkl7ipaik4Y7x3q1LzUflejgFIGl/0XO83OGw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
@@ -3132,13 +3131,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/search": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.0.1.tgz",
|
||||
"integrity": "sha512-av1+wMoArfY8e0S9M1SNR3FYw7ZIg1PjU422Fm45Jz3K3FaVYJmfu9eAqqNbYAmbEzi43rqcnfOpqj8HAaRUeA==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.0.2.tgz",
|
||||
"integrity": "sha512-tZcFCkoOY7AdT0pDXUVkdhwEs5JLPuoVXy+TvdpUe2Mzy91fDKQQF0eN5UV4i2awZqLGka4vsQ4k33hZAZSi8A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3175,13 +3174,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/stacked-pages": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/stacked-pages/-/stacked-pages-1.0.1.tgz",
|
||||
"integrity": "sha512-h3bWrQcL3nUG48rnVi3cdnx9h/VNxJa9pFDSr9NC6x5pPJgTaeoilkPeb8QrXasREpHRTRhfXE5NWxh4ngcE6Q==",
|
||||
"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==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3226,13 +3225,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/table-of-contents": {
|
||||
"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==",
|
||||
"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==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3248,13 +3247,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/tag-list": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/tag-list/-/tag-list-1.0.1.tgz",
|
||||
"integrity": "sha512-owUIVpoAQ3WvHXeqbimO64fjthBj8J+iq3TQPPaccT7rC6NVPZleEKE2jgvWTy60bVh/rJBsAjRNKN8rjlVaYg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/tag-list/-/tag-list-1.0.2.tgz",
|
||||
"integrity": "sha512-Dr4QhM/h7tV0oNjhAq7Gpto1aLiMPplwBQ6CGUs15qhW3p9je3t0qhUQQVboXMXlw1u5NZiKj/NqoDnoZSMG9w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3270,13 +3269,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/tag-page": {
|
||||
"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==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.2.tgz",
|
||||
"integrity": "sha512-GkPItFn82SA6h6tW6AZ3EdavsgkLd38ado8Gi1lm0wMbtHIJCFLlgZqYoReLTg32VGGT2gAvzn+hLsuuTV/LTQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3344,9 +3343,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/utils": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/utils/-/utils-1.0.2.tgz",
|
||||
"integrity": "sha512-0yS+43ufTYT80+kGC0ZRsY5HQ3l7M62GVh20ukX06vh2zLrU/W1o7RcWLffzUIJfb256E169rlSWdn66EZF6vA==",
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/utils/-/utils-1.1.1.tgz",
|
||||
"integrity": "sha512-iHjEOlbpqznut9YkoflXxd2Bl5TaBcMFwIouRxp2HTBcbCQbmHtAsL3sdLheC1YeM9bMxeFLAN2b7rIBR2r/og==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0"
|
||||
@@ -3356,17 +3355,7 @@
|
||||
"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": {
|
||||
@@ -4468,12 +4457,6 @@
|
||||
"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",
|
||||
|
||||
+44
-45
@@ -43,53 +43,52 @@
|
||||
"@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.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",
|
||||
"@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",
|
||||
"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",
|
||||
@@ -125,8 +124,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.29.2",
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.1",
|
||||
"@quartz-community/types": "^1.2.0",
|
||||
"@quartz-community/utils": "^1.1.1",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^26.5.1",
|
||||
|
||||
@@ -5,7 +5,6 @@ import os from "os"
|
||||
import path from "path"
|
||||
import {
|
||||
collectComponents,
|
||||
folderTrie,
|
||||
generateVirtualPages,
|
||||
pageOutputPath,
|
||||
removeStalePageOutput,
|
||||
@@ -15,7 +14,6 @@ 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
|
||||
@@ -279,89 +277,3 @@ 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)
|
||||
})
|
||||
})
|
||||
@@ -143,11 +143,6 @@ 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
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,7 +164,6 @@ 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
|
||||
@@ -182,34 +176,12 @@ export async function generateVirtualPages(
|
||||
if (vpSlug !== "404") {
|
||||
ctx.virtualPages.push([tree, vfile])
|
||||
}
|
||||
virtualEntries.push({ tree, vfile, layout, vpSlug, fileBacked })
|
||||
virtualEntries.push({ tree, vfile, layout, vpSlug })
|
||||
}
|
||||
}
|
||||
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
|
||||
@@ -278,10 +250,6 @@ 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).
|
||||
@@ -366,8 +334,6 @@ 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
|
||||
|
||||
+1
-6
@@ -42,12 +42,7 @@ 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).
|
||||
* 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).
|
||||
*/
|
||||
/** Virtual pages generated by page type plugins (e.g. tag pages, folder pages, bases pages) */
|
||||
virtualPages: ProcessedContent[]
|
||||
/** Content-hashed asset filenames, populated by ComponentResources emitter */
|
||||
hashedResourceNames?: HashedResourceNames
|
||||
|
||||
Reference in new issue
Block a user