saberzero1 c32d11cb8b fix(build): remove extension-stripped slug aliases that pollute allSlugs
addVirtualPageSlugAliases injected extension-stripped aliases for
every PageType-registered extension into ctx.allSlugs (e.g. for
`Canvas.canvas` it added an alias `canvas`). Intended to help
`![[file.canvas]]` transclusions resolve to virtual pages, but:

1. CrawlLinks' shortest strategy treats allSlugs entries as real
   files. When an author writes `[[Canvas]]` in a note, shortest
   lookup matches BOTH the alias `canvas` and real basenames
   like `features/canvas`. With matchingFileNames.length === 2,
   the uniqueness check fails and transformLink falls back to
   absolute resolution, producing a dead href `./canvas` that
   points to no emitted file.

2. The aliases were never actually needed for transclusion.
   renderPage.tsx already has its own extension-stripping
   fallback (lines 107-119) that consults allFiles directly.
   Virtual pages (canvas-page, bases-page) emit at slugs that
   KEEP their extension (e.g. `canvas.canvas`), so
   `![[Canvas.canvas]]` resolves naturally without any alias.

3. The aliases mispresent Obsidian semantics. In Obsidian,
   `[[Canvas]]` resolves to `Canvas.md`; non-md files require
   the explicit extension (`[[Canvas.canvas]]`). Injecting
   extension-stripped aliases into allSlugs made Quartz claim
   bare names can refer to non-md virtual pages, which is
   wrong.

Reproduction: docs/features/index.md contains `[[Canvas]]` which
should resolve to docs/features/Canvas.md (slug features/canvas).
Under the old behavior it produced href="../canvas" with
data-slug="canvas" pointing nowhere. After this fix it produces
href="../features/canvas" with data-slug="features/canvas"
correctly.

Verified with fresh `npx quartz build -d docs`:
- [[Canvas]] → ./features/canvas ✓
- ![[Canvas.canvas]] transclusion still works ✓
- ![[Base.base]] virtual page still emits ✓
- 0 internal broken links across all output ✓
- all 91 existing tests pass
2026-04-17 03:05:36 +02:00
2026-03-14 18:19:40 +01:00
2023-12-11 15:34:21 -08:00
2023-08-02 20:59:56 -07:00
2026-03-14 18:10:02 +01:00
2025-05-28 16:20:59 -07:00
2023-08-20 08:57:56 -07:00
2023-08-07 23:57:24 -07:00
2023-07-22 17:27:41 -07:00
2026-03-14 18:10:02 +01:00
2026-03-14 18:10:02 +01:00
2021-07-18 09:35:42 -04:00
2026-04-17 03:00:00 +02:00
2026-03-14 18:10:02 +01:00
2026-03-14 18:10:02 +01:00

Quartz v5

“[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” — Richard Hamming

Quartz is a set of tools that helps you publish your digital garden and notes as a website for free.

🔗 Read the documentation and get started: https://quartz.jzhao.xyz/

Join the Discord Community

Sponsors

Description
No description provided
Readme 38 MiB
Languages
SCSS 47.1%
TypeScript 25.2%
CSS 19.9%
JavaScript 7.8%