Compare commits

..
Author SHA1 Message Date
saberzero1 6210f284d2 feat: prefetching (configuration.prefetch: viewport by default, hover, off), with and without SPA routing 2026-11-09 19:40:17 +01:00
Emile Bangma 0770178fa5 Merge pull request #2619 from jackyzha0/dev-mode/lockfile-path-fixes
chore: lockfile for alias-redirects 1.0.3 and created-modified-date 1.0.3
2026-11-09 18:44:49 +01:00
saberzero1 8854aebf7d chore: lockfile for alias-redirects 1.0.3 and created-modified-date 1.0.3 (Windows path fixes) 2026-11-09 18:39:22 +01:00
Emile Bangma bebabb1445 Merge pull request #2618 from jackyzha0/dev-mode/windows-local-sources
fix: Windows spellings of local plugin sources; pretty links cut only at /
2026-11-09 18:19:30 +01:00
saberzero1 7d255c3a0b fix(links): shorten pretty link text with path.posix (Windows also cut at a backslash) 2026-11-09 18:14:28 +01:00
saberzero1 f5ef8f738d fix(plugins): recognise .\ and ..\ local plugin sources (Windows spelling) 2026-11-09 18:11:49 +01:00
Emile Bangma e7da9cebf4 Merge pull request #2616 from WhoAmI-WhereAmI/fix/npm-plugin-index-windows
fix: npm plugin index generation on Windows
2026-11-09 18:08:19 +01:00
saberzero1 28581e8e54 test: npm plugins are found through import.meta.resolve; changeset for the Windows plugin index fix 2026-11-09 18:01:48 +01:00
Emile Bangma 4ff86a7809 Merge pull request #2617 from jackyzha0/dev-mode/link-facts
fix(links): link facts as in Obsidian 1.15.0
2026-11-09 16:37:27 +01:00
saberzero1 7688df602b chore: lockfile for utils 1.2.0 and Obsidian Flavored Markdown 2.1.3 (rehype-obsidian 1.3.0, remark-obsidian 2.2.1) 2026-11-09 16:35:34 +01:00
saberzero1 fc865525b7 fix(links): undecodable link paths are external, NFC paths, missing images show their path (Obsidian 1.15.0) 2026-11-09 15:57:06 +01:00
WhoAmI-WhereAmI 0f294f7139 Fix npm plugin index generation on Windows 2026-11-09 15:51:42 +09:00
Emile Bangma 3c7cba46ae Merge pull request #2615 from jackyzha0/dev-mode/lockfile-bases-1.2.1
chore: lockfile for BasesPage 1.2.1
2026-11-09 05:56:42 +01:00
saberzero1 4683f8b462 chore: lockfile for BasesPage 1.2.1 2026-11-09 05:54:58 +01:00
Emile Bangma 8be3806431 Merge pull request #2614 from jackyzha0/dev-mode/lockfile-bases-1.2
chore: lockfile for BasesPage 1.2.0; correct the 5.1 Bases notes
2026-11-09 05:42:36 +01:00
saberzero1 98cfbfabe8 chore: lockfile for BasesPage 1.2.0; 5.1 notes describe Bases as they now behave (file.name as in Obsidian) 2026-11-09 05:40:05 +01:00
Emile Bangma 6c91c6d621 Merge pull request #2613 from jackyzha0/dev-mode/lockfile-external-preact
chore: lockfile for the plugin releases that use Quartz's preact
2026-11-09 05:20:54 +01:00
saberzero1 f687f582f6 chore: lockfile for the plugin releases that use Quartz's preact 2026-11-09 05:18:05 +01:00
Emile Bangma 03996bb87a Merge pull request #2612 from jackyzha0/dev-mode/lockfile-publish-filters
chore: lockfile for the publish-filter plugin releases
2026-11-09 04:45:16 +01:00
Emile Bangma f30980744a Merge pull request #2611 from jackyzha0/dev-mode/virtual-page-filters
feat: publish filters and encryption for pages rendered from files (bases, canvases, drawings)
2026-11-09 04:45:12 +01:00
saberzero1 483b7629e5 chore: lockfile for explicit-publish, encrypted-pages, unlisted-pages 1.1.0, bases-page 1.1.2, types 1.3.0 2026-11-09 04:42:48 +01:00
saberzero1 fe6a3ea879 feat: publish filters and virtualPageHtmlPlugins for pages rendered from files (bases-page#11) 2026-11-09 04:32:27 +01:00
Emile Bangma df7e0180da Merge pull request #2610 from jackyzha0/dev-mode/lockfile-5.1-plugins
chore: lockfile for the 5.1 plugin releases; drop github-slugger
2026-11-09 03:43:31 +01:00
Emile Bangma 0787f97149 Merge pull request #2607 from jackyzha0/dev-mode/content-errors
fix: report more content problems as content problems
2026-11-09 03:43:28 +01:00
Emile Bangma b29db43197 Merge pull request #2609 from jackyzha0/dev-mode/esbuild-exit
fix: stop esbuild before exiting on a build error
2026-11-09 03:40:22 +01:00
Emile Bangma 214f478389 Merge pull request #2608 from jackyzha0/dev-mode/heading-alias-transclusion
fix: embed a section by the anchor Obsidian writes for its heading
2026-11-09 03:40:19 +01:00
Emile Bangma 66f2578e42 Merge pull request #2606 from jackyzha0/dev-mode/folder-virtual-pages
fix: folder pages include the pages of page types that render files
2026-11-09 03:40:15 +01:00
saberzero1 01bc5c5c88 chore: lockfile for the plugin releases (utils 1.1.1, GitHubFlavoredMarkdown 2.1.0, BasesPage 1.1.0, …); drop github-slugger 2026-11-09 03:39:02 +01:00
saberzero1 60c8318b34 chore: changeset names the GitHubFlavoredMarkdown release that marks Obsidian anchors (2.1.0) 2026-11-09 03:36:20 +01:00
saberzero1 28fcb64720 fix: stop esbuild before exiting on a build error 2026-11-09 02:33:30 +01:00
saberzero1 2ef60c6be5 fix: header transclusion matches a heading's Obsidian-anchor alias 2026-11-08 19:28:04 +01:00
saberzero1 913f9f06b5 fix: folder hierarchy includes file-backed virtual pages (.base, .canvas) so folder pages list them (#2576) 2026-11-08 19:13:02 +01:00
46 changed files with 1370 additions and 306 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
When a build stops on an error, Quartz stops esbuild before exiting. esbuild runs as a child process that writes to the same terminal; left running, it could print "fatal error: all goroutines are asleep - deadlock!" and a long goroutine dump after Quartz's error message.
+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.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
Embedding a section by the anchor Obsidian writes for its heading works when that anchor differs from the heading's id: `![[note#Colon unspaced]]` now embeds `## Colon:unspaced`. It needs GitHubFlavoredMarkdown 2.1.0 or later, which marks those anchors on the heading.
+10
View File
@@ -0,0 +1,10 @@
---
"@jackyzha0/quartz": patch
---
Links as in Obsidian 1.15.0:
- A Markdown link whose path is not valid percent-encoding (`[x](%zz)`, `[x](a%E2.md)`) is an external link. Before, it failed the whole build with `URI malformed`.
- Link paths are NFC-normalized, so a link spelled with a decomposed `é` reaches `café.md`.
- An image of a file the site doesn't have, with no alt text, gets its percent-decoded path as alt (`![](missing%20pic.png)` → “missing pic.png”), as Obsidian names a missing embed.
- A wikilink's `^id` no longer names its paragraph (Obsidian Flavored Markdown).
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
On Windows, regenerating `.quartz/plugins/index.ts` (`npm run install-plugins`, which also runs before every `npm run build`) no longer skips npm plugins with "dist/index.d.ts could not be found", which left exports such as `ExternalPlugin.Explorer` undefined. The package's location was read from a `file:` URL's pathname (`/C:/…`), which is not a Windows path.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
Plugin fixes for Windows: relative aliases (`./old`, `../x`) redirect to the right page (alias-redirects 1.0.3), and git dates of notes in folders are read from git instead of the filesystem (created-modified-date 1.0.3).
+12
View File
@@ -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).
- **Bases now behave as in Obsidian 1.15** (BasesPage 1.2.0, checked against real Obsidian): subtracting dates gives a duration (`(due - today()).days`); nested tags match (`file.tags.contains("#project")` finds `#project/x`); dates display in the site's locale, and `date()` reads only ISO-style dates; cards use Obsidian's aspect ratio and layout; `link()` with any URL is an external link; a base opens on its first view; tags link to their tag pages; `this.<property>` in an embedded base reads the embedding note. Base views also list canvas and Excalidraw files with their real paths, `this` in an embedded base is that note, and Quartz's generated pages (404, tags, folder listings) no longer appear as notes. **Changed:** `file.tags` keeps `#` and the original case, the `tags` property no longer includes inline tags, `hasTag(a, b)` matches any of its tags, the root folder is `/`, text `contains` ignores case, and the cards' `imageAspectRatio` is height/width (it was inverted). `file.name` is as in Obsidian: a Markdown note's name has no extension (`Note`), other files keep theirs (`Plan.canvas`); `file.fullname` has the extension for every file.
- 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.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
Plugins use Quartz's own Preact instead of each bundling a copy, so components can use hooks and context across plugins (a component using `preact/hooks` with another plugin's components crashed), and plugin bundles are smaller. The default plugins and the plugin template are updated; a third-party plugin made from the template before this release still bundles its own copy until it updates its `tsup.config.ts` (see quartz-community/plugin-template).
+11
View File
@@ -0,0 +1,11 @@
---
"@jackyzha0/quartz": minor
---
Prefetching: Quartz fetches pages before their links are followed, so they open at once. New `configuration.prefetch`:
- `viewport` (default): links on screen are fetched while the browser is idle, and links pointed at, focused or touched first.
- `hover`: only links pointed at, focused or touched.
- `"off"`.
It works with and without SPA routing. With SPA routing, fetched pages are kept in memory (five minutes, at most 40) and used by both page navigation and popover previews, which no longer download a page the router fetches again. Without it, Quartz asks the browser to prefetch (Speculation Rules, or `<link rel="prefetch">`). Nothing is prefetched from links to other sites, files, or pages the site doesn't have, or with Data Saver on or a 2G connection (except links pointed at). Add `data-no-prefetch` to a link to exclude it. See https://quartz.jzhao.xyz/features/prefetching
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": minor
---
Pages that page types render from files (`.base`, `.canvas`, Excalidraw drawings) follow the site's publish filters (quartz-community/bases-page#11). The filters see each such page with the frontmatter its page type gives it and `file.data.referencedBy`, the published pages that link to it; a page a filter rejects is not emitted and not listed in the content index, sitemap, RSS, folder pages, explorer or search, and can't be embedded. Before, every such file was published regardless of the filters. New transformer hook `virtualPageHtmlPlugins(ctx, content)`: rehype plugins run on these pages' rendered bodies, which never pass through `htmlPlugins`, so plugins such as encrypted-pages can encrypt them.
@@ -0,0 +1,7 @@
---
"@jackyzha0/quartz": patch
---
A local plugin source written with Windows separators (`.\my-plugin`, `..\plugins\my-plugin`) is recognised as a local path. Before, it was read as a git or npm source and failed with "Expected github:owner/repo".
Pretty links shorten link text the same way on every OS: Windows also cut it at a backslash (`[[a\b]]` showed `b`).
+5 -1
View File
@@ -96,6 +96,7 @@ export type QuartzTransformerPluginInstance = {
textTransform?: (ctx: BuildCtx, src: string) => string
markdownPlugins?: (ctx: BuildCtx) => PluggableList
htmlPlugins?: (ctx: BuildCtx) => PluggableList
virtualPageHtmlPlugins?: (ctx: BuildCtx, content: ProcessedContent[]) => PluggableList
externalResources?: (ctx: BuildCtx) => Partial<StaticResources>
}
```
@@ -105,6 +106,7 @@ All transformer plugins must define at least a `name` field to register the plug
- `textTransform` performs a text-to-text transformation _before_ a file is parsed into the [Markdown AST](https://github.com/syntax-tree/mdast).
- `markdownPlugins` defines a list of [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md). `remark` is a tool that transforms Markdown to Markdown in a structured way.
- `htmlPlugins` defines a list of [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md). Similar to how `remark` works, `rehype` is a tool that transforms HTML to HTML in a structured way.
- `virtualPageHtmlPlugins` (Quartz 5.1+) defines rehype plugins for the pages that page types render from files (`.base`, `.canvas`, Excalidraw drawings). Those pages are rendered when emitting and never pass through `htmlPlugins`, so a plugin that should also act on them (e.g. encryption) registers its rehype plugin here too. They run on the page's rendered body, with the page's vfile (`file.data.frontmatter`, `file.data.referencedBy`), after the filters published the page; the page then shows the resulting tree. `content` is the published content.
- `externalResources` defines any external resources the plugin may need to load on the client-side for it to work properly.
Normally for both `remark` and `rehype`, you can find existing plugins that you can use. If you'd like to create your own `remark` or `rehype` plugin, checkout the [guide to creating a plugin](https://unifiedjs.com/learn/guide/create-a-plugin/) using `unified` (the underlying AST parser and transformer library).
@@ -257,6 +259,8 @@ export type QuartzFilterPluginInstance = {
A filter plugin must define a `name` field and a `shouldPublish` function that takes in a piece of content that has been processed by all the transformers and returns a `true` or `false` depending on whether it should be passed to the emitter plugins or not.
Filters also see the pages that page types render from files (Quartz 5.1+; page types that declare `fileExtensions`, e.g. `.base` and `.canvas` pages), with the frontmatter the page type gives them and `file.data.referencedBy`: the published pages that link to them. A page a filter rejects is not emitted, listed or embeddable. Such files may have no frontmatter (`.base`, `.canvas`): [[ExplicitPublish]] publishes them when a published page links to them.
For example, here is a filter that removes drafts (Quartz has this [[RemoveDrafts|built in]]):
```ts
@@ -389,7 +393,7 @@ export interface QuartzPageTypePluginInstance {
- `name`: A unique identifier for this page type.
- `priority`: Controls matching order when multiple page types could match a slug. Higher priority page types are checked first. Default: `0`.
- `fileExtensions`: Array of file extensions this page type handles (e.g. `[".canvas"]`, `[".base"]`). Content files (`.md`) are handled by the default content page type.
- `fileExtensions`: Array of file extensions this page type handles (e.g. `[".canvas"]`, `[".base"]`). Content files (`.md`) are handled by the default content page type. The pages of such a page type stand for files: Quartz runs the site's filters on them (Quartz 5.1+), so give each page the file's `filePath` / `relativePath` and, if the file has frontmatter, that frontmatter.
- `match`: A function that determines whether a given slug/file should be rendered by this page type.
- `generate`: An optional function that produces virtual pages (pages not backed by files on disk, such as folder listings or tag indices). It receives `{ content, cfg, ctx }` and returns the pages, or (Quartz 5.1+) a promise of them, so it can do async work such as running content through the site's transformers or bundling with esbuild. Page types generate one after another, in priority order. A plugin with an async `generate` should declare `"quartzVersion": ">=5.1.0"`, since older versions don't wait for it.
- `layout`: The layout configuration key (e.g. `"content"`, `"folder"`, `"tag"`). This determines which `byPageType` entry in `quartz.config.yaml` provides the layout overrides for this page type.
+1
View File
@@ -27,6 +27,7 @@ This part of the configuration concerns anything that can affect the whole site.
- `pageTitleSuffix`: a string added to the end of the page title. This only applies to the browser tab title, not the title shown at the top of the page.
- `enableSPA`: whether to enable [[SPA Routing]] on your site.
- `enablePopovers`: whether to enable [[popover previews]] on your site.
- `prefetch`: fetch pages before their links are followed, so they open at once ([[prefetching]]): `viewport` (default, links on screen and links pointed at), `hover` (only links pointed at) or `"off"`. Works with and without SPA routing.
- `analytics`: what to use for analytics on your site. Values can be
- `null`: don't use analytics;
- `{ provider: 'google', tagId: '<your-google-tag>' }`: use Google Analytics;
+2
View File
@@ -11,3 +11,5 @@ Under the hood, this is done by hijacking page navigations and instead fetching
## Configuration
- Disable SPA Routing: set the `enableSPA` field of the [[configuration]] in `quartz.config.yaml` to be `false`.
Pages are fetched ahead of a click by [[prefetching]], which the router uses to show them at once.
+32
View File
@@ -0,0 +1,32 @@
---
title: Prefetching
tags:
- feature
---
Quartz fetches the pages a reader is likely to open next before they click, so following a link shows the page at once instead of waiting for the network. It works with and without [[SPA Routing]].
## How it works
- **`viewport`** (the default): links on screen are fetched while the browser is idle, two at a time and at most 30 per page view. Pointing at a link or focusing it with the keyboard fetches it first, and touching it on a phone fetches it immediately.
- **`hover`**: only links that are pointed at for a moment, focused or touched are fetched.
With [[SPA Routing]], Quartz keeps the fetched pages in memory for five minutes (at most 40 of them), and both page navigation and [[popover previews]] use them, so a page is never downloaded twice. Without SPA routing every link is a normal page load, so Quartz asks the browser to prefetch instead: with [Speculation Rules](https://developer.mozilla.org/en-US/docs/Web/API/Speculation_Rules_API) where the browser supports them, otherwise with `<link rel="prefetch">`.
Quartz never prefetches:
- links to other sites, links that open in a new tab, and downloads;
- links to files such as images and PDFs (only pages);
- with `viewport`, links on screen to pages that aren't in the site's content index (so a broken link in your layout doesn't show up as a 404 on every page);
- anything but links the reader points at, when the browser asks to save data (Data Saver) or the connection is 2G.
To exclude a single link, add `data-no-prefetch` to it in HTML. Links with `data-router-ignore` are never prefetched either.
## Configuration
Set `prefetch` in the [[configuration]] in `quartz.config.yaml`:
```yaml title="quartz.config.yaml"
configuration:
prefetch: viewport # or hover, or "off"
```
+2
View File
@@ -12,6 +12,8 @@ There may be some notes you want to avoid publishing as a website. Quartz suppor
If you'd like to only publish a select number of notes, you can instead use [[ExplicitPublish]] which will filter out all notes except for any that have `publish: true` in the frontmatter.
Bases, canvases and Excalidraw drawings follow the same filters. A drawing stored as Markdown has frontmatter of its own. A `.base` or `.canvas` file has none: with [[ExplicitPublish]] it is published when a published note links to it, and with encrypted pages it is encrypted with the password of the encrypted note that links to it.
> [!warning]
> Regardless of the filter plugin used, **all non-markdown files will be emitted and available publicly in the final build.** This includes files such as images, voice recordings, PDFs, etc.
+2
View File
@@ -16,6 +16,8 @@ This plugin filters content based on an explicit `publish` flag in the frontmatt
This plugin has no configuration options.
Files without frontmatter — `.base`, `.canvas` and `.excalidraw` files — can't be marked `publish: true`. They are published when a published page links to them (`[[Board.canvas]]`, or an embed such as `![[Board.canvas]]`), like Obsidian Publish adding the files a published note links to, and not otherwise. A base embedded in a published note renders inside it without a page of its own. A drawing stored as Markdown (`.excalidraw.md`) follows its own `publish:` like a note. (Quartz 5.1+.)
> [!tip]
> Images and other files are copied to your site whether or not a published page uses them. Set `configuration.publishAssets: referenced` to only publish the files that published pages link to or embed.
+19
View File
@@ -10,8 +10,27 @@ export declare global {
): void
dispatchEvent<K extends keyof CustomEventMap>(ev: CustomEventMap[K] | UIEvent): void
}
/** A page fetched ahead by prefetch.inline.ts (`url` is where it came from, after redirects). */
interface PrefetchedPage {
url: string
contentType: string
/** The HTML; missing when the link turned out not to be a page. */
text?: string
}
interface Window {
spaNavigate(url: URL, isBack: boolean = false)
addCleanup(fn: (...args: any[]) => void)
/**
* Set when prefetching is on: the page at `url` from the prefetch cache, or fetched now and
* kept (undefined if it could not be fetched).
*/
quartzPrefetch?: {
load(url: URL): Promise<PrefetchedPage | undefined>
}
/** Absolute URL of the site's static/ folder (renderPage.tsx) */
quartzStaticUrl?: string
/** Prefetch settings, written by componentResources.ts ahead of prefetch.inline.ts */
__quartzPrefetchMode?: "viewport" | "hover"
__quartzSpa?: boolean
}
}
+183 -201
View File
@@ -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.3",
"@quartz-community/article-title": "^1.0.2",
"@quartz-community/backlinks": "^1.0.3",
"@quartz-community/bases-page": "^1.2.1",
"@quartz-community/breadcrumbs": "^1.0.3",
"@quartz-community/canvas-page": "^1.0.3",
"@quartz-community/citations": "^1.0.1",
"@quartz-community/cname": "^1.0.1",
"@quartz-community/comments": "^1.0.2",
"@quartz-community/content-meta": "^1.0.2",
"@quartz-community/content-page": "^1.0.3",
"@quartz-community/created-modified-date": "^1.0.3",
"@quartz-community/darkmode": "^1.0.2",
"@quartz-community/description": "^1.0.2",
"@quartz-community/encrypted-pages": "^1.1.1",
"@quartz-community/explicit-publish": "^1.1.0",
"@quartz-community/explorer": "^1.0.3",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.0.3",
"@quartz-community/footer": "^1.1.1",
"@quartz-community/github-flavored-markdown": "^2.1.1",
"@quartz-community/graph": "^1.0.3",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.0.1",
"@quartz-community/note-properties": "^1.1.4",
"@quartz-community/obsidian-flavored-markdown": "^2.1.3",
"@quartz-community/og-image": "^1.1.1",
"@quartz-community/ox-hugo": "^1.0.1",
"@quartz-community/page-title": "^1.0.2",
"@quartz-community/quartz-fonts": "^1.0.2",
"@quartz-community/reader-mode": "^1.0.2",
"@quartz-community/recent-notes": "^1.0.3",
"@quartz-community/roam": "^1.0.1",
"@quartz-community/search": "^1.0.3",
"@quartz-community/spacer": "^1.0.2",
"@quartz-community/stacked-pages": "^1.0.3",
"@quartz-community/syntax-highlighting": "^1.0.3",
"@quartz-community/table-of-contents": "^1.0.3",
"@quartz-community/tag-list": "^1.0.3",
"@quartz-community/tag-page": "^1.0.3",
"@quartz-community/unlisted-pages": "^1.1.0",
"@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.3.0",
"@quartz-community/utils": "^1.2.0",
"@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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/alias-redirects/-/alias-redirects-1.0.3.tgz",
"integrity": "sha512-kA3MiAneoHlC09uQJxF1ex1GktkUf9Rm53b0ybeJrtNEcteRoqBCELHB+pf6hUj9i/k2Epx0J8RyTSe/zwTg2A==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.0"
"@quartz-community/utils": "^1.1.0"
},
"engines": {
"node": ">=22",
@@ -2377,9 +2376,9 @@
}
},
"node_modules/@quartz-community/article-title": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/article-title/-/article-title-1.0.1.tgz",
"integrity": "sha512-i/pDWGHrbkYJ4ZmZTecgUu6SWKoeac/CCSp5/AD1owdSp5AM3OeHJMvy3cgtiVRk80p/QY27C60RyVKj1NT5Dg==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/article-title/-/article-title-1.0.2.tgz",
"integrity": "sha512-WQISg0GyglaRx4HsfUu43ny7PVe1lGk0fVohVOQu46JWKAk+UJCqP09BigRwzRJuqcUOzawjxueire1agfUwVA==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/backlinks/-/backlinks-1.0.3.tgz",
"integrity": "sha512-9CKvHhWi7SSahr+dswf2MAZQOMl/1sNDnx8Z3rE6USkuXu+RKc1agKgIzP+wHV1ttojiI9kkYdZclT+QUMEhmA==",
"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.2.1",
"resolved": "https://registry.npmjs.org/@quartz-community/bases-page/-/bases-page-1.2.1.tgz",
"integrity": "sha512-mONeRLsZTNPT5fOJfdlM1Uq97V7aGnxSRZaT0X4PsR5bbEAIjnBoVEdsYrYZWypm/c6go58/59fXbpeexKFsFw==",
"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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/breadcrumbs/-/breadcrumbs-1.0.3.tgz",
"integrity": "sha512-ciGV+xk98Nl5WqxTSyfyzDC+dWcSVjQcN2qN1GjnSKSeuPgX1/LQhpr1VHiDAVd3XpLMr/c7Gg19UkdMvBPgKQ==",
"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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/canvas-page/-/canvas-page-1.0.3.tgz",
"integrity": "sha512-sUzjMZ+DKDYaN92zhUcVtuCodeFg8JvvoddeH3ZGBYdC8eXIqXhLYZx31mkBTjiLgx0Q4ACGduKpOYhkfTgrtQ==",
"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",
@@ -2534,9 +2532,9 @@
}
},
"node_modules/@quartz-community/comments": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/comments/-/comments-1.0.1.tgz",
"integrity": "sha512-Q4mbmvD6jfJOdeBGzL3W9gPHIVpVVtnZQVrJmM35BFwJh7QtvOAEL/MsTwzYVPz4JRg0fugL39V8dtKL76OBDA==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/comments/-/comments-1.0.2.tgz",
"integrity": "sha512-cHFjN7yn7rxgDzEOboM5viYOk1ex4Y/gIfDqN/BLNlqhPaZIkl2dq7RcYmkeVAz9kAJqNSj+WPQdVpB/2PGIGw==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2556,9 +2554,9 @@
}
},
"node_modules/@quartz-community/content-meta": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/content-meta/-/content-meta-1.0.1.tgz",
"integrity": "sha512-FHoC0gV8bDbrefwy64VmjAjmKZqMxsC7xWpKb+Ks5b1iJLpLYjtJh3L6recVwjMnrCKFlxa1d/IEsNeJyqxndQ==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/content-meta/-/content-meta-1.0.2.tgz",
"integrity": "sha512-DFiLi8MY4v+qQT4WOBFwXTGG46S0iSCDziJ0Vnc4T46iDhoj4NeQc6FowuaUuxf770tGX6rguVBJMPCZ3NGerQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/content-page/-/content-page-1.0.3.tgz",
"integrity": "sha512-zJJVACyJkwRull7GJOE57CcfjMNdYwATpY7aZQhhUCdu8NR4w0RJF3CfTc9QeQZ0mJL94A2KEKoa2gwbcy6UPg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.0"
"@quartz-community/utils": "^1.1.0"
},
"engines": {
"node": ">=22",
@@ -2604,9 +2602,9 @@
}
},
"node_modules/@quartz-community/created-modified-date": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/created-modified-date/-/created-modified-date-1.0.2.tgz",
"integrity": "sha512-XMfFV4hwBVrRxtMO8QjWhXqarOHaip483oW3YHfqqcCfInlVCrDHRzAgpurOvTcLrlc60p6S7sZfRXwQYko/Sw==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@quartz-community/created-modified-date/-/created-modified-date-1.0.3.tgz",
"integrity": "sha512-oSFR4oK5ELG/Ya2Z1ah51P8p7q9dDaNTSg1cA4Op4c1xETfCmwIfS0wx6gF62MsypSR9uRavr+cfDJXxsujjWg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0"
@@ -2629,9 +2627,9 @@
}
},
"node_modules/@quartz-community/darkmode": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/darkmode/-/darkmode-1.0.1.tgz",
"integrity": "sha512-5HYQEMc1lM5P2PZazerq7sufLhcJ7WFURjQMXhJDqzhJOIz1I5csjd5UDGR/l/0vZayfrVzuWffgydOs8MwkYA==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/darkmode/-/darkmode-1.0.2.tgz",
"integrity": "sha512-FCfR8bdg248Y1NJhN6TWVBENwFiJak3gwqmpof/GMeTXr6e76FPe2ggTTz66a+s9UQ/ZC3JKU9xpHQi0zcGhyQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -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",
@@ -2673,9 +2671,9 @@
}
},
"node_modules/@quartz-community/encrypted-pages": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/encrypted-pages/-/encrypted-pages-1.0.1.tgz",
"integrity": "sha512-KHBOEphODF5Lh+Ziv3jLar+k1DCU9Y7SRzBcDLWi/JJO99DQv29e6mwE2tZwcwom2cEUymOVjNpTJ7smEb/oTA==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/encrypted-pages/-/encrypted-pages-1.1.1.tgz",
"integrity": "sha512-x+fFfXiurYn2BWgKuzwiZGTVq6osVbaUyIVoYXvNakwwIQQeuSGVyqWdA25bCK1nxYVRGXPS/d1emHrCLRgv9w==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2699,9 +2697,9 @@
}
},
"node_modules/@quartz-community/explicit-publish": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/explicit-publish/-/explicit-publish-1.0.1.tgz",
"integrity": "sha512-tM8CrgpEXZfT0/35hOZGl7QmqrAGYmqYZE0JA76Mh/b90Q8ewGZRCFPwnj3AQqIAfheGeSmhFFXHwnuf7biPTg==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/explicit-publish/-/explicit-publish-1.1.0.tgz",
"integrity": "sha512-Xdo69D2x/VufWQviPOuQp/OkLQ8XVGwyt3KO+DN9/ablMvWAXSlYIA11pcP1Y4UgxBMzMhpZ4+BLZqTGlz1SRg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0"
@@ -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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/explorer/-/explorer-1.0.3.tgz",
"integrity": "sha512-NksQMrCmOL7xWfH7CCA9kXaQboLWgJfZ5wsDnFaIoZEvg8BzC6x2hipMi5dj/4dkitiZhDY3kjnGsGtc0oZUIw==",
"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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.0.3.tgz",
"integrity": "sha512-d2XN0NOSNXL9cwJqsllWXN7ugCAyCgx7AQl9ByJa3Qe/xvhqsyO84WPiS/BQOFBFlbRcozPHBN6tFZhiWrR5SQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.0"
"@quartz-community/utils": "^1.1.0"
},
"engines": {
"node": ">=22",
@@ -2781,9 +2779,9 @@
}
},
"node_modules/@quartz-community/footer": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/footer/-/footer-1.1.0.tgz",
"integrity": "sha512-PUMTJiDAR4PrC4o745jrEhAwGRKETnYvcxS6OcKRzbOaW3N9q9ndEO4c7mur7CHccWhPdok3TwxRofz8fWTVDg==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/footer/-/footer-1.1.1.tgz",
"integrity": "sha512-D1xMkN5kTHmTBH5mcJs1pjxo6wl2HDU/kE8F3kPbCciydAGq1APBnt59v8P+K0Cd8jVeTTtbXfYdZ463xEgKaQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -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.1",
"resolved": "https://registry.npmjs.org/@quartz-community/github-flavored-markdown/-/github-flavored-markdown-2.1.1.tgz",
"integrity": "sha512-31SqmzJZfkGnEg5vkYEECp01G0W0d4Sr/QrzdYcn8hk9qmwxPNTXLZWnaDBt50NilTOoLLleZhHl+FsyACaa8Q==",
"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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.3.tgz",
"integrity": "sha512-qfOiUpWUoZs/nIwV/iJgEjLWuWDR940O5mYBL2/dugbQHW05dDMhlF6hzrXgDlihnB000HDGtGk7LbL/ezdKkg==",
"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.4",
"resolved": "https://registry.npmjs.org/@quartz-community/note-properties/-/note-properties-1.1.4.tgz",
"integrity": "sha512-MTj7D4+CzmuYzZ8UwF8T5uzFf+JHoA2NzRCniuhug4h6KVxf3IRePqn5uVupjm/0Uzz2oeB7UX8Nr0hH0SNAdg==",
"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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/obsidian-flavored-markdown/-/obsidian-flavored-markdown-2.1.3.tgz",
"integrity": "sha512-p5fls4M7ocUKrlF8MmfrlnNPEvBFZ5diVNVVkLsgTwCvzf19MrnczeKb3Q2yI2S1G2Xb0rXsq8kmF8faj+Q79A==",
"license": "MIT",
"dependencies": {
"@quartz-community/rehype-obsidian": "^1.2.0",
"@quartz-community/remark-obsidian": "^2.1.0",
"@quartz-community/rehype-obsidian": "^1.3.0",
"@quartz-community/remark-obsidian": "^2.2.1",
"@quartz-community/types": "^1.1.0",
"@quartz-community/utils": "^1.0.0",
"@quartz-community/utils": "^1.2.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",
@@ -2994,9 +2993,9 @@
}
},
"node_modules/@quartz-community/page-title": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/page-title/-/page-title-1.0.1.tgz",
"integrity": "sha512-1KbSYyyAgsKeHWPv1/1IKmj1amSXSJZOV2Rdj44su8HPzW5CiUItam4Vnz0zNw7ElHq0/glNFS+r9RTuPE7sKw==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/page-title/-/page-title-1.0.2.tgz",
"integrity": "sha512-nZir6dVcbp2NN+qr1Gz1e8FmM4NvrsyWzelx0EoXL0lxvIghDrfCW0epImz0NC39264enSS1fHu+b8CG7z8KeA==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -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",
@@ -3046,9 +3045,9 @@
}
},
"node_modules/@quartz-community/reader-mode": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/reader-mode/-/reader-mode-1.0.1.tgz",
"integrity": "sha512-k3fynx1Cer6jKg+B55XmJJtO6UPAS9QCnSYefyZWTcuYyXiy+hKjaBFeeWJgBf3szCEswrQZG4DubyC5Si0FPg==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/reader-mode/-/reader-mode-1.0.2.tgz",
"integrity": "sha512-Mm7llTF6erRk9ASrkcfYIKApfFf/yrBiYsPs+P8vx8qXaVziem/4e2G6wnT2EQQFUuYSSKklZ328V7rfN6fRRg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/recent-notes/-/recent-notes-1.0.3.tgz",
"integrity": "sha512-KxClnDJEixByDNwGbJfKqg/I5sHs1OwTAw+6UCIBcIJYeEszYD21F770NOrnaGQvrrBd5FITihVt8R48nsrSQQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.0"
"@quartz-community/utils": "^1.1.0"
},
"engines": {
"node": ">=22",
@@ -3090,18 +3089,18 @@
}
},
"node_modules/@quartz-community/rehype-obsidian": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@quartz-community/rehype-obsidian/-/rehype-obsidian-1.2.1.tgz",
"integrity": "sha512-wuxPcG5ie4J7x7KMfOZMDSgyNKFJf6x6I+I6H4XaZ4WX4sPlEfMUDTvxBoHRHpstqfCRX5Hy73d/K9/rYAZdnw==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@quartz-community/rehype-obsidian/-/rehype-obsidian-1.3.0.tgz",
"integrity": "sha512-62YFEr3NR/Z2G/wcq30/VVKTlT4RUKezWfwGTQkNC+9mAXcUb3gAwjgiUJwylXZQyZmBf+SZsCNmdhIb7CPh/g==",
"license": "MIT",
"engines": {
"node": ">=22"
}
},
"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.1",
"resolved": "https://registry.npmjs.org/@quartz-community/remark-obsidian/-/remark-obsidian-2.2.1.tgz",
"integrity": "sha512-Q18F/Px8db8Evf6uwPKz0RMhZNyrsH2Okzhr6FWcsm51fYgJR+SiO98/2fmXQ3wnqV2eeJC7ZMzi81SDjK8vrg==",
"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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.0.3.tgz",
"integrity": "sha512-jrmV6D91w948vJvvMTjD8L6nzxfCdqXRvk7tB+JpDwQtGzRI42Buq5psPZaWlcizyXC95MfGbUI9fTvnxJc7WQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.0"
"@quartz-community/utils": "^1.1.0"
},
"engines": {
"node": ">=22",
@@ -3154,9 +3153,9 @@
}
},
"node_modules/@quartz-community/spacer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/spacer/-/spacer-1.0.1.tgz",
"integrity": "sha512-fl/H/NaLdrHxP3R5VtABcaHYGshBNxmEIhAYxeAU+/q0ork5OCHDyxdUd+ZZYWOvK/KD42vBbAQEfzkYVuM9+Q==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/spacer/-/spacer-1.0.2.tgz",
"integrity": "sha512-AET+6OOYyMGbHGbEvZvBzkLiXbTBX4odJ2aWGde1HrLMdE/IJzL1HV2jbNPhC1AilA8gQf3fpNNxaimoSldyRQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0"
@@ -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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/stacked-pages/-/stacked-pages-1.0.3.tgz",
"integrity": "sha512-wdILZkQpYL9k490iXzNRkWtrDyRBxCfs+rqz3JUWPyMAq3ztlyH0UtDoyB+zDUN9XryPqmTf0b3rtiKlQLiJFg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.0"
"@quartz-community/utils": "^1.1.1"
},
"engines": {
"node": ">=22",
@@ -3201,9 +3200,9 @@
}
},
"node_modules/@quartz-community/syntax-highlighting": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/syntax-highlighting/-/syntax-highlighting-1.0.2.tgz",
"integrity": "sha512-G2/auy9ilQ0vLEZyi5C5/BZe9Us+Ds89wnSfi5z4ciBS3rWD1dtLTbnQQyWTLd1hIzCFOtVsPTM1N+2hkVTgSQ==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@quartz-community/syntax-highlighting/-/syntax-highlighting-1.0.3.tgz",
"integrity": "sha512-rD3cNLNCytlUyRR7b2emBmEchMGiNqNoAsZlhgqqQjez523lDMl9Qhxpuw6EgnAYn8uEWOTnOZF5c+jTSkEF+A==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0"
@@ -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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/table-of-contents/-/table-of-contents-1.0.3.tgz",
"integrity": "sha512-BktvbmiyCRZ/iCZ6qQNXo+4amburwcGn2hmsiL4QN7Keruo8EuZPvLaXtrO4E25DO5XeMGovgbOoFNMKIia1yA==",
"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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-list/-/tag-list-1.0.3.tgz",
"integrity": "sha512-pwbbFAfdOL/xVG6Q7e+G0plC/BHHOLcpwssRn+77KxBcJPC2Z6fMqLCz8tW10T62/KoE/ig50S7iZbx36e+Njg==",
"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.3",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.3.tgz",
"integrity": "sha512-2D9w5gXKxERPny9uFb64iOG+DqcAmieYDu+x0DFPULh/UTlYm6xk2adwrTfi6lFouzl/UoHRmHxjumC3zwNvWQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.0"
"@quartz-community/utils": "^1.1.0"
},
"engines": {
"node": ">=22",
@@ -3296,9 +3295,9 @@
}
},
"node_modules/@quartz-community/types": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@quartz-community/types/-/types-1.2.0.tgz",
"integrity": "sha512-82L+hallWn9LCMw9kFUWJhAGwlTd4rT2KxxL8B7IAWTEvj/20StWsuC01Mbfk5hLhd8jAHGgj1WHb0u/cdUXEA==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@quartz-community/types/-/types-1.3.0.tgz",
"integrity": "sha512-tdLWSv+XWqHGiuo77etvXkd2XO1S12NlUUbiC9o+o9BWgW7E/lcNl6A+I8c9uKbAj9CrIn7suK7z9154rlSwlQ==",
"license": "MIT",
"dependencies": {
"unified": "^11.0.5",
@@ -3322,13 +3321,12 @@
}
},
"node_modules/@quartz-community/unlisted-pages": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/unlisted-pages/-/unlisted-pages-1.0.1.tgz",
"integrity": "sha512-X7hlz1/i0CJMp13Px3p6tsJYBsAOFAWyAKx9hvospPDUnpMVFcNbTILGqrGKepCcgq8TQQ8GEIZdvNccxWmsPQ==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/unlisted-pages/-/unlisted-pages-1.1.0.tgz",
"integrity": "sha512-Gi67xF7AIC860/Glwbi+Ewbbnvox3A3MPsTi2Dz25xuaepZLfnQAwCT4ZgAsy55y4wyxxZG8DBHjkOgRyd9PXQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
"@quartz-community/utils": "^1.0.0"
"@quartz-community/types": "^1.0.0"
},
"engines": {
"node": ">=22",
@@ -3344,9 +3342,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.2.0",
"resolved": "https://registry.npmjs.org/@quartz-community/utils/-/utils-1.2.0.tgz",
"integrity": "sha512-X32uBfhfNACQw2Ciw6F0XQ9qSoTMQeh78/2ZEj8cYuOk7VTowNf0dpjtSDKAxs1co6aSpIEcDZBIG6p953UPiQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0"
@@ -3356,17 +3354,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 +4456,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
View File
@@ -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.3",
"@quartz-community/article-title": "^1.0.2",
"@quartz-community/backlinks": "^1.0.3",
"@quartz-community/bases-page": "^1.2.1",
"@quartz-community/breadcrumbs": "^1.0.3",
"@quartz-community/canvas-page": "^1.0.3",
"@quartz-community/citations": "^1.0.1",
"@quartz-community/cname": "^1.0.1",
"@quartz-community/comments": "^1.0.2",
"@quartz-community/content-meta": "^1.0.2",
"@quartz-community/content-page": "^1.0.3",
"@quartz-community/created-modified-date": "^1.0.3",
"@quartz-community/darkmode": "^1.0.2",
"@quartz-community/description": "^1.0.2",
"@quartz-community/encrypted-pages": "^1.1.1",
"@quartz-community/explicit-publish": "^1.1.0",
"@quartz-community/explorer": "^1.0.3",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.0.3",
"@quartz-community/footer": "^1.1.1",
"@quartz-community/github-flavored-markdown": "^2.1.1",
"@quartz-community/graph": "^1.0.3",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.0.1",
"@quartz-community/note-properties": "^1.1.4",
"@quartz-community/obsidian-flavored-markdown": "^2.1.3",
"@quartz-community/og-image": "^1.1.1",
"@quartz-community/ox-hugo": "^1.0.1",
"@quartz-community/page-title": "^1.0.2",
"@quartz-community/quartz-fonts": "^1.0.2",
"@quartz-community/reader-mode": "^1.0.2",
"@quartz-community/recent-notes": "^1.0.3",
"@quartz-community/roam": "^1.0.1",
"@quartz-community/search": "^1.0.3",
"@quartz-community/spacer": "^1.0.2",
"@quartz-community/stacked-pages": "^1.0.3",
"@quartz-community/syntax-highlighting": "^1.0.3",
"@quartz-community/table-of-contents": "^1.0.3",
"@quartz-community/tag-list": "^1.0.3",
"@quartz-community/tag-page": "^1.0.3",
"@quartz-community/unlisted-pages": "^1.1.0",
"@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.3.0",
"@quartz-community/utils": "^1.2.0",
"@types/hast": "^3.0.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "^26.5.1",
+1
View File
@@ -4,6 +4,7 @@ configuration:
pageTitleSuffix: ""
enableSPA: true
enablePopovers: true
prefetch: viewport
analytics:
provider: plausible
locale: en-US
+6
View File
@@ -68,6 +68,12 @@ export interface GlobalConfiguration {
enableSPA: boolean
/** Whether to display Wikipedia-style popovers when hovering over links */
enablePopovers: boolean
/**
* Fetch pages before their links are followed, so they open at once (works with and without
* SPA routing). `viewport` (default): links on screen, while the browser is idle, and links
* pointed at. `hover`: only links pointed at, focused or touched. `off`: never.
*/
prefetch?: "viewport" | "hover" | "off"
/** Analytics mode */
analytics: Analytics
/** Glob patterns to not search */
+2
View File
@@ -428,6 +428,8 @@ export async function handleBuild(argv) {
`${styleText("red", "Failed to build Quartz.")} Check for syntax errors in your configuration or plugins.`,
)
console.log(`Reason: ${styleText("gray", err.message ?? String(err))}`)
// stop esbuild's child process first: it shares our stderr and outlives us otherwise
void esbuild.stop()
process.exit(1)
})
release()
+4
View File
@@ -264,6 +264,10 @@ export function isLocalSource(source) {
if (url.startsWith("./") || url.startsWith("../") || url.startsWith("/")) {
return true
}
// Windows relative paths (.\plugin, ..\plugin)
if (url.startsWith(".\\") || url.startsWith("..\\")) {
return true
}
// Windows absolute paths (e.g. C:\ or D:/)
if (/^[A-Za-z]:[\\/]/.test(url)) {
return true
+26 -1
View File
@@ -1,7 +1,12 @@
import test, { describe } from "node:test"
import assert from "node:assert"
import YAML from "yaml"
import { stringifyConfigYaml, parseGitSource, extractPluginName } from "./plugin-data.js"
import {
stringifyConfigYaml,
parseGitSource,
extractPluginName,
isLocalSource,
} from "./plugin-data.js"
const ORIGINAL = `# yaml-language-server: $schema=./quartz/plugins/quartz-plugins.schema.json
configuration:
@@ -92,3 +97,23 @@ describe("parseGitSource", () => {
assert.throws(() => parseGitSource("github:onlyowner"), /Expected github:owner\/repo/)
})
})
describe("isLocalSource", () => {
test("recognises local paths in POSIX and Windows spellings", () => {
for (const source of [
"./p",
"../p",
"/p",
".\\p",
"..\\a\\p",
"C:\\a\\p",
"D:/p",
{ repo: ".\\p" },
]) {
assert.ok(isLocalSource(source), JSON.stringify(source))
}
for (const source of ["github:a/b", "a/b", "https://github.com/a/b.git"]) {
assert.ok(!isLocalSource(source), source)
}
})
})
+3 -2
View File
@@ -12,6 +12,7 @@
*/
import fs from "node:fs"
import path from "node:path"
import { fileURLToPath } from "node:url"
import { styleText } from "node:util"
import { isIdentifier, jsString } from "./subprocess.js"
@@ -135,8 +136,8 @@ export function collectPluginExports({ pluginsDir, npmPackages = [], verbose = f
for (const pkg of npmPackages) {
let distIndex
try {
const pkgJson = new URL(import.meta.resolve(`${pkg}/package.json`)).pathname
distIndex = path.join(path.dirname(decodeURIComponent(pkgJson)), "dist", "index.d.ts")
const pkgJson = fileURLToPath(import.meta.resolve(`${pkg}/package.json`))
distIndex = path.join(path.dirname(pkgJson), "dist", "index.d.ts")
} catch {
if (verbose) console.log(styleText("yellow", `⚠`), `Skipping npm package ${pkg}: not found`)
continue
+14
View File
@@ -46,6 +46,20 @@ function fakeSite() {
}
describe("plugin index", () => {
// npm plugins are found through import.meta.resolve, which returns a file: URL. Its pathname
// is not a path on Windows (`/C:/…`), so every npm plugin was skipped there (#2616).
test("npm plugins are found through their package.json", () => {
const pluginsDir = fs.mkdtempSync(path.join(os.tmpdir(), "quartz-plugin-index-npm-"))
const entry = collectPluginExports({
pluginsDir,
npmPackages: ["@quartz-community/explorer"],
}).get("quartz-community__explorer")
assert.ok(entry, "@quartz-community/explorer was skipped")
assert.ok(entry.overridable.includes("Explorer"))
assert.strictEqual(entry.importPath, "@quartz-community/explorer")
fs.rmSync(pluginsDir, { recursive: true, force: true })
})
test("component constructors re-exported from a sub-module are wrapped (#2565)", () => {
const { root, pluginsDir } = fakeSite()
const entry = collectPluginExports({ pluginsDir }).get("my-widget")!
+40
View File
@@ -183,6 +183,46 @@ describe("renderTranscludes", () => {
assert.ok(!secondText.includes("Circular transclusion"), "should not show circular warning")
})
test("a header transclusion matches a heading's Obsidian-anchor alias", () => {
const root: Root = {
type: "root",
children: [makeTranscludeBlockquote("target", "#colon-unspaced")],
}
const targetHtml: Root = {
type: "root",
children: [
{
type: "element",
tagName: "h2",
properties: { id: "colonunspaced" },
children: [
{
type: "element",
tagName: "span",
properties: { id: "colon-unspaced", className: ["heading-alias"] },
children: [],
},
{ type: "text", value: "Colon:unspaced" },
],
},
{
type: "element",
tagName: "p",
properties: {},
children: [{ type: "text", value: "Section text" }],
},
],
}
renderTranscludes(
root,
cfg,
"current" as FullSlug,
makeComponentData([makePageData("target", targetHtml)]) as QuartzComponentProps,
new Set<FullSlug>(["current" as FullSlug]),
)
assert.ok(JSON.stringify((root.children[0] as Element).children).includes("Section text"))
})
test("detects actual circular transclusion (A -> B -> A)", () => {
// Page A embeds B, and B's htmlAst contains a transclusion of A
const bTranscludesA = makeTranscludeBlockquote("pageA")
+20 -1
View File
@@ -31,6 +31,25 @@ interface RenderComponents {
}
const headerRegex = new RegExp(/h[1-6]/)
/**
* Whether a heading answers to `id`: its own id, or the id of a `span.heading-alias` inside it.
* GitHubFlavoredMarkdown adds that alias when the anchor Obsidian writes for a heading (`:`, `|`,
* `^`, `#` and `\` become spaces) slugs differently, e.g. `![[note#Colon unspaced]]` for
* `## Colon:unspaced`.
*/
function headingHasId(heading: Element, id: string): boolean {
if (heading.properties?.id === id) return true
const hasAlias = (el: Element): boolean =>
el.children.some(
(child) =>
child.type === "element" &&
((child.properties?.id === id &&
([] as unknown[]).concat(child.properties?.className ?? []).includes("heading-alias")) ||
hasAlias(child)),
)
return hasAlias(heading)
}
export function pageResources(
baseDir: FullSlug | RelativeURL,
staticResources: StaticResources,
@@ -231,7 +250,7 @@ export function renderTranscludes(
const depth = Number(htmlEl.tagName.substring(1))
if (startIdx === undefined || startDepth === undefined) {
if (htmlEl.properties?.id === blockRef) {
if (headingHasId(htmlEl, blockRef)) {
startIdx = i
startDepth = depth
}
+10 -6
View File
@@ -55,12 +55,16 @@ async function mouseEnterHandler(
return
}
const response = await fetchCanonical(targetUrl).catch((err) => {
console.error(err)
})
// A page fetched ahead (prefetch.inline.ts) is used as is, instead of fetching it again.
const prefetched = await window.quartzPrefetch?.load(targetUrl)
const response = prefetched
? undefined
: await fetchCanonical(targetUrl).catch((err) => {
console.error(err)
})
if (!response) return
const rawContentType = response.headers.get("Content-Type")
if (!prefetched && !response) return
const rawContentType = prefetched?.contentType ?? response?.headers.get("Content-Type")
if (!rawContentType) return
const [contentType] = rawContentType.split(";")
const [contentTypeCategory, typeInfo] = contentType.split("/")
@@ -93,7 +97,7 @@ async function mouseEnterHandler(
}
break
default:
const contents = await response.text()
const contents = prefetched ? (prefetched.text ?? "") : await response!.text()
const html = p.parseFromString(contents, "text/html")
normalizeRelativeURLs(html, targetUrl)
// prepend all IDs inside popovers to prevent duplicates
@@ -0,0 +1,265 @@
import { fetchCanonical } from "./util"
/**
* Prefetching: fetch the pages a reader is likely to open next, so following a link shows the
* page at once instead of waiting for the network.
*
* - `viewport` (default): links on screen are fetched while the browser is idle, a few at a
* time; pointing at or focusing a link fetches it first.
* - `hover`: only links pointed at (after a short pause), focused, or touched.
*
* With SPA routing the pages are kept here, and the router (spa.inline.ts) and popovers
* (popover.inline.ts) take them through `window.quartzPrefetch`. Without it, every link is a full
* page load, so the browser prefetches instead: Speculation Rules where supported, otherwise
* `<link rel="prefetch">`. Nothing is prefetched with Data Saver on or on a 2G connection,
* except links pointed at.
*
* The mode is set by componentResources.ts, which prepends `window.__quartzPrefetchMode = …`.
*/
type Mode = "viewport" | "hover"
/** How long a fetched page is used before it is fetched again. */
const MAX_AGE_MS = 5 * 60 * 1000
/** Pages kept in memory (the oldest go first). */
const MAX_PAGES = 40
/** Pages fetched at once from the viewport. */
const CONCURRENCY = 2
/** Pages fetched from the viewport per page view. */
const VIEWPORT_BUDGET = 30
/** Pointing at a link this long counts as intent (instant.page's figure). */
const HOVER_DELAY_MS = 65
const mode: Mode = window.__quartzPrefetchMode === "hover" ? "hover" : "viewport"
const spa = window.__quartzSpa === true
type Cached = { time: number; page: Promise<PrefetchedPage | undefined> }
const cache = new Map<string, Cached>()
const requested = new Set<string>()
function keyOf(url: URL): string {
const u = new URL(url)
u.hash = ""
return u.toString()
}
function constrained(): boolean {
const connection = (
navigator as Navigator & { connection?: { saveData?: boolean; effectiveType?: string } }
).connection
return !!connection?.saveData || /(^|-)2g$/.test(connection?.effectiveType ?? "")
}
/** A same-site page link worth fetching ahead, or undefined. */
function targetOf(a: HTMLAnchorElement): URL | undefined {
if (!a.href || a.target === "_blank" || a.hasAttribute("download")) return
if ("routerIgnore" in a.dataset || "noPrefetch" in a.dataset) return
let url: URL
try {
url = new URL(a.href)
} catch {
return
}
if (url.origin !== window.location.origin || !/^https?:$/.test(url.protocol)) return
if (url.pathname === window.location.pathname && url.search === window.location.search) return
// pages have no extension (or .html); a link to an image, PDF or file is not worth the bytes
const last = url.pathname.split("/").pop() ?? ""
if (/\.[A-Za-z0-9]+$/.test(last) && !/\.html?$/i.test(last)) return
return url
}
async function load(url: URL, priority: "low" | "high"): Promise<PrefetchedPage | undefined> {
try {
const res = await fetchCanonical(url, { priority } as RequestInit)
if (!res.ok) return undefined
const contentType = res.headers.get("content-type") ?? ""
if (!contentType.startsWith("text/html")) {
await res.body?.cancel()
return { url: res.url || url.toString(), contentType }
}
return { url: res.url || url.toString(), contentType, text: await res.text() }
} catch {
return undefined
}
}
function remember(url: URL, priority: "low" | "high" = "low"): Promise<PrefetchedPage | undefined> {
const key = keyOf(url)
const hit = cache.get(key)
if (hit && Date.now() - hit.time < MAX_AGE_MS) return hit.page
const page = load(url, priority)
cache.set(key, { time: Date.now(), page })
// a failed fetch is not kept, so following the link fetches it normally
page.then((p) => p === undefined && cache.get(key)?.page === page && cache.delete(key))
while (cache.size > MAX_PAGES) cache.delete(cache.keys().next().value!)
return page
}
const supportsSpeculationRules =
typeof HTMLScriptElement !== "undefined" &&
typeof HTMLScriptElement.supports === "function" &&
HTMLScriptElement.supports("speculationrules")
/** Without SPA routing: ask the browser to prefetch the page for the navigation. */
function hintBrowser(url: URL) {
const key = keyOf(url)
if (requested.has(key)) return
requested.add(key)
if (supportsSpeculationRules) {
const script = document.createElement("script")
script.type = "speculationrules"
script.textContent = JSON.stringify({ prefetch: [{ source: "list", urls: [key] }] })
document.head.appendChild(script)
} else {
const link = document.createElement("link")
link.rel = "prefetch"
link.href = key
link.setAttribute("as", "document")
document.head.appendChild(link)
}
}
function prefetch(url: URL) {
if (spa) void remember(url)
else hintBrowser(url)
}
window.quartzPrefetch = {
// The page from the cache, or fetched now and kept: whoever asks first (a popover on
// mouseenter, the prefetcher after its hover delay, the router on click) fetches it once.
load: (url: URL) => remember(url, "high"),
}
// --- intent: pointing at, focusing or touching a link -------------------------------------
let hoverTimer: ReturnType<typeof setTimeout> | undefined
const anchorOf = (target: EventTarget | null) =>
target instanceof Element ? target.closest("a") : null
document.addEventListener(
"pointerover",
(event) => {
const a = anchorOf(event.target)
const url = a && targetOf(a)
if (!url) return
clearTimeout(hoverTimer)
hoverTimer = setTimeout(() => prefetch(url), HOVER_DELAY_MS)
},
{ passive: true },
)
document.addEventListener(
"pointerout",
(event) => {
if (anchorOf(event.target)) clearTimeout(hoverTimer)
},
{ passive: true },
)
for (const type of ["pointerdown", "focusin"] as const) {
document.addEventListener(
type,
(event) => {
const a = anchorOf(event.target)
const url = a && targetOf(a)
if (url) prefetch(url)
},
{ passive: true },
)
}
// --- viewport: links on screen, while the browser is idle --------------------------------
const idle = (fn: () => void) =>
"requestIdleCallback" in window
? window.requestIdleCallback(fn, { timeout: 2000 })
: setTimeout(fn, 200)
let observer: IntersectionObserver | undefined
let queue: URL[] = []
let active = 0
let budget = VIEWPORT_BUDGET
function pump() {
while (active < CONCURRENCY && queue.length > 0 && budget > 0) {
const url = queue.shift()!
if (cache.has(keyOf(url)) || requested.has(keyOf(url))) continue
budget--
active++
idle(() => {
if (spa) {
remember(url).finally(() => {
active--
pump()
})
} else {
hintBrowser(url)
active--
pump()
}
})
}
}
// Links on screen are fetched only when they name a page the site has (the content index, plus
// the folder and tag pages it doesn't list): a link in a layout to a page that doesn't exist
// would otherwise log a 404 on every page view. Without a content index, any link counts.
let known: Set<string> | undefined
const knownReady: Promise<void> = (
typeof fetchData === "undefined" ? Promise.resolve({}) : fetchData
).then((index) => {
const slugs = Object.keys(index ?? {})
if (slugs.length > 0) known = new Set(slugs)
})
function isKnownPage(url: URL): boolean {
if (!known) return true
const root = window.quartzStaticUrl ? new URL("..", window.quartzStaticUrl).pathname : "/"
if (!url.pathname.startsWith(root)) return false
let slug: string
try {
slug = decodeURI(url.pathname.slice(root.length)).replace(/\.html?$/i, "")
} catch {
return false
}
if (slug === "" || slug.endsWith("/")) slug += "index"
return known.has(slug) || slug.endsWith("index") || slug.startsWith("tags/")
}
let observed = new WeakSet<Element>()
let queued = new Set<string>()
/** Watch the links on the page not watched yet (components may add theirs after `nav`). */
function scan() {
if (!observer) return
for (const a of document.querySelectorAll<HTMLAnchorElement>("a[href]")) {
if (observed.has(a)) continue
observed.add(a)
if (targetOf(a)) observer.observe(a)
}
}
function watchViewport() {
observer?.disconnect()
observer = undefined
queue = []
queued = new Set()
observed = new WeakSet()
budget = VIEWPORT_BUDGET
if (mode !== "viewport" || constrained() || !("IntersectionObserver" in window)) return
observer = new IntersectionObserver((entries) => {
for (const entry of entries) {
if (!entry.isIntersecting) continue
observer?.unobserve(entry.target)
const url = targetOf(entry.target as HTMLAnchorElement)
if (!url || !isKnownPage(url) || queued.has(keyOf(url))) continue
queued.add(keyOf(url))
queue.push(url)
}
pump()
})
// after the other `nav` handlers have rendered their links (explorer, backlinks, …)
idle(() => knownReady.then(scan))
}
// every page view (SPA navigations included) brings new links
document.addEventListener("nav", watchViewport)
document.addEventListener("render", () => idle(() => knownReady.then(scan)))
+29 -16
View File
@@ -72,22 +72,35 @@ async function _navigate(url: URL, isBack: boolean = false) {
// canonical link) changes the base its relative links resolve against, and the address bar
// should show it too. fetch() drops the #hash, so keep the requested one.
let finalUrl = url
const contents = await fetchCanonical(url)
.then((res) => {
if (res.url) {
finalUrl = new URL(res.url)
finalUrl.hash = url.hash
}
const contentType = res.headers.get("content-type")
if (contentType?.startsWith("text/html")) {
return res.text()
} else {
window.location.assign(url)
}
})
.catch(() => {
window.location.assign(url)
})
// A page fetched ahead (prefetch.inline.ts) is shown at once; one still loading is awaited.
const prefetched = await window.quartzPrefetch?.load(url)
if (prefetched && prefetched.text === undefined) {
// not a page (e.g. a file served without an extension): let the browser open it
window.location.assign(url)
return
}
if (prefetched) {
finalUrl = new URL(prefetched.url)
finalUrl.hash = url.hash
}
const contents = prefetched
? prefetched.text
: await fetchCanonical(url)
.then((res) => {
if (res.url) {
finalUrl = new URL(res.url)
finalUrl.hash = url.hash
}
const contentType = res.headers.get("content-type")
if (contentType?.startsWith("text/html")) {
return res.text()
} else {
window.location.assign(url)
}
})
.catch(() => {
window.location.assign(url)
})
if (!contents) return
+3 -3
View File
@@ -32,8 +32,8 @@ export function removeAllChildren(node: HTMLElement) {
// way less robust - we only care about our own generated redirects after all.
const canonicalRegex = /<link rel="canonical" href="([^"]*)">/
export async function fetchCanonical(url: URL): Promise<Response> {
const res = await fetch(`${url}`)
export async function fetchCanonical(url: URL, init?: RequestInit): Promise<Response> {
const res = await fetch(`${url}`, init)
if (!res.headers.get("content-type")?.startsWith("text/html")) {
return res
}
@@ -42,5 +42,5 @@ export async function fetchCanonical(url: URL): Promise<Response> {
// to allow the caller to read it if it's was not a redirect
const text = await res.clone().text()
const [_, redirect] = text.match(canonicalRegex) ?? []
return redirect ? fetch(`${new URL(redirect, url)}`) : res
return redirect ? fetch(`${new URL(redirect, url)}`, init) : res
}
+47 -1
View File
@@ -4,7 +4,7 @@ import { unified } from "unified"
import remarkParse from "remark-parse"
import remarkRehype from "remark-rehype"
import { VFile } from "vfile"
import { Element, Root } from "hast"
import { Element, Root, Text } from "hast"
import { visit } from "unist-util-visit"
import { BUILTINS, instantiateBuiltins, officialPluginName, planBuiltins, PlanInput } from "."
import {
@@ -361,6 +361,52 @@ describe("links built-in", () => {
assert.strictEqual(els[1].properties.src, "../../media/a.mp4")
})
// Obsidian 1.15.0 (remark-obsidian 2.2.1's triage, re-probed): a path that is not valid
// percent-encoding names no file, so the link is external; `x:y` has a scheme, `../x:y` doesn't
test("links Obsidian reads as external", () => {
const { els } = run([a("%zz"), a("a%E2.md"), a("x:y"), a("../x:y")], "sub/note", {}, ["xy"])
const classes = els.filter((e) => e.tagName === "a").map((e) => e.properties.className)
assert.deepStrictEqual(
classes.map((c) => (c as string[])[0]),
["external", "external", "external", "internal"],
)
})
test("an image of a missing file without alt text shows its decoded path", () => {
const img = (src: string, alt?: string): Element => ({
type: "element",
tagName: "img",
properties: alt === undefined ? { src } : { src, alt },
children: [],
})
const { els } = run(
[
img("missing%20pic.png"),
img("missing%20image.png", "alt"),
img("pic.png"),
img("/static/x.png"),
],
"page",
{ markdownLinkResolution: "absolute" },
["page", "pic.png"],
)
assert.deepStrictEqual(
els.map((e) => e.properties.alt),
["missing pic.png", "alt", undefined, undefined],
)
})
test("pretty links keep the last /-separated part of the link text, on every OS", () => {
const { els } = run([a("folder/note"), a("a\\b")], "page", { prettyLinks: true }, [
"folder/note",
"a\\b",
])
assert.deepStrictEqual(
els.filter((e) => e.tagName === "a").map((e) => (e.children[0] as Text).value),
["note", "a\\b"],
)
})
test("disableBrokenWikilinks adds a broken class to missing targets", () => {
const { els } = run([a("missing")], "page", { disableBrokenWikilinks: true }, ["page"])
assert.ok((els[0].properties.className as string[]).includes("broken"))
+20 -4
View File
@@ -8,6 +8,7 @@ import { LinksConfig } from "../../cfg"
import {
FullSlug,
RelativeURL,
linkPathDecodes,
SimpleSlug,
TransformOptions,
resolveRelative,
@@ -46,7 +47,9 @@ export const legacyCrawlLinksDefaults: Partial<LinksConfig> = {
}
const isAbsolute = isAbsoluteUrl as (url: string, options?: { httpOnly?: boolean }) => boolean
const isExternalUrl = (url: string) => isAbsolute(url, { httpOnly: false })
// As in Obsidian: a URL with a scheme (`x:y`, but not `../x:y`), or a link whose path is not valid
// percent-encoding (`%zz`, `a%E2.md`), which names no file
const isExternalUrl = (url: string) => isAbsolute(url, { httpOnly: false }) || !linkPathDecodes(url)
const EXTERNAL_ICON_PATH =
"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z"
@@ -163,7 +166,8 @@ export const Links: QuartzTransformerPlugin<LinksConfig> = (userOpts) => {
!textChild.value.startsWith("#") &&
!classes.includes("alias")
) {
textChild.value = path.basename(textChild.value)
// link text is not an OS path: path.posix, or Windows would also cut at a backslash
textChild.value = path.posix.basename(textChild.value)
}
}
}
@@ -175,8 +179,20 @@ export const Links: QuartzTransformerPlugin<LinksConfig> = (userOpts) => {
typeof node.properties.src === "string"
) {
if (opts.lazyLoad) node.properties.loading = "lazy"
if (!isExternalUrl(node.properties.src)) {
node.properties.src = resolveLink(node.properties.src as RelativeURL)
const src = node.properties.src
if (!isExternalUrl(src)) {
node.properties.src = resolveLink(src as RelativeURL)
// An embed of a file the site doesn't have: Obsidian shows its path, percent-decoded
// (`![](missing%20pic.png)` → “missing pic.png”). The image shows its alt text, so
// an image without one gets the path; an author's alt text is kept.
const target =
node.tagName === "img" && !node.properties.alt && !src.startsWith("#")
? canonicalSlug(node.properties.src as string, curSlug)
: undefined
// (quartz/static is served at static/ but holds no content files)
if (target && !target.startsWith("static/") && !ctx.allSlugs.includes(target)) {
node.properties.alt = decodeURI(splitAnchor(src)[0])
}
}
}
@@ -7,6 +7,8 @@ import { emitStaticAssets } from "./staticAssets"
import spaRouterScript from "../../components/scripts/spa.inline"
// @ts-ignore
import popoverScript from "../../components/scripts/popover.inline"
// @ts-ignore
import prefetchScript from "../../components/scripts/prefetch.inline"
import baseStyles from "../../styles/base.scss"
import customStyles from "../../styles/custom.scss"
import popoverStyle from "../../components/styles/popover.scss"
@@ -270,6 +272,18 @@ function addGlobalPageResources(ctx: BuildCtx, componentResources: ComponentReso
`)
}
// Prefetching (before the router or the no-SPA shim: both dispatch the first `nav`). Its
// settings lead the same script, since the other scripts load in parallel.
// (`prefetch: false` in YAML means off as well)
const prefetch = (cfg.prefetch as unknown) === false ? "off" : (cfg.prefetch ?? "viewport")
if (prefetch !== "off") {
componentResources.afterDOMLoaded.push(
`window.__quartzPrefetchMode = ${js(prefetch)};\n` +
`window.__quartzSpa = ${cfg.enableSPA ? "true" : "false"};\n` +
prefetchScript,
)
}
if (cfg.enableSPA) {
componentResources.afterDOMLoaded.push(spaRouterScript)
} else {
+20 -1
View File
@@ -3,7 +3,7 @@ import assert from "node:assert"
import fs from "fs"
import os from "os"
import path from "path"
import { parsePluginSource, readLockedCommit } from "./gitLoader"
import { isLocalSource, parsePluginSource, readLockedCommit } from "./gitLoader"
describe("parsePluginSource", () => {
test("owner/repo shorthand supports #ref", () => {
@@ -13,6 +13,25 @@ describe("parsePluginSource", () => {
assert.strictEqual(spec.ref, "dev")
})
test("local sources are recognised in POSIX and Windows spellings", () => {
for (const source of [
"./plugin",
"../plugin",
"/abs/plugin",
".\\plugin",
"..\\plugins\\x",
"C:\\sites\\plugin",
"D:/plugin",
{ repo: ".\\plugin" },
]) {
assert.ok(isLocalSource(source), JSON.stringify(source))
}
for (const source of ["github:a/b", "a/b", "https://github.com/a/b.git", "@scope/pkg"]) {
assert.ok(!isLocalSource(source), source)
}
assert.strictEqual(parsePluginSource(".\\plugin").local, true)
})
test("unknown sources get an explanatory error", () => {
assert.throws(() => parsePluginSource("explorer"), /Expected github:owner\/repo/)
})
+4
View File
@@ -111,6 +111,10 @@ export function isLocalSource(source: PluginSource): boolean {
if (source.startsWith("./") || source.startsWith("../") || source.startsWith("/")) {
return true
}
// Windows relative paths (.\plugin, ..\plugin)
if (source.startsWith(".\\") || source.startsWith("..\\")) {
return true
}
// Windows absolute paths (e.g. C:\ or D:/)
if (/^[A-Za-z]:[\\/]/.test(source)) {
return true
+232 -1
View File
@@ -5,15 +5,20 @@ import os from "os"
import path from "path"
import {
collectComponents,
folderTrie,
generateVirtualPages,
pageOutputPath,
processVirtualPageHtml,
referencesByTarget,
removeStalePageOutput,
resolveLayout,
} from "./dispatcher"
import { QuartzPageTypePluginInstance } from "../types"
import { QuartzComponent } from "../../components/types"
import { FilePath, FullSlug } from "../../util/path"
import { FilePath, FullSlug, SimpleSlug } from "../../util/path"
import { Root as HtmlRoot } from "hast"
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 +282,229 @@ 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)
})
})
describe("publish filters on pages that stand for files (bases-page#11)", () => {
const note = (slug: string, links: string[], frontmatter: Record<string, unknown> = {}) =>
defaultProcessedContent({
slug: slug as FullSlug,
relativePath: `${slug}.md` as FilePath,
links: links as SimpleSlug[],
frontmatter: { title: slug, ...frontmatter },
})
const page = (slug: string, data: Record<string, unknown> = {}) => ({
slug: slug as FullSlug,
title: slug,
data: { relativePath: slug as FilePath, ...data },
})
// publishes notes with `publish: true`, and files a published page links to
const explicitPublish = {
name: "ExplicitPublish",
shouldPublish: (_ctx: BuildCtx, [, vfile]: ReturnType<typeof note>) =>
vfile.data.frontmatter?.publish === true || (vfile.data.referencedBy?.length ?? 0) > 0,
}
const makeCtx = (plugins: Record<string, unknown[]> = {}) =>
({
cfg: { configuration: {}, plugins: { filters: [explicitPublish], ...plugins } },
argv: {},
virtualPages: [],
}) as unknown as BuildCtx
test("referencesByTarget lists the pages linking to each target", () => {
const refs = referencesByTarget([
note("a", ["board.canvas", "b"]),
note("b", ["board.canvas", "board.canvas"]),
])
assert.deepStrictEqual(refs.get("board.canvas" as SimpleSlug), ["a", "b"])
assert.deepStrictEqual(refs.get("b" as SimpleSlug), ["a"])
})
test("file-backed pages go through the filters, with referencedBy; listings do not", async () => {
const ctx = makeCtx()
const entries = await generateVirtualPages(
[
makePageType({
name: "canvas",
fileExtensions: [".canvas"],
generate: () => [page("linked.canvas"), page("secret.canvas")],
}),
makePageType({
name: "excalidraw",
fileExtensions: [".excalidraw.md"],
generate: () => [
page("drawing.excalidraw", { frontmatter: { title: "drawing", publish: true } }),
],
}),
makePageType({ name: "tags", generate: () => [page("tags/a")] }),
],
[note("index", ["linked.canvas"], { publish: true })],
ctx,
{ head: StubHead },
{},
)
assert.deepStrictEqual(
entries.map((e) => e.vpSlug),
["linked.canvas", "drawing.excalidraw", "tags/a"],
)
assert.deepStrictEqual(entries[0].vfile.data.referencedBy, ["index"])
assert.deepStrictEqual(entries[1].vfile.data.referencedBy, [])
assert.strictEqual(entries[2].vfile.data.referencedBy, undefined)
assert.deepStrictEqual(
ctx.virtualPages.map(([, vfile]) => vfile.data.slug),
["linked.canvas", "drawing.excalidraw", "tags/a"],
)
})
const rendered = (ctx: BuildCtx) => {
const [tree, vfile] = defaultProcessedContent({
slug: "board.canvas" as FullSlug,
relativePath: "board.canvas" as FilePath,
frontmatter: { title: "board", password: "pw" },
htmlAst: {
type: "root",
children: [{ type: "element", tagName: "p", properties: {}, children: [] }],
} as HtmlRoot,
})
const layout = resolveLayout(makePageType(), { head: StubHead }, {})
ctx.virtualPages.push([tree, vfile])
return {
ve: { tree, vfile, layout, vpSlug: "board.canvas" as FullSlug, fileBacked: true },
ctx,
}
}
test("virtualPageHtmlPlugins process the rendered body, which the page then shows", () => {
const seen: unknown[] = []
const { ve, ctx } = rendered(
makeCtx({
transformers: [
{
name: "Encrypt",
virtualPageHtmlPlugins: (_ctx: BuildCtx, content: unknown[]) => {
seen.push(content)
return [
() => (tree: HtmlRoot, file: { data: Record<string, unknown> }) => {
tree.children = [{ type: "text", value: "encrypted" }]
file.data.encrypted = true
},
]
},
},
],
}),
)
const Body = ve.layout.pageBody
assert.strictEqual(processVirtualPageHtml(ve, ctx, []), true)
assert.deepStrictEqual(seen, [[]])
assert.deepStrictEqual(ve.tree.children, [{ type: "text", value: "encrypted" }])
assert.strictEqual(ve.vfile.data.htmlAst, ve.tree)
assert.strictEqual((ve.vfile.data as Record<string, unknown>).encrypted, true)
assert.strictEqual(ctx.virtualPages[0][0], ve.tree)
assert.notStrictEqual(ve.layout.pageBody, Body)
})
test("a page whose processing leaves the tree alone keeps its body", () => {
const { ve, ctx } = rendered(
makeCtx({ transformers: [{ name: "Noop", virtualPageHtmlPlugins: () => [() => () => {}] }] }),
)
const Body = ve.layout.pageBody
assert.strictEqual(processVirtualPageHtml(ve, ctx, []), true)
assert.strictEqual(ve.layout.pageBody, Body)
assert.strictEqual(ve.tree.children.length, 0)
})
test("a page whose body failed to render is not published unprocessed", () => {
const { ve, ctx } = rendered(
makeCtx({ transformers: [{ name: "Encrypt", virtualPageHtmlPlugins: () => [] }] }),
)
ve.vfile.data.htmlAst = undefined
assert.strictEqual(processVirtualPageHtml(ve, ctx, []), false)
// without such plugins nothing changes
assert.strictEqual(processVirtualPageHtml(ve, makeCtx(), []), true)
})
})
+175 -9
View File
@@ -2,7 +2,15 @@ import { QuartzEmitterPlugin, QuartzPageTypePluginInstance, TreeTransform } from
import { QuartzComponent, QuartzComponentProps } from "../../components/types"
import { pageResources, renderPage } from "../../components/renderPage"
import { FullPageLayout } from "../../cfg"
import { FilePath, FullSlug, joinSegments, pathToRoot, slugifyFilePath } from "../../util/path"
import {
FilePath,
FullSlug,
SimpleSlug,
joinSegments,
pathToRoot,
simplifySlug,
slugifyFilePath,
} from "../../util/path"
import { ProcessedContent, defaultProcessedContent } from "../vfile"
import { write } from "../emitters/helpers"
import { BuildCtx, trieFromAllFiles } from "../../util/ctx"
@@ -10,6 +18,12 @@ import { StaticResources } from "../../util/resources"
import { render } from "preact-render-to-string"
import { fromHtml } from "hast-util-from-html"
import { Root as HtmlRoot } from "hast"
import { toHtml } from "hast-util-to-html"
import { unified } from "unified"
import { htmlToJsx } from "../../util/jsx"
import { trace } from "../../util/trace"
import { attributeError, originOf } from "../../util/pluginErrors"
import { rejectingFilter } from "../../processors/filter"
import fs from "fs"
import path from "path"
@@ -143,6 +157,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
}
/**
@@ -150,6 +169,10 @@ export type VirtualEntry = {
* content. `generate` may be async (Quartz 5.1+), e.g. to run the transformer chain or
* esbuild; page types run one after another in priority order, as before. Virtual pages
* (except the 404 page) are added to `ctx.virtualPages`.
*
* Pages of page types that render files (`fileExtensions`: `.base`, `.canvas`, …) go through the
* site's filters first, with `file.data.referencedBy` set; a page a filter rejects is dropped, so
* it is neither emitted nor listed (content index, folder pages, explorer, search) nor embeddable.
*/
export async function generateVirtualPages(
pageTypes: QuartzPageTypePluginInstance[],
@@ -160,10 +183,12 @@ export async function generateVirtualPages(
): Promise<VirtualEntry[]> {
const cfg = ctx.cfg.configuration
const virtualEntries: VirtualEntry[] = []
let references: Map<SimpleSlug, FullSlug[]> | undefined
for (const pt of pageTypes) {
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
@@ -173,27 +198,130 @@ export async function generateVirtualPages(
frontmatter: { title: vp.title, tags: [] },
...vp.data,
})
if (fileBacked) {
// A page that stands for a file is published on the same terms as a note: the site's
// filters decide, seeing the frontmatter the page type gives it (an `.excalidraw.md`
// drawing's own) and which published pages link to it (bases-page#11).
references ??= referencesByTarget(content)
vfile.data.referencedBy = references.get(simplifySlug(vpSlug)) ?? []
if (rejectingFilter(ctx, [tree, vfile]) !== undefined) continue
}
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.
*
* For each link target, the published pages that link to or embed it (`file.data.links`), in
* content order.
*/
export function referencesByTarget(content: ProcessedContent[]): Map<SimpleSlug, FullSlug[]> {
const references = new Map<SimpleSlug, FullSlug[]>()
for (const [, file] of content) {
const slug = file.data.slug
if (!slug) continue
for (const target of new Set(file.data.links ?? [])) {
const from = references.get(target)
if (from) from.push(slug)
else references.set(target, [slug])
}
}
return references
}
/**
* @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])
}
/** Renders a page's (already rendered and processed) tree as its body. */
const RenderedBody: QuartzComponent = ({ fileData, tree }: QuartzComponentProps) =>
htmlToJsx((fileData.filePath ?? fileData.relativePath ?? fileData.slug) as FilePath, tree)
/**
* @internal Exported for testing only.
*
* Run the transformers' `virtualPageHtmlPlugins` on the rendered body (`file.data.htmlAst`) of a
* page that stands for a file — e.g. encrypted-pages encrypting a canvas. When they change the
* tree, the page shows the changed tree instead of rendering its body again. A page whose body
* failed to render, or that a plugin throws on, is left unpublished: emitting it unprocessed could
* publish what the plugin protects.
*/
export function processVirtualPageHtml(
ve: VirtualEntry,
ctx: BuildCtx,
content: ProcessedContent[],
): boolean {
if (!ve.fileBacked) return true
const transformers = (ctx.cfg.plugins?.transformers ?? []).filter((t) => t.virtualPageHtmlPlugins)
if (transformers.length === 0) return true
// its body failed to render: there is nothing to process, and it can't be emitted processed
const htmlAst = ve.vfile.data.htmlAst
if (!htmlAst) return false
const before = toHtml(htmlAst, { allowDangerousHtml: true })
for (const transformer of transformers) {
try {
const processor = unified().use(transformer.virtualPageHtmlPlugins!(ctx, content))
ve.vfile.data.htmlAst = processor.runSync(ve.vfile.data.htmlAst!, ve.vfile) as HtmlRoot
} catch (err) {
const file = ve.vfile.data.relativePath ?? ve.vpSlug
trace(
`Failed to process the HTML of \`${file}\``,
attributeError(err, { origin: originOf(transformer), stage: "html", file }) as Error,
)
return false
}
}
const processed = ve.vfile.data.htmlAst!
if (toHtml(processed, { allowDangerousHtml: true }) !== before) {
ve.tree = processed
ve.layout = { ...ve.layout, pageBody: RenderedBody }
// emitters that run later (content index, assets, …) read the page from ctx.virtualPages
const item = ctx.virtualPages.find(([, vfile]) => vfile === ve.vfile)
if (item) item[0] = processed
}
return true
}
/**
* 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
* transclusion (e.g. ![[file.canvas]]) can inline the virtual page's content.
* populating vfile.data.htmlAst so that transclusion (e.g. ![[file.canvas]]) can inline the
* virtual page's content, then run `virtualPageHtmlPlugins` on it (pages that stand for files).
* Returns the entries to emit: those whose processing failed are removed from `ctx.virtualPages`.
*/
function populateVirtualPageHtmlAst(
virtualEntries: VirtualEntry[],
ctx: BuildCtx,
allFiles: ProcessedContent[1]["data"][],
resources: StaticResources,
) {
content: ProcessedContent[],
): VirtualEntry[] {
const cfg = ctx.cfg.configuration
const failed = new Set<VirtualEntry>()
for (const ve of virtualEntries) {
const BodyComponent = ve.layout.pageBody
const externalResources = pageResources(pathToRoot(ve.vpSlug), resources, ctx)
@@ -214,7 +342,16 @@ function populateVirtualPageHtmlAst(
// Body rendering failed — leave htmlAst empty so transclusion falls
// back to the default title-only display.
}
// processed right after rendering, so later bodies that embed this page see the result
if (!processVirtualPageHtml(ve, ctx, content)) {
failed.add(ve)
ve.vfile.data.htmlAst = undefined
}
}
if (failed.size === 0) return virtualEntries
const failedData = new Set([...failed].map((ve) => ve.vfile.data))
ctx.virtualPages = ctx.virtualPages.filter(([, vfile]) => !failedData.has(vfile.data))
return virtualEntries.filter((ve) => !failed.has(ve))
}
export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>> = (userOpts) => {
@@ -250,6 +387,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).
@@ -258,7 +399,13 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
const allFilesWithVirtual = [...allFiles, ...virtualEntries.map((ve) => ve.vfile.data)]
// Render Body components to populate htmlAst for transclusion
populateVirtualPageHtmlAst(virtualEntries, ctx, allFilesWithVirtual, resources)
const entriesToEmit = populateVirtualPageHtmlAst(
virtualEntries,
ctx,
allFilesWithVirtual,
resources,
content,
)
// Phase 2: Emit regular pages (with virtual page data available for transclusion)
for (const [tree, file] of content) {
@@ -283,7 +430,7 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
}
// Phase 3: Emit virtual pages
for (const ve of virtualEntries) {
for (const ve of entriesToEmit) {
yield emitPage(
ctx,
ve.vpSlug,
@@ -334,10 +481,18 @@ 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
populateVirtualPageHtmlAst(virtualEntries, ctx, allFilesWithVirtual, resources)
const entriesToEmit = populateVirtualPageHtmlAst(
virtualEntries,
ctx,
allFilesWithVirtual,
resources,
content,
)
// Phase 2: Emit changed regular pages
for (const [tree, file] of content) {
@@ -364,7 +519,7 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
}
// Phase 3: Emit virtual pages
for (const ve of virtualEntries) {
for (const ve of entriesToEmit) {
yield emitPage(
ctx,
ve.vpSlug,
@@ -379,3 +534,14 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
},
}
}
declare module "vfile" {
interface DataMap {
/**
* On a page that stands for a file (`.base`, `.canvas`, …): the published pages that link to
* or embed it. Set before the site's filters see the page, e.g. so explicit-publish can publish
* a file that has no frontmatter when a published note links to it.
*/
referencedBy: FullSlug[]
}
}
@@ -31,6 +31,12 @@
"type": "boolean",
"description": "Enable hover popovers for links"
},
"prefetch": {
"type": "string",
"enum": ["viewport", "hover", "off"],
"default": "viewport",
"description": "Fetch pages before their links are followed: links on screen and pointed at (viewport), only links pointed at (hover), or never (off)"
},
"locale": {
"type": "string",
"description": "Locale code for the site"
+8
View File
@@ -61,6 +61,14 @@ export type QuartzTransformerPluginInstance = PluginHooks & {
textTransform?: (ctx: BuildCtx, src: string) => string
markdownPlugins?: (ctx: BuildCtx) => PluggableList
htmlPlugins?: (ctx: BuildCtx) => PluggableList
/**
* rehype plugins for the pages that page types render from files (`.base`, `.canvas`, …).
* Those pages are rendered at emit time and never pass through `htmlPlugins`; these plugins
* run on each one's rendered body (with the page's vfile, so `file.data.frontmatter` and
* `file.data.referencedBy` are available) after the site's filters published it, and the page
* shows the resulting tree. `content` is the published content. Quartz 5.1+.
*/
virtualPageHtmlPlugins?: (ctx: BuildCtx, content: ProcessedContent[]) => PluggableList
externalResources?: ExternalResourcesFn
}
+36 -12
View File
@@ -1,27 +1,51 @@
import { BuildCtx } from "../util/ctx"
import { PerfTimer } from "../util/perf"
import { ProcessedContent } from "../plugins/vfile"
import { QuartzFilterPluginInstance } from "../plugins/types"
import { attributeError, originOf } from "../util/pluginErrors"
import { recordFiltered } from "../util/diagnostics"
import { trace } from "../util/trace"
/** Whether `plugin` publishes `item`; a filter that throws reports the error and rejects it. */
function publishes(
ctx: BuildCtx,
plugin: QuartzFilterPluginInstance,
item: ProcessedContent,
): boolean {
try {
return plugin.shouldPublish(ctx, item)
} catch (err) {
const file = item[1].data.relativePath ?? item[1].data.slug
trace(
`Failed to filter \`${file}\``,
attributeError(err, { origin: originOf(plugin), stage: "filter", file }) as Error,
)
return false
}
}
/**
* Run the site's filters on one page (e.g. a virtual page that stands for a `.base` or `.canvas`
* file). Returns the name of the first filter that rejects it, or `undefined` when it is
* published. A rejection is recorded like one from `filterContent`.
*/
export function rejectingFilter(ctx: BuildCtx, item: ProcessedContent): string | undefined {
for (const plugin of ctx.cfg.plugins?.filters ?? []) {
if (publishes(ctx, plugin, item)) continue
const slug = item[1].data.slug
if (slug) recordFiltered(slug, plugin.name)
if (ctx.argv?.verbose) console.log(`[filter:${plugin.name}] ${slug}`)
return plugin.name
}
return undefined
}
export function filterContent(ctx: BuildCtx, content: ProcessedContent[]): ProcessedContent[] {
const { cfg, argv } = ctx
const perf = new PerfTimer()
const initialLength = content.length
for (const plugin of cfg.plugins.filters) {
const updatedContent = content.filter((item) => {
try {
return plugin.shouldPublish(ctx, item)
} catch (err) {
const file = item[1].data.relativePath ?? item[1].data.slug
trace(
`Failed to filter \`${file}\``,
attributeError(err, { origin: originOf(plugin), stage: "filter", file }) as Error,
)
return false
}
})
const updatedContent = content.filter((item) => publishes(ctx, plugin, item))
for (const item of content) {
if (!updatedContent.includes(item) && item[1].data.slug) {
recordFiltered(item[1].data.slug, plugin.name)
+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
+1
View File
@@ -20,6 +20,7 @@ export {
splitAnchor,
slugTag,
transformInternalLink,
linkPathDecodes,
transformLink,
normalizeHastElement,
} from "@quartz-community/utils"
+13 -1
View File
@@ -1,5 +1,6 @@
import { styleText } from "util"
import process from "process"
import esbuild from "esbuild"
import { isMainThread } from "workerpool"
import { isContentError, pluginErrorInfo, PluginErrorInfo } from "./pluginErrors"
import { knownProblemsFor } from "./diagnostics"
@@ -130,6 +131,17 @@ export function trace(msg: string, err: Error) {
} else {
// print and exit
console.error(traceMsg)
process.exit(1)
exitBuild(1)
}
}
/**
* Exit the build process. esbuild's service is a child process that shares our stderr; exiting
* while it has requests in flight (bundling component scripts, the CLI's build context) left it
* running without its parent, and it printed "fatal error: all goroutines are asleep - deadlock!"
* and a goroutine dump after Quartz's error. Stop it first.
*/
export function exitBuild(code: number): never {
void esbuild.stop()
process.exit(code)
}