Compare commits

...
Author SHA1 Message Date
saberzero1 09a6b0336a feat(content-index): dateFromFrontmatter marks dates set in frontmatter 2026-11-26 17:06:08 +01:00
saberzero1 d5dad620d8 feat(content-index): write the page date to contentIndex.json (quartz-community/explorer#5) 2026-11-26 15:54:27 +01:00
Emile Bangma 773e2c7fe1 Merge pull request #2697 from jackyzha0/deps/plugins-a11y
chore(deps): accessibility and page-speed plugin releases for 5.3.0
2026-11-26 14:40:08 +01:00
saberzero1 96fc9c1bfb chore(deps): accessibility and page-speed plugin releases for 5.3.0 2026-11-26 13:02:56 +01:00
Emile Bangma 7ef986a16b Merge pull request #2696 from jackyzha0/a11y/page-list-h2
fix(a11y): PageList entries are h2 at the h3 size
2026-11-26 12:53:30 +01:00
Emile Bangma a5b07e3c48 Merge pull request #2695 from jackyzha0/a11y/template-contrast
fix(a11y): template colours meet WCAG AA contrast in light and dark mode
2026-11-26 12:53:05 +01:00
Emile Bangma c97a377b84 Merge pull request #2694 from jackyzha0/a11y/main-landmark
fix(a11y): page frames use <main> and <aside> landmarks
2026-11-26 12:52:40 +01:00
saberzero1 52af9f1a29 fix(a11y): PageList entries are h2 at the h3 size 2026-11-26 03:44:28 +01:00
saberzero1 093d233d2c fix(a11y): template colours meet WCAG AA contrast in light and dark mode 2026-11-26 03:40:04 +01:00
saberzero1 a55f25f185 fix(a11y): page frames use <main> and <aside> landmarks 2026-11-26 03:37:00 +01:00
Emile Bangma 050586dc14 Merge pull request #2692 from jackyzha0/fix/spa-scroll-restoration
fix(spa): the router restores scroll positions on Back and Forward
2026-11-26 03:33:13 +01:00
Emile Bangma 0cfcfc868b Merge pull request #2691 from jackyzha0/perf/single-component-css
perf(css): one stylesheet for all component styles
2026-11-26 03:32:48 +01:00
Emile Bangma 2f2c35d64c Merge pull request #2690 from jackyzha0/seo/head-meta
feat(head): canonical link and Open Graph fixes; font preconnect
2026-11-26 03:32:23 +01:00
Emile Bangma fb6464ef68 Merge pull request #2689 from jackyzha0/fix/frontmatter-angle-links
fix(frontmatter): Markdown links with an angle-bracket destination resolve
2026-11-26 03:31:58 +01:00
Emile Bangma dc10654108 Merge pull request #2693 from jackyzha0/deps/graph-1.0.5
chore(deps): @quartz-community/graph 1.0.5
2026-11-26 03:31:33 +01:00
saberzero1 c33b6cfc48 chore(deps): @quartz-community/graph 1.0.5 2026-11-26 03:30:08 +01:00
saberzero1 3ab4503fe0 fix(spa): the router restores scroll positions on Back and Forward (#2674) 2026-11-26 03:10:05 +01:00
saberzero1 799b8e370f perf(css): one stylesheet for all component styles 2026-11-26 03:00:51 +01:00
saberzero1 9d6cdba8e4 feat(head): canonical link, og:url without index, og:site_name property, article og:type; fix font preconnect 2026-11-26 02:59:24 +01:00
30 changed files with 413 additions and 129 deletions

No files matched your search

@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": minor
---
`contentIndex.json` entries have `dateFromFrontmatter: true` when their `date` is the one set in the page's frontmatter for the configured date type (not from git or the file system), so client-side components can tell explicit dates apart, e.g. for folder dates in the explorer.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": minor
---
`contentIndex.json` entries now include the page's `date` (the one `defaultDateType` selects) as an ISO 8601 string, so client-side components such as the explorer can sort by date. Pages without a date have no `date` field.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
@quartz-community/graph 1.0.5: the graph scales to large sites. On 3,000 notes and 33,000 links, the global graph opens in 0.5 s instead of 2.5 s, and it stops using the CPU once its layout settles. It also loads d3 and PixiJS as pinned, integrity-checked versions, with PixiJS's minified build (200 KB instead of 2.5 MB on every page).
+7
View File
@@ -0,0 +1,7 @@
---
"@jackyzha0/quartz": patch
---
Pages get a canonical link (`<link rel="canonical">`, the page's URL as the sitemap lists it), and `og:url` uses the same URL: `folder/` instead of `folder/index`, and the site root for the home page. `og:site_name` is a `property` (it was a `name`, which Open Graph readers ignore). Notes are `og:type: article`, with `article:modified_time` and, when the frontmatter has a date, `article:published_time`. The home page and folder and tag pages stay `website`.
The `fonts.gstatic.com` preconnect is a CORS connection, which the font files can reuse, and the unused `cdnjs.cloudflare.com` preconnect is gone.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
The page frames mark their regions for assistive technology: the centre column is a `<main>` (it was a `div.center`; the classes are unchanged) and the default frame's sidebars are `<aside>` elements. Screen readers can jump to the page's content, and the page looks the same.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
`PageList` entries are `h2` headings under the page's `h1` (they were `h3`, which skipped a level for screen readers), at the `h3`'s size, as in `@quartz-community/folder-page` and `@quartz-community/tag-page`.
+12
View File
@@ -0,0 +1,12 @@
---
"@jackyzha0/quartz": patch
---
Plugin updates for accessibility and page speed:
- Text in the table of contents, footer, folder and tag listings, search button and Bases group headings meets WCAG AA contrast in light and dark mode. Under an Obsidian theme from quartz-themes (`@quartz-themes/core` 3.2.1), the search button and Bases group headings keep the theme's faint text colour.
- Page listings in folder and tag pages use `<h2>` titles (at the previous size), so headings no longer skip a level.
- Valid ARIA and unique ids in the table of contents, explorer, backlinks, heading anchors and Bases views.
- The graph loads d3 and PixiJS only when it scrolls into view (or when the global graph opens), instead of on every page.
- KaTeX's stylesheet no longer blocks rendering on pages without math.
- `@quartz-community/remark-obsidian` 2.2.3: the `legacy` parser no longer uses memory that grows with the square of the note's length on notes with many tables, lists or other blocks.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
Component styles are one stylesheet (`component-<hash>.css`, in the `quartz-base` layer as before) instead of one per component. Pages load about 20 fewer render-blocking stylesheets (29 to 11 on the docs site), and the styles they compute are unchanged.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
With SPA navigation, Back and Forward return to where the reader was on each page. The router keeps each history entry's scroll position and restores it after swapping the page in. The browser restored the position while the previous page was still on screen, so it came out wrong: Back after a table-of-contents link stayed at the heading, and Back to a page landed at its top or bottom. Back and Forward between headings of the same page now only scroll, instead of reloading the page, and a reload keeps the position.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
The templates' colours meet WCAG AA contrast (4.5:1) on their backgrounds. Light `gray` goes from #b8b8b8 to #727272 (was 1.9:1), dark `gray` from #646464 to #7f7f7f (was 3.1:1), and light `tertiary`, the link hover colour, from #84a59d to #587971 (was 2.5:1). Text selection mixes 40% of `tertiary` instead of 60%, so text stays readable on it in both modes. Existing sites keep the colours in their own `quartz.config.yaml`.
+4
View File
@@ -36,6 +36,10 @@ Options:
> [!note]
> An existing `@quartz-community/content-index` entry is applied to `configuration.contentIndex` automatically. Run `npx quartz plugin doctor --fix` to move it.
## `contentIndex.json`
Each entry of `static/contentIndex.json` is keyed by slug and holds `slug`, `filePath`, `title`, `links`, `tags` and `content` (the page's text), plus `date` when the page has one: the date selected by `defaultDateType` of [[CreatedModifiedDate]] (the same date [[ContentMeta]] shows and the RSS feed uses), as an ISO 8601 string such as `"2024-01-02T03:04:05.000Z"`. Client-side components can use it to sort by date, e.g. `new Date(entry.date)`. When that date is the one the page's frontmatter sets for the configured date type (e.g. `modified:` / `lastmod:` with `defaultDateType: modified`), rather than one from git or the file system, the entry also has `dateFromFrontmatter: true`; otherwise the field is absent.
## Adding fields
Plugins can add their own fields to each entry of `contentIndex.json` with `extendContentIndex` — see [[making plugins#Extending the content index]].
+77 -51
View File
@@ -15,8 +15,8 @@
"@napi-rs/simple-git": "1.2.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.3.0",
"@quartz-community/backlinks": "^1.0.4",
"@quartz-community/bases-page": "^1.5.2",
"@quartz-community/breadcrumbs": "^1.0.3",
"@quartz-community/canvas-page": "^1.0.4",
"@quartz-community/citations": "^1.0.1",
@@ -29,14 +29,14 @@
"@quartz-community/description": "^1.0.2",
"@quartz-community/encrypted-pages": "^1.2.0",
"@quartz-community/explicit-publish": "^1.2.0",
"@quartz-community/explorer": "^1.1.2",
"@quartz-community/explorer": "^1.1.3",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.1.0",
"@quartz-community/footer": "^1.1.1",
"@quartz-community/github-flavored-markdown": "^2.1.1",
"@quartz-community/graph": "^1.0.4",
"@quartz-community/folder-page": "^1.1.1",
"@quartz-community/footer": "^1.1.2",
"@quartz-community/github-flavored-markdown": "^2.1.2",
"@quartz-community/graph": "^1.0.6",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.1.0",
"@quartz-community/latex": "^1.1.1",
"@quartz-community/note-properties": "^1.2.0",
"@quartz-community/obsidian-flavored-markdown": "^2.4.0",
"@quartz-community/og-image": "^1.1.2",
@@ -45,15 +45,15 @@
"@quartz-community/reader-mode": "^1.0.2",
"@quartz-community/recent-notes": "^1.0.3",
"@quartz-community/roam": "^1.1.0",
"@quartz-community/search": "^1.1.0",
"@quartz-community/search": "^1.1.1",
"@quartz-community/spacer": "^1.0.2",
"@quartz-community/stacked-pages": "^1.0.3",
"@quartz-community/syntax-highlighting": "^1.0.4",
"@quartz-community/table-of-contents": "^1.0.4",
"@quartz-community/table-of-contents": "^1.0.5",
"@quartz-community/tag-list": "^1.0.3",
"@quartz-community/tag-page": "^1.0.5",
"@quartz-community/tag-page": "^1.0.6",
"@quartz-community/unlisted-pages": "^1.2.0",
"@quartz-themes/core": "^3.2.0",
"@quartz-themes/core": "^3.2.1",
"ansi-truncate": "^1.4.0",
"async-mutex": "^0.5.0",
"chokidar": "^6.0.0",
@@ -2308,9 +2308,9 @@
}
},
"node_modules/@quartz-community/backlinks": {
"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==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@quartz-community/backlinks/-/backlinks-1.0.4.tgz",
"integrity": "sha512-gNBitsKzUslvJ+6xVgLnAnVQvPC7n34xxm4I+mkbcvFYkswMxMuky/LZYzzy3XypENEYuS2W+P+4mmSkeeRlCg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2330,9 +2330,9 @@
}
},
"node_modules/@quartz-community/bases-page": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@quartz-community/bases-page/-/bases-page-1.5.1.tgz",
"integrity": "sha512-rdZZlrUM8Lj15mQf0EB8oYfFmwVH4N4Br68bI3tZLyfwwErfpJbRtc7sGHxxH+e9H+15dS8N0g+INcyNWRp9ag==",
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/@quartz-community/bases-page/-/bases-page-1.5.2.tgz",
"integrity": "sha512-wOPNaLAmDHSuVd8Jm424I8hMR7F1zHAvpy6VfKDOJOyfwzSLJF2BCvChUWlSl7E7IUZoAwPeIPKe7Ky9O2LnDw==",
"license": "MIT",
"dependencies": {
"@lucide/icons": "^1.70.0",
@@ -2621,9 +2621,9 @@
}
},
"node_modules/@quartz-community/explorer": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@quartz-community/explorer/-/explorer-1.1.2.tgz",
"integrity": "sha512-phkuIYI2WZS7Q9oCJV1zCsxgfR/N1OfrsoN0PTuXjxIKm7oEijY7NmyOtJrQ4FOuT0k91YLIh96pPDwC/2+eAw==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@quartz-community/explorer/-/explorer-1.1.3.tgz",
"integrity": "sha512-5+aQJ/vDNaN5bL6NZq2q/GegDvP4kAw1tL4dxHZ+mkEYJbCRcQ19UzCBhFOw96KVnIl4v4Cq2xdV9gKvRi9/Cg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2664,9 +2664,9 @@
}
},
"node_modules/@quartz-community/folder-page": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.1.0.tgz",
"integrity": "sha512-Pwd0yIIhE3A+PGiSzQ7jpBFA7LrPxSPYNQBV1KSMrEor875rcOgloOCeesZtRDs+UppjQWovJkoUwIVFljQ/qg==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.1.1.tgz",
"integrity": "sha512-3JxOPfe7q6m/Vyx+ZLVpiON4/qOlqBte9SOj1MRAKJK59kM9p0k/vu+rSv5k87U5wBIirA2mDzZenQfug8dUeQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2690,9 +2690,9 @@
}
},
"node_modules/@quartz-community/footer": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/footer/-/footer-1.1.1.tgz",
"integrity": "sha512-D1xMkN5kTHmTBH5mcJs1pjxo6wl2HDU/kE8F3kPbCciydAGq1APBnt59v8P+K0Cd8jVeTTtbXfYdZ463xEgKaQ==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@quartz-community/footer/-/footer-1.1.2.tgz",
"integrity": "sha512-HlRO03cYTJQmlfcXx1TnxauUnclQjO+nMdi+cNqlO681MnIEQEKFaqTQO2qSTIbeHPSvhbn90y/xTlCefCTgHA==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2712,9 +2712,9 @@
}
},
"node_modules/@quartz-community/github-flavored-markdown": {
"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==",
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/@quartz-community/github-flavored-markdown/-/github-flavored-markdown-2.1.2.tgz",
"integrity": "sha512-RK4E0gSpxA5qpPXaWTw0McMX34Rd348MH5jlgZz920qXqWhoSqWZ4a2cGjG93hPdWFPJoXLSDNP3CxO28QYo8g==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2734,9 +2734,9 @@
}
},
"node_modules/@quartz-community/graph": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.4.tgz",
"integrity": "sha512-h0tijZqaxhmq3R8c7BtFV8RE3Mvoki8RjHQgYk/owyyzVJKSuHoyB5qXp889hk0rbpeiWajP32unEaumfPxuMQ==",
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.6.tgz",
"integrity": "sha512-cZ7ymjZ0tyLA32ms92WVpUhcV4kGEYw5vivV4YaTwYFuu6YxuIn7YqlyUlqEAwcy6HvMgbLJZVX9O6vKpANn+A==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2777,9 +2777,9 @@
}
},
"node_modules/@quartz-community/latex": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/latex/-/latex-1.1.0.tgz",
"integrity": "sha512-ZaQsn3X1yuxoJX4k6NnydAXKQYmbayVyT9lGSIrERadVyJubrjV75mPmNqgu/3MPNtGq7+2y2wBAqnZb2H5+6A==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/latex/-/latex-1.1.1.tgz",
"integrity": "sha512-OzfgfgUCe7EQi5rxLMAaO8KINUf5TBLo19eE/0KZiPR0OYUgYTkPpqdzNhY2r++dqV7CvAN0lNG+V0TULncG4g==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0"
@@ -2979,10 +2979,17 @@
}
},
"node_modules/@quartz-community/remark-obsidian": {
"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==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@quartz-community/remark-obsidian/-/remark-obsidian-2.2.3.tgz",
"integrity": "sha512-+EOhBhczcQF4tRDhiOaomsASYm+3lTC1hOf7K3KwZ6MEabvnlQIyGS47Ej2ulkV3C5eDkJ2eow3QqYg6o/BqAQ==",
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
"@types/unist": "^3.0.0",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-math": "^3.0.0",
"micromark-util-types": "^2.0.0"
},
"engines": {
"node": ">=22"
},
@@ -3012,9 +3019,9 @@
}
},
"node_modules/@quartz-community/search": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.1.0.tgz",
"integrity": "sha512-MuuzjfA3YznGHwSSk+QyyEp8jah9QMCbVS18gHB2O7hcVT0zFaNKq1cB4P0mVB7eVD4RlWejqg6+Hjv75oDcQA==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.1.1.tgz",
"integrity": "sha512-e+U6Vby15h2pbXuh8qXE1uGIeQIbE1QvqHEdOIm/Gp9E4HDdNZE2Ih/ifotmEVxGe3Q5XuQ1yQLa1mjwJ4zmcg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -3106,9 +3113,9 @@
}
},
"node_modules/@quartz-community/table-of-contents": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@quartz-community/table-of-contents/-/table-of-contents-1.0.4.tgz",
"integrity": "sha512-MszQgD7ErtklQJLzujPgblr4iV047oTN6XieGfrUBwgeIYwTzErqNJwRgJ9ebdRouT7czHQ4XmNNzL1rYSrelg==",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@quartz-community/table-of-contents/-/table-of-contents-1.0.5.tgz",
"integrity": "sha512-sz7SqYgn+bCAp6evvPSXLNGmC93XZZB+Dt7TUZEHN6Kgnct0QCo32NFsjm7B3Bah0JuMyJ/oCrX47zvO6q99wg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -3150,9 +3157,9 @@
}
},
"node_modules/@quartz-community/tag-page": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.5.tgz",
"integrity": "sha512-HfRkwQs+iAIb2FKd6+ZgaHwIfdEk+LAZ8mwreD9iB8xUhmmRVjvjxKPUl8stDSI9gSD1Gaa0Pxgwh/sU0/rYgQ==",
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.6.tgz",
"integrity": "sha512-tgs7i/og667hBuHJbcE4xLGEgIpi7pAaoVrrQMFLmXBApeqsBPP5Btn90KspBfFlw/GKV4IKnxJaf4ILROyMlQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -3239,9 +3246,9 @@
}
},
"node_modules/@quartz-themes/core": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@quartz-themes/core/-/core-3.2.0.tgz",
"integrity": "sha512-osluJykwyQ7HIvFcWB6LCzSvXXOcUXPFgus6lWRB79qYMhAc/N1b8ndacoIJulBF6Uwh3T/FyjDwLotBqVHZgg==",
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/@quartz-themes/core/-/core-3.2.1.tgz",
"integrity": "sha512-UJgWP3CxJt9E6POsIltYLD6lcOv60GMUV94FAFf+igu6+cquG1IEKjfKqYR6M1fhgeZhGn2XM1MqHgj8DwCXrA==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0"
@@ -5516,6 +5523,25 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-math": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-3.0.0.tgz",
"integrity": "sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==",
"license": "MIT",
"dependencies": {
"@types/hast": "^3.0.0",
"@types/mdast": "^4.0.0",
"devlop": "^1.0.0",
"longest-streak": "^3.0.0",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-to-markdown": "^2.1.0",
"unist-util-remove-position": "^5.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-mdx-expression": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz",
+12 -12
View File
@@ -45,8 +45,8 @@
"@napi-rs/simple-git": "1.2.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.3.0",
"@quartz-community/backlinks": "^1.0.4",
"@quartz-community/bases-page": "^1.5.2",
"@quartz-community/breadcrumbs": "^1.0.3",
"@quartz-community/canvas-page": "^1.0.4",
"@quartz-community/citations": "^1.0.1",
@@ -59,14 +59,14 @@
"@quartz-community/description": "^1.0.2",
"@quartz-community/encrypted-pages": "^1.2.0",
"@quartz-community/explicit-publish": "^1.2.0",
"@quartz-community/explorer": "^1.1.2",
"@quartz-community/explorer": "^1.1.3",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.1.0",
"@quartz-community/footer": "^1.1.1",
"@quartz-community/github-flavored-markdown": "^2.1.1",
"@quartz-community/graph": "^1.0.4",
"@quartz-community/folder-page": "^1.1.1",
"@quartz-community/footer": "^1.1.2",
"@quartz-community/github-flavored-markdown": "^2.1.2",
"@quartz-community/graph": "^1.0.6",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.1.0",
"@quartz-community/latex": "^1.1.1",
"@quartz-community/note-properties": "^1.2.0",
"@quartz-community/obsidian-flavored-markdown": "^2.4.0",
"@quartz-community/og-image": "^1.1.2",
@@ -75,15 +75,15 @@
"@quartz-community/reader-mode": "^1.0.2",
"@quartz-community/recent-notes": "^1.0.3",
"@quartz-community/roam": "^1.1.0",
"@quartz-community/search": "^1.1.0",
"@quartz-community/search": "^1.1.1",
"@quartz-community/spacer": "^1.0.2",
"@quartz-community/stacked-pages": "^1.0.3",
"@quartz-community/syntax-highlighting": "^1.0.4",
"@quartz-community/table-of-contents": "^1.0.4",
"@quartz-community/table-of-contents": "^1.0.5",
"@quartz-community/tag-list": "^1.0.3",
"@quartz-community/tag-page": "^1.0.5",
"@quartz-community/tag-page": "^1.0.6",
"@quartz-community/unlisted-pages": "^1.2.0",
"@quartz-themes/core": "^3.2.0",
"@quartz-themes/core": "^3.2.1",
"ansi-truncate": "^1.4.0",
"async-mutex": "^0.5.0",
"chokidar": "^6.0.0",
+3 -3
View File
@@ -24,17 +24,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -25,17 +25,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -25,17 +25,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -26,17 +26,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -25,17 +25,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -25,17 +25,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+28 -10
View File
@@ -1,5 +1,5 @@
import { i18n } from "../i18n"
import { FullSlug, getFileExtension, joinSegments, pathToRoot } from "../util/path"
import { FullSlug, getFileExtension, joinSegments, pathToRoot, simplifySlug } from "../util/path"
import { CSSResourceToStyleElement, JSResourceToScriptElement } from "../util/resources"
import { googleFontHref, googleFontSubsetHref } from "../util/theme"
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
@@ -27,9 +27,24 @@ export default (() => {
const baseDir = fileData.slug === "404" ? path : pathToRoot(fileData.slug!)
const iconPath = joinSegments(baseDir, "static/icon.png")
// Url of current page
const socialUrl =
fileData.slug === "404" ? url.toString() : joinSegments(url.toString(), fileData.slug!)
// The page's public URL, as the sitemap lists it: `folder/` for `folder/index`,
// no `index` for the home page, encoded.
const isNotFound = fileData.slug === "404"
const pageUrl = isNotFound
? url.toString()
: joinSegments(url.toString(), encodeURI(simplifySlug(fileData.slug!)))
// Notes (not the home page, folder or tag pages) are articles.
const isArticle =
!isNotFound &&
fileData.relativePath !== undefined &&
!fileData.slug!.endsWith("index") &&
!fileData.slug!.startsWith("tags/")
const isoDate = (d: unknown) =>
d instanceof Date && !isNaN(d.getTime()) ? d.toISOString() : undefined
// Without a frontmatter date, the published date is only the build time.
const published =
isArticle && fileData.frontmatter?.published ? isoDate(fileData.dates?.published) : undefined
const modified = isArticle ? isoDate(fileData.dates?.modified) : undefined
const usesCustomOgImage = ctx.cfg.plugins.emitters.some((e) => e.name === "CustomOgImages")
const ogImageDefaultPath = `https://${cfg.baseUrl}/static/og-image.png`
@@ -50,19 +65,21 @@ export default (() => {
{cfg.theme.cdnCaching && cfg.theme.fontOrigin === "googleFonts" && (
<>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
{/* Font files are fetched with CORS, so only a CORS connection is reused. */}
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
<link rel="stylesheet" href={googleFontHref(cfg.theme)} />
{cfg.theme.typography.title && (
<link rel="stylesheet" href={googleFontSubsetHref(cfg.theme, cfg.pageTitle)} />
)}
</>
)}
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossOrigin="anonymous" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="og:site_name" content={cfg.pageTitle}></meta>
<meta property="og:site_name" content={cfg.pageTitle} />
<meta property="og:title" content={title} />
<meta property="og:type" content="website" />
<meta property="og:type" content={isArticle ? "article" : "website"} />
{published && <meta property="article:published_time" content={published} />}
{modified && <meta property="article:modified_time" content={modified} />}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
@@ -84,8 +101,9 @@ export default (() => {
{cfg.baseUrl && (
<>
<meta property="twitter:domain" content={cfg.baseUrl}></meta>
<meta property="og:url" content={socialUrl}></meta>
<meta property="twitter:url" content={socialUrl}></meta>
<meta property="og:url" content={pageUrl}></meta>
<meta property="twitter:url" content={pageUrl}></meta>
{!isNotFound && <link rel="canonical" href={pageUrl} />}
</>
)}
+5 -3
View File
@@ -74,14 +74,14 @@ export const PageList: QuartzComponent = ({ cfg, fileData, allFiles, limit, sort
<div class="section">
<p class="meta">{page.dates && <Date date={getDate(page)!} locale={cfg.locale} />}</p>
<div class="desc">
<h3>
<h2>
<a
href={resolveRelative(fileData.slug!, page.slug!)}
class="internal internal-link"
>
{title}
</a>
</h3>
</h2>
</div>
<ul class="tags">
{tags.map((tag) => (
@@ -104,8 +104,10 @@ export const PageList: QuartzComponent = ({ cfg, fileData, allFiles, limit, sort
}
PageList.css = `
.section h3 {
/* An h2 under the page's h1 (it was an h3, which skipped a level), at the h3's size. */
.section h2 {
margin: 0;
font-size: 1.12rem;
}
.section > .tags {
+6 -6
View File
@@ -24,12 +24,12 @@ export const DefaultFrame: PageFrame = {
}: PageFrameProps) {
return (
<>
<div class="left sidebar" data-sidebar-mode={sidebars?.left ?? "fit"}>
<aside class="left sidebar" data-sidebar-mode={sidebars?.left ?? "fit"}>
{left.map((BodyComponent) => (
<BodyComponent {...componentData} />
))}
</div>
<div class="center">
</aside>
<main class="center">
<div class="page-header">
<Header {...componentData}>
{header.map((HeaderComponent) => (
@@ -49,12 +49,12 @@ export const DefaultFrame: PageFrame = {
<BodyComponent {...componentData} />
))}
</div>
</div>
<div class="right sidebar" data-sidebar-mode={sidebars?.right ?? "fit"}>
</main>
<aside class="right sidebar" data-sidebar-mode={sidebars?.right ?? "fit"}>
{right.map((BodyComponent) => (
<BodyComponent {...componentData} />
))}
</div>
</aside>
{footer.map((FooterComponent) => (
<FooterComponent {...componentData} />
))}
+2 -2
View File
@@ -23,7 +23,7 @@ export const FullWidthFrame: PageFrame = {
}: PageFrameProps) {
return (
<>
<div class="center full-width">
<main class="center full-width">
<div class="page-header">
<Header {...componentData}>
{header.map((HeaderComponent) => (
@@ -43,7 +43,7 @@ export const FullWidthFrame: PageFrame = {
<BodyComponent {...componentData} />
))}
</div>
</div>
</main>
{footer.map((FooterComponent) => (
<FooterComponent {...componentData} />
))}
+2 -2
View File
@@ -13,9 +13,9 @@ export const MinimalFrame: PageFrame = {
render({ componentData, pageBody: Content, footer }: PageFrameProps) {
return (
<>
<div class="center minimal">
<main class="center minimal">
<Content {...componentData} />
</div>
</main>
{footer.map((FooterComponent) => (
<FooterComponent {...componentData} />
))}
+73 -12
View File
@@ -62,6 +62,37 @@ function stopLoading() {
}
}
// Scroll positions are restored by the router, not the browser (#2674). The browser
// saves an entry's position when `pushState` runs and restores it on Back while the
// *other* page's content is still shown, before the router swaps the page in, so
// positions came out wrong. Each entry keeps its own `scrollY` in `history.state`.
history.scrollRestoration = "manual"
let renderedPath = window.location.pathname
let saveTimer: ReturnType<typeof setTimeout> | undefined
function saveScroll() {
clearTimeout(saveTimer)
history.replaceState({ ...(history.state ?? {}), scrollY: window.scrollY }, "")
}
function savedScroll(): number | undefined {
const y = (history.state as { scrollY?: unknown } | null)?.scrollY
return typeof y === "number" ? y : undefined
}
/** Scrolls to where the current entry was left, else to its `#heading`, else to the top. */
function restoreScroll() {
const y = savedScroll()
if (y !== undefined) {
window.scrollTo({ top: y, behavior: "instant" })
return
}
const hash = window.location.hash
const el = hash ? document.getElementById(decodeURIComponent(hash.substring(1))) : null
if (el) el.scrollIntoView({ behavior: "instant" })
else window.scrollTo({ top: 0, behavior: "instant" })
}
let isNavigating = false
let p: DOMParser
async function _navigate(url: URL, isBack: boolean = false) {
@@ -104,6 +135,10 @@ async function _navigate(url: URL, isBack: boolean = false) {
if (!contents) return
// Keep the position of the page being left, for Back. (On Back, the entry has
// already changed: what's on screen belongs to another entry.)
if (!isBack) saveScroll()
// notify about to nav
const event: CustomEventMap["prenav"] = new CustomEvent("prenav", { detail: {} })
document.dispatchEvent(event)
@@ -132,13 +167,13 @@ async function _navigate(url: URL, isBack: boolean = false) {
micromorph(document.body, html.body)
// scroll into place and add history
if (!isBack) {
if (url.hash) {
const el = document.getElementById(decodeURIComponent(url.hash.substring(1)))
el?.scrollIntoView()
} else {
window.scrollTo({ top: 0 })
}
if (isBack) {
restoreScroll()
} else if (url.hash) {
const el = document.getElementById(decodeURIComponent(url.hash.substring(1)))
el?.scrollIntoView()
} else {
window.scrollTo({ top: 0 })
}
// now, patch head, re-executing scripts
@@ -152,6 +187,7 @@ async function _navigate(url: URL, isBack: boolean = false) {
if (!isBack) {
history.pushState({}, "", finalUrl)
}
renderedPath = window.location.pathname
notifyNav(getFullSlug(window))
delete announcer.dataset.persist
@@ -182,21 +218,46 @@ function createRouter() {
event.preventDefault()
if (isSamePage(url) && url.hash) {
// Save where the reader was, then add the entry, then jump: Back returns here.
saveScroll()
history.pushState({}, "", url)
const el = document.getElementById(decodeURIComponent(url.hash.substring(1)))
el?.scrollIntoView()
history.pushState({}, "", url)
return
}
navigate(url, false)
})
window.addEventListener("popstate", (event) => {
const { url } = getOpts(event) ?? {}
if (window.location.hash && window.location.pathname === url?.pathname) return
window.addEventListener("popstate", () => {
// Whatever is pending belongs to the entry just left.
clearTimeout(saveTimer)
// Back or Forward between headings of the page on screen: only scroll.
if (window.location.pathname === renderedPath) {
restoreScroll()
return
}
navigate(new URL(window.location.toString()), true)
return
})
// Record the position as the reader scrolls, so that Forward (and Back to an
// entry left without a link) also lands where the reader was.
window.addEventListener(
"scroll",
() => {
if (isNavigating) return
clearTimeout(saveTimer)
saveTimer = setTimeout(() => {
if (!isNavigating) saveScroll()
}, 150)
},
{ passive: true },
)
// A reload or a return from another site: the browser no longer restores it.
window.addEventListener("pagehide", () => {
if (!isNavigating) saveScroll()
})
if (savedScroll() !== undefined) restoreScroll()
}
return new (class Router {
+51
View File
@@ -554,6 +554,57 @@ describe("content index built-in", () => {
])
})
test("writes the page date to contentIndex.json as an ISO string (explorer#5)", () => {
const created = new Date("2024-01-02T03:04:05.000Z")
const modified = new Date("2025-06-07T08:09:10.000Z")
const dated = page("dated", { defaultDateType: "created", dates: { created, modified } })
const idx = buildContentIndex(ctxWith([]), [dated, page("undated")])
const json = JSON.parse(serializeContentIndex(idx))
assert.strictEqual(json.dated.date, "2024-01-02T03:04:05.000Z")
assert.ok(!("description" in json.dated))
// pages without a date keep the build-time stand-in for RSS, but not in the JSON
assert.ok(idx.get("undated" as FullSlug)!.date instanceof Date)
assert.ok(!("date" in json.undated))
})
test("dateFromFrontmatter marks dates set in frontmatter for the configured type", () => {
const fmModified = new Date("2024-03-04T00:00:00") // local midnight, like the date plugin
const gitModified = new Date("2025-01-01T10:00:00.000Z")
const created = new Date("2020-01-01T00:00:00.000Z")
const fromFm = page("fm", {
defaultDateType: "modified",
frontmatter: { title: "FM", modified: "2024-03-04" },
dates: { created, modified: fmModified },
})
const fromGit = page("git", {
defaultDateType: "modified",
frontmatter: { title: "GIT", created: "2020-01-01T00:00:00.000Z" },
dates: { created, modified: gitModified },
})
// frontmatter has a date, but for another type than the configured one
const otherType = page("other", {
defaultDateType: "created",
frontmatter: { title: "O", modified: "2024-03-04" },
dates: { created: gitModified, modified: fmModified },
})
// frontmatter value lost to a higher-priority source (date differs)
const overridden = page("over", {
defaultDateType: "modified",
frontmatter: { title: "OV", modified: "2023-01-01" },
dates: { created, modified: gitModified },
})
const json = JSON.parse(
serializeContentIndex(
buildContentIndex(ctxWith([]), [fromFm, fromGit, otherType, overridden, page("undated")]),
),
)
assert.strictEqual(json.fm.dateFromFrontmatter, true)
assert.strictEqual(json.fm.date, fmModified.toISOString())
for (const slug of ["git", "other", "over", "undated"]) {
assert.ok(!("dateFromFrontmatter" in json[slug]), slug)
}
})
test("plugins add fields through extendContentIndex", () => {
const ctx = ctxWith([
{
+63 -6
View File
@@ -53,6 +53,7 @@ export const CORE_CONTENT_INDEX_FIELDS = new Set([
"content",
"richContent",
"date",
"dateFromFrontmatter",
"description",
])
@@ -150,6 +151,50 @@ export function prepareContentIndex(ctx: BuildCtx, content: ProcessedContent[]):
return index
}
/**
* Pages without a date get the build time, so RSS and the sitemap keep working as before.
* Those stand-in dates are remembered here and not written to contentIndex.json, where a
* build-time date would look like a real one to client-side sorting (explorer, recent notes).
*/
const buildTimeDates = new WeakSet<Date>()
function buildTimeDate(): Date {
const date = new Date()
buildTimeDates.add(date)
return date
}
function entryDate(data: QuartzPluginData): Date {
const date = getDate(data as Parameters<typeof getDate>[0])
if (!date) return buildTimeDate()
if (dateIsFromFrontmatter(data, date)) frontmatterDates.add(date)
return date
}
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/
/**
* Whether the page's `date` is the one its frontmatter sets for the configured date type
* (`defaultDateType`: created / modified / published, after the frontmatter built-in's
* aliases such as `date` or `lastmod`), rather than one from git or the file system. Compared
* by value, so it holds whatever `priority` the date plugin uses. Date-only values
* (`2024-01-02`) are local midnight, as the date plugin reads them.
*/
export function dateIsFromFrontmatter(data: QuartzPluginData, date: Date | undefined): boolean {
if (!(date instanceof Date) || isNaN(date.getTime())) return false
const type = data.defaultDateType as string | undefined
const frontmatter = data.frontmatter as Record<string, unknown> | undefined
if (!type || !frontmatter) return false
let raw = frontmatter[type]
if (raw === undefined || raw === null || raw === "") return false
if (typeof raw === "string" && DATE_ONLY.test(raw)) raw = `${raw}T00:00:00`
if (!(raw instanceof Date) && typeof raw !== "string" && typeof raw !== "number") return false
const fromFrontmatter = new Date(raw)
return !isNaN(fromFrontmatter.getTime()) && fromFrontmatter.getTime() === date.getTime()
}
/** Pages whose date came from frontmatter (see dateIsFromFrontmatter). */
const frontmatterDates = new WeakSet<Date>()
/** Build the index from processed content (also used by tests and potentially other emitters). */
export function buildContentIndex(
ctx: BuildCtx,
@@ -176,7 +221,7 @@ export function buildContentIndex(
options.rssFullHtml && data.encrypted !== true
? escapeHTML(toHtml(tree as Root, { allowDangerousHtml: true }))
: undefined,
date: getDate(data as Parameters<typeof getDate>[0]) ?? new Date(),
date: entryDate(data),
description: (data.description as string | undefined) ?? "",
}
index.set(slug, applyContentIndexExtensions(ctx, extensions, entry, data))
@@ -240,13 +285,25 @@ function generateRSSFeed(cfg: GlobalConfiguration, idx: ContentIndexMap, limit?:
</rss>`
}
/** Entries as written to contentIndex.json (date and description are RSS/sitemap-only). */
/**
* Entries as written to contentIndex.json. `date` is the page's date (the one
* `defaultDateType` selects, as shown by ContentMeta and used by RSS) as an ISO 8601 string,
* left out for pages without a date. `dateFromFrontmatter: true` is added when that date is the
* one the page's frontmatter sets for the date type (absent otherwise). `description` is
* RSS-only.
*/
export function serializeContentIndex(idx: ContentIndexMap): string {
const simplified = Object.fromEntries(
Array.from(idx).map(([slug, { date: _date, description: _description, ...rest }]) => [
slug,
rest,
]),
Array.from(idx).map(([slug, { date, description: _description, ...rest }]) => {
const hasDate = date instanceof Date && !isNaN(date.getTime()) && !buildTimeDates.has(date)
if (!hasDate) return [slug, rest]
return [
slug,
frontmatterDates.has(date)
? { ...rest, date: date.toISOString(), dateFromFrontmatter: true }
: { ...rest, date: date.toISOString() },
]
}),
)
return JSON.stringify(simplified)
}
@@ -430,11 +430,13 @@ export const ComponentResources: QuartzEmitterPlugin = () => {
include: Features.MediaQueries,
}).code.toString()
// All component styles go into one stylesheet, in their order, in one
// `quartz-base` layer: a file per component meant ~20 render-blocking
// requests per page, many for a few hundred bytes.
const cssStringToFilename = new Map<string, string>()
for (const cssString of componentResources.componentCssStrings) {
if (cssStringToFilename.has(cssString)) continue
const wrapped = `@layer quartz-base {\n${cssString}\n}`
const componentCss = [...componentResources.componentCssStrings]
if (componentCss.length > 0) {
const wrapped = `@layer quartz-base {\n${componentCss.join("\n")}\n}`
const minified = transform({
filename: "component.css",
code: Buffer.from(wrapped),
@@ -446,7 +448,7 @@ export const ComponentResources: QuartzEmitterPlugin = () => {
const hash = hashContent(minified)
const slug = `component-${hash}`
const filename = `${slug}.css`
cssStringToFilename.set(cssString, filename)
for (const cssString of componentCss) cssStringToFilename.set(cssString, filename)
yield write({
ctx,
+4 -1
View File
@@ -31,7 +31,10 @@ export type ContentDetails = {
tags: string[]
content: string
richContent?: string
/** RSS / sitemap only — not written to contentIndex.json. */
/**
* The page's date (see `defaultDateType`). Written to contentIndex.json as an ISO 8601
* string, and only for pages that have a date.
*/
date?: Date
/** RSS / sitemap only — not written to contentIndex.json. */
description?: string
+2 -1
View File
@@ -51,7 +51,8 @@ body {
border-radius: 5px;
}
::selection {
background: color-mix(in srgb, var(--tertiary) 60%, rgba(255, 255, 255, 0));
// 40%: text stays readable on it (4.5:1 for --darkgray in both default palettes).
background: color-mix(in srgb, var(--tertiary) 40%, rgba(255, 255, 255, 0));
color: var(--darkgray);
}