mirror of
https://github.com/jackyzha0/quartz
synced 2026-11-30 22:44:41 +01:00
Compare commits
245
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eab5c532c7 | ||
|
|
6b7bc28912 | ||
|
|
e4ebd28c0d | ||
|
|
b7998bbd2d | ||
|
|
edfa7f1f1b | ||
|
|
c24663f1ab | ||
|
|
5f503715ab | ||
|
|
6c6aaaa322 | ||
|
|
158a9b5c0f | ||
|
|
08c2857aa6 | ||
|
|
0778a9a157 | ||
|
|
1f19843db2 | ||
|
|
15b8eeffbf | ||
|
|
5b6de1fe4c | ||
|
|
3e4a50a5ed | ||
|
|
5507de3365 | ||
|
|
31bcb34ca7 | ||
|
|
671ca4921e | ||
|
|
0a475bd328 | ||
|
|
3103485049 | ||
|
|
63ea0b7190 | ||
|
|
ab4426337a | ||
|
|
a78706f710 | ||
|
|
3eaf219196 | ||
|
|
1b4644157b | ||
|
|
e44f2b0364 | ||
|
|
76de2838a1 | ||
|
|
981c64af98 | ||
|
|
4920dae17e | ||
|
|
7ffd3a818a | ||
|
|
774f76335a | ||
|
|
571dde2d86 | ||
|
|
fb96a9d8cd | ||
|
|
114ffc4a86 | ||
|
|
73a06a0ba8 | ||
|
|
3111df2366 | ||
|
|
96f62ec88c | ||
|
|
5c581299a9 | ||
|
|
8f4a816944 | ||
|
|
b6bcd4f6cc | ||
|
|
295e822cf9 | ||
|
|
9fa4fa7bf0 | ||
|
|
7cf595d20a | ||
|
|
096350cf0e | ||
|
|
6e87fda4a5 | ||
|
|
8eae6a1277 | ||
|
|
3c18be8c71 | ||
|
|
67ae68e9a4 | ||
|
|
c84f348039 | ||
|
|
6e9f5c45d8 | ||
|
|
d66968cd7c | ||
|
|
50203da448 | ||
|
|
ea75b1bdc8 | ||
|
|
1cc1439e20 | ||
|
|
f768b1eb7c | ||
|
|
18deab128c | ||
|
|
13a3d1865c | ||
|
|
052ebb23d5 | ||
|
|
3b8095bdf7 | ||
|
|
e49024cca5 | ||
|
|
d2c95da653 | ||
|
|
340672580e | ||
|
|
d89a8c76ea | ||
|
|
e1ab1269f8 | ||
|
|
e31990aaea | ||
|
|
f3e02aff39 | ||
|
|
9eebd805d7 | ||
|
|
7e449b8974 | ||
|
|
09097db511 | ||
|
|
461646361b | ||
|
|
fbabc76d4a | ||
|
|
4ef1814ec1 | ||
|
|
97a2d05f80 | ||
|
|
5e78078ff7 | ||
|
|
b080c219b9 | ||
|
|
3dff48b5df | ||
|
|
5519ffe5d9 | ||
|
|
afe7e68ff0 | ||
|
|
4bfe60a28a | ||
|
|
9be7f42b42 | ||
|
|
f8b1a4d7aa | ||
|
|
233a975a32 | ||
|
|
f1fba3fc55 | ||
|
|
2176a4ae03 | ||
|
|
75f485bd2f | ||
|
|
4ef8d6cbc7 | ||
|
|
50227ba2c3 | ||
|
|
254af5dcff | ||
|
|
762f7634b4 | ||
|
|
f5fa2343a4 | ||
|
|
1930712042 | ||
|
|
041de1c692 | ||
|
|
631f6b45b5 | ||
|
|
075afd3f71 | ||
|
|
990884386a | ||
|
|
74b3fc9efd | ||
|
|
7076a897e1 | ||
|
|
507ad7f3d4 | ||
|
|
41864a0eba | ||
|
|
508f73a33f | ||
|
|
6f27207fbf | ||
|
|
89fb2afe6f | ||
|
|
a121fd2e96 | ||
|
|
e37b4888f3 | ||
|
|
e22d4446b4 | ||
|
|
c2e1a619f0 | ||
|
|
754058ad54 | ||
|
|
2a5e3ae574 | ||
|
|
94fcabb0b4 | ||
|
|
26a5a86d77 | ||
|
|
326bc49b96 | ||
|
|
3c8726834a | ||
|
|
a791a4f12d | ||
|
|
581f6707da | ||
|
|
555b2ba838 | ||
|
|
3d99dca87d | ||
|
|
966307e0d0 | ||
|
|
ebdbb3da21 | ||
|
|
49785911c9 | ||
|
|
e8ccb7991c | ||
|
|
11b9960663 | ||
|
|
4b7ecb96f0 | ||
|
|
a71cbfbeed | ||
|
|
b6939da24d | ||
|
|
6fdeaef8c2 | ||
|
|
eefff261a6 | ||
|
|
7ed01ddd43 | ||
|
|
fe1f1d30aa | ||
|
|
57094a8fee | ||
|
|
97eea3ee34 | ||
|
|
ab8e77392c | ||
|
|
f45b9d42bd | ||
|
|
af583c167a | ||
|
|
de21613607 | ||
|
|
69571de66e | ||
|
|
5b34917e98 | ||
|
|
e56ffae883 | ||
|
|
b4cb37d8bf | ||
|
|
ca70ffd03b | ||
|
|
9cf87ff1c2 | ||
|
|
e54b89f889 | ||
|
|
e12ca11100 | ||
|
|
92a4a48430 | ||
|
|
9e74db69a9 | ||
|
|
25d89ff94a | ||
|
|
decbd0a969 | ||
|
|
87083faeb6 | ||
|
|
58593c7c72 | ||
|
|
8a79f59abb | ||
|
|
2000295346 | ||
|
|
c5bbc92b74 | ||
|
|
b2f1dad514 | ||
|
|
81db804f54 | ||
|
|
9737bce709 | ||
|
|
951dfee599 | ||
|
|
afe98e6b1a | ||
|
|
f15aa0032a | ||
|
|
9e4d4518bd | ||
|
|
3138a88bb1 | ||
|
|
db5aca2b8d | ||
|
|
dd1b36c148 | ||
|
|
4579e49465 | ||
|
|
882d3b3f50 | ||
|
|
667d487a0f | ||
|
|
36b3542371 | ||
|
|
b24f2a5e7b | ||
|
|
ad685b8d4e | ||
|
|
2862ec7303 | ||
|
|
9ac5d6e7e6 | ||
|
|
399cdd83d2 | ||
|
|
336b3ea131 | ||
|
|
24975c6975 | ||
|
|
4a06ee6b44 | ||
|
|
cbe101dc12 | ||
|
|
29dea35776 | ||
|
|
257f004bbf | ||
|
|
51ba21804d | ||
|
|
2dc58a33df | ||
|
|
22fc3b5cef | ||
|
|
d6414218de | ||
|
|
c837425148 | ||
|
|
cf28741977 | ||
|
|
cce45e0718 | ||
|
|
38395a1bac | ||
|
|
228218ece8 | ||
|
|
27639d5ab5 | ||
|
|
97472ebf88 | ||
|
|
9f7caa96f4 | ||
|
|
ee683e0e86 | ||
|
|
ed0f27c05f | ||
|
|
d45b7a7bf6 | ||
|
|
c4b0145e59 | ||
|
|
629efafafe | ||
|
|
eb53936ec7 | ||
|
|
2455c87167 | ||
|
|
455985f7ef | ||
|
|
601f23f132 | ||
|
|
6b3c72d11e | ||
|
|
0d9b356046 | ||
|
|
7f00400ad2 | ||
|
|
caa55037f7 | ||
|
|
17aa8ab233 | ||
|
|
bdc3347c75 | ||
|
|
dfde22acfd | ||
|
|
b1e5d3a7cc | ||
|
|
4d715774e1 | ||
|
|
097f3040fb | ||
|
|
0593c8cd6a | ||
|
|
5b6588189f | ||
|
|
c206aa3c02 | ||
|
|
2a02240802 | ||
|
|
cfcd9c18ac | ||
|
|
cfba672f51 | ||
|
|
2e34c64c63 | ||
|
|
70c2aa0f53 | ||
|
|
afb84b1ffe | ||
|
|
05b79e1d60 | ||
|
|
f681e871ea | ||
|
|
bc1c6a47d8 | ||
|
|
c6d7da00b2 | ||
|
|
0c008d49c2 | ||
|
|
7c7e8789ca | ||
|
|
4a9000cd16 | ||
|
|
307f3b9298 | ||
|
|
d88e97c769 | ||
|
|
7fd0590a46 | ||
|
|
0c63884f65 | ||
|
|
47e0ba3a58 | ||
|
|
0e314cb1eb | ||
|
|
635d2af12e | ||
|
|
21ea5895cb | ||
|
|
9031614318 | ||
|
|
cb83ed320f | ||
|
|
3da68acd02 | ||
|
|
38eca77b5e | ||
|
|
17efeb93f3 | ||
|
|
c8f6e6dc14 | ||
|
|
f3a549a68d | ||
|
|
a76af2866b | ||
|
|
9fcc3f260c | ||
|
|
886bf6d7f6 | ||
|
|
24f2a7325a | ||
|
|
4914242ef9 | ||
|
|
907cef735b | ||
|
|
efd9e8e095 |
No files matched your search
@@ -0,0 +1,13 @@
|
||||
# Changesets
|
||||
|
||||
Quartz is versioned with [changesets](https://github.com/changesets/changesets). Every pull request that changes how Quartz behaves should include a changeset:
|
||||
|
||||
```shell
|
||||
npx changeset
|
||||
```
|
||||
|
||||
Pick the bump (`patch` for fixes, `minor` for new features and new plugin APIs, `major` for breaking changes) and describe the change for users — the text ends up in `CHANGELOG.md` and the GitHub release notes.
|
||||
|
||||
On every push to `v5`, the release workflow opens (or updates) a "chore: release Quartz" pull request that bumps the version in `package.json` and writes `CHANGELOG.md`. Merging it tags the commit `vX.Y.Z` and publishes a GitHub release. Quartz is not published to npm.
|
||||
|
||||
See `docs/advanced/versioning.md` for what the version means for users and plugin authors.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
A page type's `generate` can be async: it may return a promise of its virtual pages, which Quartz awaits in full and incremental builds. Page types that create pages from other files (like `.mdx`) can now run content through the site's transformers or bundle with esbuild; previously a promise crashed the build with "virtualPages is not iterable" (#2575).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Clearer failures: errors thrown by a plugin now name the plugin (package, version, source), what it was doing (transforming, filtering, emitting, rendering a component) and the file or page, list problems Quartz already knew about that plugin (incompatible Quartz version, missing required data), and say how to check and where to report it. Plugin stack frames are no longer hidden. Warnings from loading the config are repeated in a summary at the end of the build, together with a note about links to pages that are not on the site (including links to drafts).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Frontmatter parsing, link resolution, draft handling and the content index are now built into Quartz (configured under `configuration.frontmatter`, `.links`, `.drafts` and `.contentIndex`) instead of being plugins that silently broke the site when disabled. Existing `crawl-links`, `remove-draft` and `content-index` entries keep working and are applied automatically; `npx quartz plugin doctor --fix` moves them into `configuration`. Plugins can add fields to `contentIndex.json` with an `extendContentIndex` hook, and emitters can reuse the built index via `ctx.contentIndex`. The effective built-in settings are available to plugins as `ctx.cfg.configuration.<key>`.
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "restricted",
|
||||
"baseBranch": "v5",
|
||||
"updateInternalDependencies": "patch",
|
||||
"privatePackages": {
|
||||
"version": true,
|
||||
"tag": true
|
||||
},
|
||||
"ignore": []
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
French: "Vue graphique" and "Table des matières" use French capitalisation (jackyzha0/quartz#2513).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
Layout fixes: the `has-backlinks` condition works, `byPageType.exclude` matches npm plugin sources, layout overrides in `quartz.ts` are applied, `position: footer` is accepted by the config schema, and typos in positions, display values, frames or page types produce a "did you mean" warning instead of silently dropping the component. `quartz build --verbose` prints a layout report.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
Security updates: `sharp` 0.35.5 (GHSA-wq5f-xc86-pv6w), `toml` 5 (prototype pollution and DoS advisories; TOML frontmatter parses the same, and now also accepts plain dates like `date = 2024-01-02`) and `minimatch` 11 (GHSA-g3hv-75wg-m249; `ignorePatterns` match the same). The plugin schema's `layout.position` lists exactly the positions Quartz renders. `npx quartz tui` points to the right install command (`github:quartz-community/tui`).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
Pages no longer scroll sideways on phones: long words (a page title such as "ObsidianFlavoredMarkdown", long inline code) break where they don't fit, and the right sidebar's components (graph, backlinks) wrap below each other when they don't fit side by side.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Markdown renders as it does in Obsidian: Quartz now uses ObsidianFlavoredMarkdown 2.0 and GitHubFlavoredMarkdown 2.0.
|
||||
|
||||
- **Line breaks changed:** a single line break inside a paragraph now renders as `<br>`, as in Obsidian's default reading view. Set `strictLineBreaks: true` in the ObsidianFlavoredMarkdown options to keep the previous behaviour (a space).
|
||||
- ObsidianFlavoredMarkdown parses with Obsidian's own parser by default (`preset: "legacy"`). Use `preset: "strict"` for TOML (`+++`) frontmatter or plugins that add their own Markdown syntax.
|
||||
- Also new: callouts parsed like Obsidian, inline footnotes (`text^[note]`), image sizes on Markdown images (``), Mermaid diagrams that follow the theme's colours, an opt-in Pele diagram renderer, and inline tags that only link to tag pages that exist.
|
||||
- GitHubFlavoredMarkdown now runs before ObsidianFlavoredMarkdown (order 30, then 40), as in the default config. If your config sets `order` for either plugin, keep GitHubFlavoredMarkdown first.
|
||||
|
||||
See the plugins' changelogs for details.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Permalinks work as in Obsidian Publish (jackyzha0/quartz#2572): `permalink: page` makes the note's address `/page`, whatever its file path. Links to the note, backlinks, the graph, the sitemap, RSS and the content index use the permalink, links inside the note still resolve relative to its file, and the note's file path redirects to the permalink (with AliasRedirects, like `aliases`). Previously the permalink was only a redirect to the file path. A permalink that is already another page's address is ignored with a warning. In navigation (the content trie used by the explorer, folder pages and breadcrumbs) the note stays in its folder, as on Obsidian Publish sites.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Plugins can ship files with the site: `externalResources()` may return `assets: [{ from, to }]` (a file or directory on disk), which Quartz copies to `static/plugins/<to>`. Client scripts find them through the new `window.quartzStaticUrl` page global (absolute URL of `static/`, valid across SPA navigations). Use it for large or optional client code loaded with `import()` only where needed, instead of inline scripts, which every page downloads. Invalid or conflicting targets and missing sources are build warnings.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Plugins can declare what they provide and need (`quartz.capabilities`); the build warns when a required provider is missing (e.g. "backlinks requires data `links` … enable configuration.links"). Rendered plugin components carry `data-quartz-plugin` / `data-quartz-component` attributes, so you can tell which plugin rendered which part of a page. `fetchData` resolves to `{}` instead of rejecting when `contentIndex.json` is missing.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Plugin management: plugin commands exit non-zero on failure, CLI edits keep comments in `quartz.config.yaml`, lockfile pins are honoured everywhere, npm plugins show up in `plugin list`, `plugin add` detects duplicates, misspelled plugin options are flagged, and the new `plugin doctor` checks config, lockfile and installs. `plugin config --set a.b=1` now writes a nested key.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Plugins can be marked deprecated with `quartz.deprecated` (a message naming the replacement) in their `package.json`. Quartz warns while a deprecated plugin is enabled — when the build loads the config (repeated in the end-of-build summary), in `plugin add` and in `plugin doctor` — and suggests removing it. The deprecated `hard-line-breaks` plugin is no longer listed in the default config and templates: ObsidianFlavoredMarkdown 2.0+ handles line breaks (`strictLineBreaks`).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Plugins that fail to load (can't be installed, throw on import, export no plugin) are reported as errors with the plugin, version, the file and line where it failed and what to do, and listed again at the top of the end-of-build summary. Previously some of these failures were silent. Locally the build continues without them; in CI (`CI` set) it fails unless `QUARTZ_ALLOW_BROKEN_PLUGINS=1`. Fixed along the way: the entry module of npm-installed component plugins (and npm plugins without a declared category) was never imported, so their `init(options)` never ran.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
`quartz.ts` overrides (`ExternalPlugin.Explorer({...})`) work for npm plugins and for component plugins (#2565): overrides are registered under the key the loader looks up (the package name for npm plugins), and component constructors re-exported from a plugin's sub-module are wrapped too. The wrapper also returns what the plugin returns, so `ExternalPlugin.X(...)` works both as a statement and as a component in a layout override. `quartz plugin …` commands no longer drop npm plugins from the generated `.quartz/plugins/index.ts`; both generators are now one shared module.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Plugin version requirements are enforced: a plugin's `quartzVersion` (`package.json` → `quartz.quartzVersion`, any semver range) is checked when the config loads (a warning locally; in CI — `CI` set — the build fails unless `QUARTZ_ALLOW_INCOMPATIBLE_PLUGINS=1`), by `plugin add` and by `plugin doctor`, with a message saying whether to update Quartz or the plugin. Previously the field was never checked (and the old checker read `">=5.0.0"` as `0.0.0`).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
New `configuration.publishAssets: "referenced"` (default `"all"`): only copy the images, PDFs and other files that published pages link to or embed, so files that only unpublished notes use stay private (#2531, from #2544). References are matched against published (slugified) file names and include `<object data>` SVG embeds, `srcset` and URL-encoded paths.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
New `npx quartz info` command: prints the Quartz version (with `git describe`, branch and local changes), Node/npm/OS, the config file, built-ins and every plugin with its version, source and compatibility, as a Markdown block to paste into bug reports. The build banner and `plugin doctor` also show where the checkout is relative to the last release.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
Security: plugin commands no longer build shell commands from plugin sources, refs, pinned commits or package names (#2571). git and npm run with argument arrays, refs/commits/URLs/package names are validated (so a value can't be read as an option either), and generated plugin imports are written as escaped string literals. A source such as `github:owner/repo#main;cmd` used to run `cmd`; it is now rejected as an invalid ref. Also fixes restoring a plugin pinned in `quartz.lock.json` to a commit that is no longer its branch tip (#2559).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
New `layout.sidebars` option: how each sidebar handles content taller than the screen. `fit` (default, unchanged) keeps it one screen tall and components shrink and scroll themselves; `scroll` keeps it in view and lets it scroll itself, so nothing is ever out of reach; `static` lets it scroll away with the page. Page types can override it (`byPageType.<type>.sidebars`). New `docs` template for documentation sites (`npx quartz create --template docs`), with both sidebars `static`. Frames receive the modes as a `sidebars` prop and put them on sidebar elements as `data-sidebar-mode`, which plugins can target in CSS.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
SPA navigation follows redirects correctly: when a link is redirected (for example `folder` → `folder/` on static hosts, or an alias page's canonical link), relative links on the new page resolve against where it really is, and the address bar shows that URL. Links on folder pages and parent tag pages reached through slash-less links pointed one level too high.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
`npx quartz upgrade` shows the release notes of every version between the old and the new Quartz, then runs the new version's checks: it restores plugins, runs `plugin doctor` (plugin entries that are built in now, plugins that don't support the new version …) and lists plugin updates. Plugin install/restore skip plugins that are built into Quartz now, and `plugin doctor --fix` also removes their unused lockfile pins.
|
||||
@@ -28,13 +28,19 @@ You can help speed up fixing the problem by either
|
||||
1. providing a simple reproduction
|
||||
2. linking to your Quartz repository where the problem can be observed
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
**Quartz info**
|
||||
Run `npx quartz info` in your Quartz folder and paste its output here. It lists your Quartz version, Node/npm/OS and every plugin with its version — no content or site URL is included.
|
||||
|
||||
- Quartz Version: [e.g. v4.1.2]
|
||||
- `node` Version: [e.g. v18.16]
|
||||
- `npm` version: [e.g. v10.1.0]
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
```
|
||||
Paste the output of `npx quartz info` here
|
||||
```
|
||||
|
||||
(Quartz older than 5.1 doesn't have `npx quartz info`: give the Quartz version from `package.json` and the output of `git log -1 --format=%h`, plus your `node` and `npm` versions and OS.)
|
||||
|
||||
**Browser** (for display problems): [e.g. Firefox 140, Safari on iOS 18]
|
||||
|
||||
**Build output**
|
||||
If the build failed or printed warnings, paste the full output of `npx quartz build`, including the summary at the end.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -4,11 +4,36 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
# Plugins declare these as peer dependencies (preact by 42 plugins, vfile by 15), so a
|
||||
# major bump here passes `npm ci` but breaks plugins at runtime (#2586). Upgrade them
|
||||
# deliberately, together with the plugins.
|
||||
ignore:
|
||||
- dependency-name: "preact"
|
||||
update-types: ["version-update:semver-major"]
|
||||
- dependency-name: "vfile"
|
||||
update-types: ["version-update:semver-major"]
|
||||
- dependency-name: "unified"
|
||||
update-types: ["version-update:semver-major"]
|
||||
groups:
|
||||
# Separated so a risky third-party major cannot block ecosystem updates.
|
||||
quartz-ecosystem:
|
||||
applies-to: "version-updates"
|
||||
patterns:
|
||||
- "@quartz-community/*"
|
||||
- "@quartz-themes/*"
|
||||
# Isolated because a compiler major needs a tsconfig migration of its own.
|
||||
typescript:
|
||||
applies-to: "version-updates"
|
||||
patterns:
|
||||
- "typescript"
|
||||
production-dependencies:
|
||||
applies-to: "version-updates"
|
||||
patterns:
|
||||
- "*"
|
||||
exclude-patterns:
|
||||
- "@quartz-community/*"
|
||||
- "@quartz-themes/*"
|
||||
- "typescript"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
|
||||
- run: npm ci
|
||||
- run: npm install
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
run: npx quartz build -d docs -v
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: preview-build
|
||||
path: public
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
|
||||
- run: npm ci
|
||||
- run: npm install
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
@@ -58,6 +58,13 @@ jobs:
|
||||
- name: Ensure Quartz builds, check bundle info
|
||||
run: npx quartz build --bundleInfo -d docs
|
||||
|
||||
- name: Check for a changeset
|
||||
if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' }}
|
||||
# Non-blocking: docs-only or internal changes don't need one.
|
||||
run: |
|
||||
npx changeset status --since=origin/v5 >/dev/null 2>&1 \
|
||||
|| echo "::warning::No changeset in this PR. If it changes how Quartz behaves, run 'npx changeset' (see .changeset/README.md)."
|
||||
|
||||
publish-tag:
|
||||
if: ${{ github.repository == 'jackyzha0/quartz' && github.ref == 'refs/heads/v5' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
name: Dependabot Auto-merge
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Build and Test"]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
auto-merge:
|
||||
if: >-
|
||||
github.repository == 'jackyzha0/quartz' &&
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
github.event.workflow_run.event == 'pull_request' &&
|
||||
github.event.workflow_run.actor.login == 'dependabot[bot]' &&
|
||||
contains(github.event.workflow_run.head_branch, 'quartz-ecosystem')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Resolve pull request
|
||||
id: pr
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
number=$(gh pr list --state open --json number,headRefOid \
|
||||
--jq "map(select(.headRefOid == \"${HEAD_SHA}\")) | .[0].number // empty")
|
||||
if [ -z "$number" ]; then
|
||||
echo "No open PR matches ${HEAD_SHA}; nothing to merge."
|
||||
echo "found=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
echo "number=${number}" >> "$GITHUB_OUTPUT"
|
||||
echo "found=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Require every check on the commit to have succeeded
|
||||
if: steps.pr.outputs.found == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
runs=$(gh api "repos/${GH_REPO}/commits/${HEAD_SHA}/check-runs" --paginate \
|
||||
--jq '.check_runs[] | "\(.name)\t\(.status)\t\(.conclusion // "")"')
|
||||
echo "$runs"
|
||||
bad=$(printf '%s\n' "$runs" | awk -F'\t' '
|
||||
$2 != "completed" { print; next }
|
||||
$3 != "success" && $3 != "neutral" && $3 != "skipped" { print }
|
||||
')
|
||||
if [ -n "$bad" ]; then
|
||||
echo "Refusing to merge - not all checks succeeded:"
|
||||
printf '%s\n' "$bad"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Confirm update is not a major bump
|
||||
if: steps.pr.outputs.found == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
PR_NUMBER: ${{ steps.pr.outputs.number }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
title=$(gh pr view "$PR_NUMBER" --json title --jq .title)
|
||||
echo "PR title: $title"
|
||||
if printf '%s' "$title" | grep -qiE 'major'; then
|
||||
echo "Refusing to merge a major update; needs human review."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Merge
|
||||
if: steps.pr.outputs.found == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
PR_NUMBER: ${{ steps.pr.outputs.number }}
|
||||
run: gh pr merge "$PR_NUMBER" --squash --delete-branch
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
name: Deploy Preview to Cloudflare Pages
|
||||
steps:
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v7
|
||||
uses: actions/download-artifact@v8
|
||||
id: preview-build-artifact
|
||||
with:
|
||||
name: preview-build
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
|
||||
- run: npm ci
|
||||
- run: npm install
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
|
||||
@@ -25,11 +25,11 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Inject slug/short variables
|
||||
uses: rlespinasse/github-slug-action@v5.4.0
|
||||
uses: rlespinasse/github-slug-action@v5.6.0
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
with:
|
||||
install: true
|
||||
driver-opts: |
|
||||
@@ -37,9 +37,9 @@ jobs:
|
||||
network=host
|
||||
- name: Install cosign
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: sigstore/cosign-installer@v4.0.0
|
||||
uses: sigstore/cosign-installer@v4.1.2
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
if: github.event_name != 'pull_request'
|
||||
with:
|
||||
registry: ghcr.io
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
- name: Extract metadata tags and labels on PRs
|
||||
if: github.event_name == 'pull_request'
|
||||
id: meta-pr
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz
|
||||
tags: |
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
- name: Extract metadata tags and labels for main, release or tag
|
||||
if: github.event_name != 'pull_request'
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
flavor: |
|
||||
latest=auto
|
||||
@@ -76,7 +76,7 @@ jobs:
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
build-args: |
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Release
|
||||
|
||||
# Versioning with changesets (see .changeset/README.md):
|
||||
# 1. While .changeset/*.md files are pending on v5, keep a "chore: release Quartz" PR open that
|
||||
# bumps package.json and writes CHANGELOG.md.
|
||||
# 2. When that PR is merged (no pending changesets left), tag the commit vX.Y.Z and publish a
|
||||
# GitHub release with the CHANGELOG section. Quartz is not published to npm.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v5
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: ${{ github.repository == 'jackyzha0/quartz' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24
|
||||
|
||||
- run: npm install
|
||||
|
||||
- name: Create or update the release PR
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
version: npm run version-packages
|
||||
title: "chore: release Quartz"
|
||||
commit: "chore: release Quartz"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Tag and publish the GitHub release
|
||||
if: steps.changesets.outputs.hasChangesets == 'false'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
VERSION=$(node -p "require('./package.json').version")
|
||||
TAG="v$VERSION"
|
||||
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
|
||||
echo "$TAG already exists — nothing to release."
|
||||
exit 0
|
||||
fi
|
||||
# Only versions produced by `changeset version` are released (guards against tagging
|
||||
# an arbitrary commit with a version that was never released through this workflow).
|
||||
awk -v v="## $VERSION" '$0 == v {found=1; next} found && /^## / {exit} found' CHANGELOG.md > release-notes.md || true
|
||||
if [ ! -s release-notes.md ]; then
|
||||
echo "CHANGELOG.md has no section for $VERSION — not tagging."
|
||||
exit 0
|
||||
fi
|
||||
# GitHub creates the tag, on the commit this push brought (the merged release PR). A tag
|
||||
# made here with `git tag -a` is an unsigned tag object, which GitHub marks "Unverified"
|
||||
# (jackyzha0/quartz#2455). This one points straight at the commit, which shows as verified
|
||||
# because GitHub signs the commits it merges. `git describe --tags` sees it all the same.
|
||||
gh release create "$TAG" --target "$GITHUB_SHA" --title "Quartz $VERSION" --notes-file release-notes.md
|
||||
@@ -11,3 +11,4 @@ private/
|
||||
replit.nix
|
||||
.quartz/
|
||||
quartz/cli/tui/dist/
|
||||
.turbo/
|
||||
+7
-2
@@ -1,10 +1,15 @@
|
||||
FROM node:22-slim AS builder
|
||||
|
||||
# install git to install plugins
|
||||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY package.json .
|
||||
COPY package-lock.json* .
|
||||
COPY .npmrc* .
|
||||
COPY quartz/ ./quartz/
|
||||
COPY quartz.lock.json .
|
||||
RUN npm ci; npx quartz plugin install
|
||||
COPY quartz.lock.json* .
|
||||
RUN npm install; npx quartz plugin install
|
||||
|
||||
FROM node:22-slim
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
@@ -109,6 +109,16 @@ Component.css = styles
|
||||
> [!warning]
|
||||
> Quartz does not use CSS modules so any styles you declare here apply _globally_. If you only want it to apply to your component, make sure you use specific class names and selectors.
|
||||
|
||||
#### Source attributes
|
||||
|
||||
When Quartz renders a component provided by a plugin, it adds two attributes to the component's root element:
|
||||
|
||||
```html
|
||||
<div class="graph" data-quartz-plugin="graph" data-quartz-component="Graph">…</div>
|
||||
```
|
||||
|
||||
They let site owners and theme authors find out which plugin produced a part of the page (use your browser's inspector) and give a stable hook for styling, e.g. `[data-quartz-plugin="graph"] { … }`. The attributes are only added when your component returns a single HTML element; components returning `null`, text, a fragment or another component are rendered unchanged. Existing attributes are never modified.
|
||||
|
||||
### Internationalization
|
||||
|
||||
Component plugins should use the i18n pattern for any user-facing strings. See [[making plugins#Internationalization (i18n)]] for the full setup guide.
|
||||
|
||||
@@ -8,3 +8,4 @@ This section covers advanced topics for users who want to extend or deeply custo
|
||||
- **[[making plugins]]** — Build your own transformer, filter, emitter, or component plugin
|
||||
- **[[creating components]]** — Create custom layout components with JSX
|
||||
- **[[paths]]** — How Quartz resolves and transforms file paths
|
||||
- **[[versioning]]** — Version numbers, plugin compatibility (`quartzVersion`) and releases
|
||||
@@ -61,6 +61,10 @@ my-plugin/
|
||||
|
||||
The plugin's `package.json` should declare dependencies on `@quartz-community/types` (for type definitions) and optionally `@quartz-community/utils` (for shared utilities).
|
||||
|
||||
If your plugin reads data, DOM elements, globals or files produced by another plugin (or provides them), declare that in `quartz.capabilities` so Quartz can warn when the provider is disabled. See [[plugin capabilities]].
|
||||
|
||||
Declare the oldest Quartz version your plugin works with in `quartz.quartzVersion` (a semver range such as `">=5.1.0"`). Quartz checks it when loading the config and in `plugin add` / `plugin doctor`, and mentions it when your plugin throws. See [[versioning#For plugin authors]].
|
||||
|
||||
## Plugin Types
|
||||
|
||||
## Choosing a Plugin Type
|
||||
@@ -253,7 +257,7 @@ 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.
|
||||
|
||||
For example, here is the built-in plugin for removing drafts:
|
||||
For example, here is a filter that removes drafts (Quartz has this [[RemoveDrafts|built in]]):
|
||||
|
||||
```ts
|
||||
import { QuartzFilterPlugin } from "@quartz-community/types"
|
||||
@@ -387,11 +391,71 @@ export interface QuartzPageTypePluginInstance {
|
||||
- `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.
|
||||
- `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).
|
||||
- `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.
|
||||
- `frame`: The [[layout#Page Frames|page frame]] to use for this page type. Controls the overall HTML structure (e.g. `"default"`, `"full-width"`, `"minimal"`, or a custom frame provided by your plugin). If not set, defaults to `"default"`. Can be overridden per-page-type via `layout.byPageType.<name>.template` in `quartz.config.yaml`.
|
||||
- `body`: The Quartz component constructor that renders the page body content.
|
||||
|
||||
### Extending the content index
|
||||
|
||||
Quartz [[ContentIndex|builds `static/contentIndex.json`]] itself — the file search, the explorer, the graph and other client-side components read. Any plugin (transformer, filter, emitter or page type) can add fields to every page's entry by defining `extendContentIndex` on its plugin instance:
|
||||
|
||||
```ts
|
||||
import { QuartzTransformerPlugin } from "@quartz-community/types"
|
||||
|
||||
export const ReadingTime: QuartzTransformerPlugin = () => ({
|
||||
name: "ReadingTime",
|
||||
markdownPlugins: () => [/* … sets file.data.readingTime … */],
|
||||
// called once per page when contentIndex.json is written
|
||||
extendContentIndex({ fileData, entry }) {
|
||||
return { readingTime: fileData.readingTime as number | undefined }
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
Client-side code then finds the field next to the core ones:
|
||||
|
||||
```ts
|
||||
const index = await fetchData
|
||||
index["some/page"].readingTime
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- Return a plain object of JSON-serialisable values, or `undefined` to add nothing. `undefined` values are skipped.
|
||||
- Core fields (`slug`, `filePath`, `title`, `links`, `tags`, `content`, `richContent`, `date`, `description`) cannot be overridden.
|
||||
- If two plugins add the same key, the first one in plugin order keeps it; a warning names both. Prefer distinctive or namespaced keys (`"readingTime"`, `"myPlugin:score"` or one nested object).
|
||||
- `entry` is a read-only copy of the core fields; `fileData` is the page's `file.data`.
|
||||
- Errors thrown by the hook are reported as a warning and the page keeps its core entry.
|
||||
- Keep it small: `contentIndex.json` is downloaded by every visitor.
|
||||
|
||||
Declare the field in your [[plugin capabilities|capabilities]] (`provides.data`) so other plugins can depend on it.
|
||||
|
||||
### Reusing the content index in emitters
|
||||
|
||||
Emitters don't need to rebuild the index: `ctx.contentIndex` holds it (a read-only `Map` from slug to entry, virtual pages included, with the same fields as `contentIndex.json` plus `date` and `description`). It is built once per build, after page types generated their pages and before plugin emitters run:
|
||||
|
||||
```ts
|
||||
emit: async (ctx, content) => {
|
||||
const recent = [...(ctx.contentIndex?.values() ?? [])]
|
||||
.filter((entry) => entry.date)
|
||||
.sort((a, b) => b.date!.getTime() - a.date!.getTime())
|
||||
.slice(0, 20)
|
||||
// … write a feed, a JSON API, a search index …
|
||||
}
|
||||
```
|
||||
|
||||
Built-in settings are available too, with defaults and migrated options applied: `ctx.cfg.configuration.links.markdownLinkResolution`, `ctx.cfg.configuration.contentIndex.enableRSS`, … Both need Quartz 5.1+ — declare `"quartzVersion": ">=5.1.0"` (see [[versioning#For plugin authors]]).
|
||||
|
||||
### Components in sidebars
|
||||
|
||||
Sidebars have three modes ([[layout#Sidebar modes|`layout.sidebars`]]), set on the sidebar element as `data-sidebar-mode`:
|
||||
|
||||
- In `fit` (the default) a sidebar is exactly one screen tall and doesn't scroll. A component that can grow (a list, a tree) must be able to shrink: give it `min-height: 0` and its own scroll area (`overflow-y: auto`), or it pushes the components below it out of reach.
|
||||
- In `scroll` and `static`, core gives every sidebar component its natural height (`flex-shrink: 0`); nothing extra is needed.
|
||||
|
||||
To behave differently per mode, target it in your stylesheet, e.g. `.sidebar[data-sidebar-mode="fit"] .my-list { max-height: 40vh; }`. Custom frames with sidebars should put the `sidebars` prop on their sidebar elements the same way.
|
||||
|
||||
### Providing Custom Frames
|
||||
|
||||
Plugins can ship their own [[layout#Page Frames|page frames]] — custom page layouts that control how the HTML structure (sidebars, header, content area, footer) is arranged. This is useful for page types that need fundamentally different layouts (e.g. a fullscreen canvas, a presentation mode, a dashboard).
|
||||
@@ -412,13 +476,13 @@ export const MyFrame: PageFrame = {
|
||||
grid-template-areas: "center";
|
||||
}
|
||||
`,
|
||||
render({ componentData, pageBody: Content, footer: Footer }: PageFrameProps): unknown {
|
||||
render({ componentData, pageBody: Content, footer: Footers }: PageFrameProps): unknown {
|
||||
const renderSlot = (C: (props: typeof componentData) => unknown): ComponentChildren =>
|
||||
C(componentData) as ComponentChildren
|
||||
return (
|
||||
<div class="center">
|
||||
{(Content as any)(componentData)}
|
||||
{(Footer as any)(componentData)}
|
||||
{Footers.map((Footer) => (Footer as any)(componentData))}
|
||||
</div>
|
||||
)
|
||||
},
|
||||
@@ -428,7 +492,7 @@ export const MyFrame: PageFrame = {
|
||||
Key requirements:
|
||||
|
||||
- `name`: A unique string identifier. This is what page types and YAML config reference.
|
||||
- `render()`: Receives all layout slots (header, sidebars, content, footer) and returns JSX for the inner page structure.
|
||||
- `render()`: Receives all layout slots (header, sidebars, content, footer) and returns JSX for the inner page structure. Note that `footer` is a `QuartzComponent[]` (an array) — frames should iterate over it with `.map()` to render all footer components.
|
||||
- `css` (optional): Frame-specific CSS. Scope it with `.page[data-frame="my-frame"]` selectors to avoid conflicts.
|
||||
|
||||
**2. Re-export the frame:**
|
||||
@@ -519,7 +583,87 @@ Each view registration includes:
|
||||
|
||||
The `ViewRegistry` is a global singleton (via `Symbol.for`) ensuring all copies of the module share the same registry.
|
||||
|
||||
## Building and Testing
|
||||
## Building and Distribution
|
||||
|
||||
Quartz v5 plugins ship pre-built `dist/` in their repositories. When a user installs your plugin, Quartz detects the pre-built output and skips the install/build cycle entirely — making installation near-instant.
|
||||
|
||||
### Build Configuration
|
||||
|
||||
The plugin template's `tsup.config.ts` bundles all dependencies by default. Only **singleton externals** — packages that must be the same instance across all plugins — are left unbundled:
|
||||
|
||||
```ts
|
||||
const SINGLETON_EXTERNALS = [
|
||||
"preact",
|
||||
"preact/hooks",
|
||||
"preact/jsx-runtime",
|
||||
"preact/compat",
|
||||
"@jackyzha0/quartz",
|
||||
"@jackyzha0/quartz/*",
|
||||
"vfile",
|
||||
"vfile/*",
|
||||
"unified",
|
||||
]
|
||||
|
||||
export default defineConfig({
|
||||
// ...
|
||||
noExternal: [/.*/], // Bundle everything
|
||||
external: SINGLETON_EXTERNALS, // Except singletons
|
||||
})
|
||||
```
|
||||
|
||||
This means your plugin's `dist/index.js` is self-contained — no `npm install` needed at install time.
|
||||
|
||||
### Shipping Pre-built Output
|
||||
|
||||
Your plugin's `dist/` directory should be committed to the repository:
|
||||
|
||||
1. **Do NOT add `dist/` to `.gitignore`**
|
||||
2. Run `npm run build` before committing
|
||||
3. The CI workflow verifies `dist/` is up to date on every push
|
||||
|
||||
If `dist/` is missing or gitignored, Quartz falls back to the full install/build cycle (useful during local development with symlinked plugins).
|
||||
|
||||
### Shipping Files with Your Plugin
|
||||
|
||||
Since Quartz 5.1, `externalResources()` can return `assets`: files or directories that Quartz copies into the site at `static/plugins/<to>`. Client scripts find them through the `window.quartzStaticUrl` page global (the absolute URL of `static/`, valid across SPA navigations).
|
||||
|
||||
Use this for large or optional client code instead of an inline script: Quartz serves inline scripts to **every page**, while an asset is only downloaded where your script imports it.
|
||||
|
||||
```ts
|
||||
import path from "path"
|
||||
import { createRequire } from "module"
|
||||
|
||||
externalResources() {
|
||||
// resolve a dependency's browser build at build time
|
||||
const pkg = createRequire(import.meta.url).resolve("my-renderer/package.json")
|
||||
return {
|
||||
js: [{ script: loaderScript, loadTime: "afterDOMReady", contentType: "inline", moduleType: "module" }],
|
||||
assets: [{ from: path.join(path.dirname(pkg), "dist", "esm"), to: "my-plugin/renderer" }],
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```ts title="loader.inline.ts"
|
||||
document.addEventListener("nav", async () => {
|
||||
const nodes = document.querySelectorAll(".my-widget")
|
||||
if (nodes.length === 0 || !window.quartzStaticUrl) return // nothing to do on this page
|
||||
const url = new URL("plugins/my-plugin/renderer/index.js", window.quartzStaticUrl).href
|
||||
const { render } = await import(url)
|
||||
for (const node of nodes) render(node)
|
||||
})
|
||||
```
|
||||
|
||||
- `to` is relative to `static/plugins/`; use your plugin's name as the first segment. Invalid or conflicting targets and missing sources are reported as build warnings.
|
||||
- An ES module build with relative `import()`s keeps working when served this way, so only the chunks a page needs are downloaded.
|
||||
- Older Quartz versions ignore `assets` and leave `quartzStaticUrl` undefined. Either require `"quartzVersion": ">=5.1.0"` or fall back (for example to a CDN), as [[ObsidianFlavoredMarkdown]] does for [[Mermaid diagrams|Pele]].
|
||||
|
||||
### Plugins with Native Dependencies
|
||||
|
||||
Plugins that require native packages (e.g. `sharp` for image processing) cannot bundle those. For these plugins:
|
||||
|
||||
1. Set `"requiresInstall": true` in your `package.json` quartz manifest
|
||||
2. Declare the native package as a `peerDependency`
|
||||
3. Quartz will install it into the host project at build time
|
||||
|
||||
```shell
|
||||
# Build the plugin
|
||||
@@ -637,7 +781,7 @@ Use [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) locale codes (e.g.
|
||||
npx quartz plugin add github:your-username/my-plugin
|
||||
```
|
||||
|
||||
This clones the plugin, builds it, and adds it to both `quartz.config.yaml` and `quartz.lock.json`. You can then configure it in your config:
|
||||
This clones the plugin and adds it to both `quartz.config.yaml` and `quartz.lock.json`. If the plugin ships pre-built `dist/` (recommended), installation completes in seconds with no build step. You can then configure it in your config:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
@@ -650,15 +794,15 @@ For options that require JavaScript callback functions (not expressible in YAML)
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.MyPlugin({
|
||||
// callback functions or other non-serializable options
|
||||
customFn: (data) => {
|
||||
// ...
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
Options set via `quartz.ts` are merged with YAML options at instantiation time, with `quartz.ts` overrides taking precedence.
|
||||
Options set via `quartz.ts` are merged with YAML options at instantiation time, with `quartz.ts` overrides taking precedence. These calls must be placed **before** `loadQuartzConfig()` in your `quartz.ts`.
|
||||
|
||||
### Development Workflow
|
||||
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
---
|
||||
title: Plugin capabilities
|
||||
---
|
||||
|
||||
Quartz plugins cooperate through channels the type system can't see:
|
||||
|
||||
- `file.data` keys (e.g. built-in [[CrawlLinks|link processing]] writes `links`, [[plugins/Backlinks|backlinks]] reads it),
|
||||
- DOM classes queried by client scripts (OFM's mermaid script looks for syntax-highlighting's `.clipboard-button`),
|
||||
- browser globals and document events (`fetchData`, `addCleanup`, `nav`, `themechange`),
|
||||
- emitted files (`static/contentIndex.json`, read by search, explorer and graph),
|
||||
- CSS custom properties.
|
||||
|
||||
When the provider of one of these is disabled, the consumer usually breaks _silently_: an empty backlinks list, wikilinks that 404, or — worst — `draft: true` pages being published because no plugin parsed the frontmatter. **Capabilities** let a plugin declare what it provides and needs, so `quartz build` can say what is wrong:
|
||||
|
||||
```
|
||||
⚠ Plugin "backlinks" requires data "links", but no enabled plugin provides it — enable "configuration.links". (the backlinks list is always empty)
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> Capabilities are opt-in and advisory. Plugins without them behave exactly as before, and an unsatisfied requirement is a warning, never a build failure.
|
||||
|
||||
## Declaring capabilities
|
||||
|
||||
Add `capabilities` to the `quartz` field of your plugin's `package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"quartz": {
|
||||
"name": "backlinks",
|
||||
"capabilities": {
|
||||
"provides": {},
|
||||
"requires": {
|
||||
"data": [
|
||||
{ "name": "links", "from": "crawl-links", "reason": "the backlinks list is always empty" }
|
||||
]
|
||||
},
|
||||
"optional": {
|
||||
"data": [
|
||||
{
|
||||
"name": "frontmatter",
|
||||
"from": "note-properties",
|
||||
"reason": "titles fall back to file names"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Section | Meaning | Unsatisfied → |
|
||||
| ---------- | ------------------------------------------------------------------------- | ---------------------- |
|
||||
| `provides` | What this plugin makes available. Plain strings. | — |
|
||||
| `requires` | Needed for the plugin to work correctly. | build warning |
|
||||
| `optional` | Used when present; the plugin degrades gracefully (you must handle that). | info (not printed yet) |
|
||||
|
||||
Each section maps a **kind** to a list:
|
||||
|
||||
| Kind | Names | Example |
|
||||
| --------- | ------------------------------------------------------------- | ---------------------------- |
|
||||
| `data` | `file.data` / `fileData` keys (vfile `DataMap`) | `"links"` |
|
||||
| `dom` | CSS selector rendered into pages or added by a script | `".clipboard-button"` |
|
||||
| `globals` | browser globals defined by scripts | `"fetchData"` |
|
||||
| `events` | `document` CustomEvents dispatched | `"themechange"` |
|
||||
| `files` | emitted paths relative to the site root (leading `/` ignored) | `"static/contentIndex.json"` |
|
||||
| `cssVars` | CSS custom properties defined | `"--secondary"` |
|
||||
|
||||
A requirement is either a name, or `{ "name", "from"?, "reason"? }`:
|
||||
|
||||
- `from` — plugin name(s) (the manifest `name`, e.g. `"crawl-links"`) known to provide it. It is used for the "enable …" hint, **and** a requirement counts as satisfied whenever a plugin named in `from` is enabled, even if that plugin predates capability declarations. Always set `from` for first-party providers: it keeps new consumers working with old providers.
|
||||
- `reason` — what breaks without it, appended to the warning.
|
||||
|
||||
Names are matched exactly (after trimming). Unknown kinds or malformed entries are ignored and reported, never fatal.
|
||||
|
||||
### Provided by Quartz itself
|
||||
|
||||
These never need a provider plugin (`coreCapabilities()` in `quartz/plugins/loader/capabilities.ts`):
|
||||
|
||||
- data: `slug`, `filePath`, `relativePath`
|
||||
- dom: `#quartz-body`, `.page`, `.center`, `article`, `.popover-hint`, `.sidebar`
|
||||
- globals: `fetchData`, `addCleanup`, `spaNavigate`
|
||||
- events: `nav` (always), `prenav` (only with `enableSPA`)
|
||||
|
||||
Note that `fetchData` is a promise for `static/contentIndex.json`, which Quartz emits by default ([[ContentIndex|built-in content index]]). Declare `files: ["static/contentIndex.json"]` if you read it. Since this release `fetchData` resolves to `{}` (with a console warning) when the file is missing, instead of rejecting.
|
||||
|
||||
## How the check works
|
||||
|
||||
`loadQuartzConfig()` calls `validatePluginCapabilities()` after loading manifests:
|
||||
|
||||
1. Collect `provides` of core and every **enabled** plugin.
|
||||
2. For each enabled plugin with `capabilities`, check each `requires` / `optional` entry. Satisfied if provided, or if a plugin listed in `from` is enabled.
|
||||
3. Only if something is missing, also read the manifests of **disabled** entries in `quartz.config.yaml` to suggest which one to enable.
|
||||
4. Warnings are printed once per process (main thread only).
|
||||
|
||||
The check is static: it cannot see option-dependent behaviour (e.g. `syntax-highlighting` with `clipboard: false` still "provides" `.clipboard-button`) or pipeline order (see the `dependencies` / `defaultOrder` checks for that).
|
||||
|
||||
## Writing robust consumers
|
||||
|
||||
Declaring a requirement is not a substitute for handling its absence. For `optional` (and ideally `requires`) capabilities:
|
||||
|
||||
- Guard DOM lookups: `const btn = pre.querySelector(".clipboard-button"); if (btn) { … }` — never `getComputedStyle(maybeNull)`.
|
||||
- Default data: `file.data.links ?? []`, `fileData.dates?.created`.
|
||||
- Wrap `await fetchData` in `try`/`catch` and accept an empty object.
|
||||
|
||||
## Built-ins as providers
|
||||
|
||||
Quartz's [[built-in processing]] steps take part in the check like plugins: when enabled, built-in frontmatter provides `frontmatter`, `aliases` and `frontmatterLinks`, built-in links provides `links`, and the built-in content index provides `static/contentIndex.json`. When one is turned off, warnings suggest `configuration.<key>` (and a `from: "crawl-links"` hint is shown as `configuration.links`).
|
||||
|
||||
The same declarations decide replacement: an enabled plugin that `provides` `data: ["frontmatter"]`, `data: ["links"]` or `files: ["static/contentIndex.json"]` replaces the matching built-in.
|
||||
|
||||
## Migration path
|
||||
|
||||
1. **Now (this change):** core checker + declarations on a representative set of first-party plugins: `note-properties`, `crawl-links`, `backlinks`, `description`, `content-index`, `syntax-highlighting`, `obsidian-flavored-markdown`, `remove-draft`, `search`.
|
||||
2. **Next, first-party plugins** — drafts derived from the workspace catalog (`just catalog show <plugin>` in the dev-mode workspace lists data read/written, DOM classes and scripts):
|
||||
|
||||
| Plugin | Draft |
|
||||
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `explicit-publish` | requires data `frontmatter` (built in) |
|
||||
| `graph`, `explorer` | requires files `static/contentIndex.json` (built in); optional events `themechange` from darkmode |
|
||||
| `recent-notes`, `content-meta` | optional data `dates` from created-modified-date |
|
||||
| `alias-redirects` | requires data `aliases` (built in) |
|
||||
| `table-of-contents` | provides data `toc`, `collapseToc` |
|
||||
| `created-modified-date` | provides data `dates`, `defaultDateType` |
|
||||
| `unlisted-pages`, `encrypted-pages` | provide data `unlisted` (encrypted-pages also `encrypted`, events `render`, `content-index-updated`) |
|
||||
| `darkmode` | provides events `themechange` |
|
||||
| `og-image`, `folder-page`, `tag-page` | optional data `description` from description, `dates` from created-modified-date |
|
||||
| `canvas-page`, `obsidian-plugin-excalidraw` | optional dom `.explorer` (they style it) from explorer |
|
||||
|
||||
3. **Third-party plugins:** add declarations at their own pace; nothing changes for them otherwise.
|
||||
4. **Later (proposals, not implemented):** print `optional` infos with `quartz build --verbose`; a `strictCapabilities` option that turns warnings into errors; ordering checks for `data` between transformers (needs a `phase` per provided key); option-aware provides; a `transforms` kind for "rewrites links" style contracts (OFM currently uses crawl-links' `.internal` class as a proxy); exporting these types from `@quartz-community/types`.
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
title: Versioning and releases
|
||||
description: What Quartz's version number means, how plugins declare the Quartz versions they support, and how releases are made.
|
||||
---
|
||||
|
||||
Quartz follows [semantic versioning](https://semver.org): `MAJOR.MINOR.PATCH`.
|
||||
|
||||
- **patch** (5.1.**1**) — bug fixes.
|
||||
- **minor** (5.**2**.0) — new features and new APIs for plugins. Existing sites and plugins keep working.
|
||||
- **major** (**6**.0.0) — breaking changes, with an upgrade guide.
|
||||
|
||||
Each release is a git tag (`v5.1.0`) with a [GitHub release](https://github.com/jackyzha0/quartz/releases) listing the changes, also in `CHANGELOG.md`. Quartz itself is not published to npm — your site is a clone of the repository, so its version is the one in `package.json`.
|
||||
|
||||
## Which version am I on?
|
||||
|
||||
```shell
|
||||
npx quartz info
|
||||
```
|
||||
|
||||
prints the version, where your checkout is relative to the last release, your environment and your plugins as a block you can paste into an issue or support question. The version shows as e.g. `5.1.0 (v5.1.0-4-g1a2b3c4-dirty)`: 4 commits after the `v5.1.0` release, at commit `1a2b3c4`, with local changes. `npx quartz build` and `npx quartz plugin doctor` print it too.
|
||||
|
||||
When asking for help, please include this output — a version number is much more useful than a commit hash of your fork.
|
||||
|
||||
## Plugin compatibility
|
||||
|
||||
Plugins declare the Quartz versions they work with in their `package.json`:
|
||||
|
||||
```json title="package.json"
|
||||
{
|
||||
"quartz": {
|
||||
"quartzVersion": ">=5.1.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Any [npm semver range](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#dependencies) works (`>=5.1.0`, `^5.1.0`, `>=5.1.0 <7`). Quartz checks it
|
||||
|
||||
- when the build loads your config: locally a warning (repeated in the end-of-build summary); in CI (when the `CI` environment variable is set, as on GitHub Actions, GitLab CI, Netlify, Vercel or Cloudflare Pages) the build fails, so an incompatible plugin doesn't get deployed. Set `QUARTZ_ALLOW_INCOMPATIBLE_PLUGINS=1` to build anyway,
|
||||
- in `npx quartz plugin add` and `npx quartz plugin doctor` (an error for enabled plugins),
|
||||
|
||||
and says whether to update Quartz (`npx quartz upgrade`) or the plugin. If an incompatible plugin later fails, the error message mentions the version mismatch as a likely cause.
|
||||
|
||||
### For plugin authors
|
||||
|
||||
- Set `quartzVersion` to the **oldest Quartz version your plugin works with**. Raise it when you start using a newer API — for example a plugin that relies on [[built-in processing]] (core-parsed frontmatter, `ctx.contentIndex`, `extendContentIndex`) needs `">=5.1.0"`.
|
||||
- Prefer a lower bound (`>=5.1.0`) over a caret range: minor Quartz releases don't break plugins, so `^5` would only add an upper bound you'd have to bump at every major release. Add an upper bound when you know a major version breaks you.
|
||||
- Raising `quartzVersion` is a breaking change for users on older Quartz versions: release it as a new major (or at least minor) version of your plugin and say so in its changelog.
|
||||
- Pre-releases count: Quartz `5.2.0-beta.1` satisfies `>=5.1.0`.
|
||||
- To retire a plugin, set `quartz.deprecated` in its `package.json` to a message saying what replaces it (for example `"Line breaks are handled by ObsidianFlavoredMarkdown 2.0+ …"`). Quartz 5.1+ warns when the plugin is enabled (in the build summary, `plugin add` and `plugin doctor`) and suggests removing it; the plugin keeps working.
|
||||
|
||||
## Contributing: changesets
|
||||
|
||||
Quartz uses [changesets](https://github.com/changesets/changesets). A pull request that changes how Quartz behaves should include one:
|
||||
|
||||
```shell
|
||||
npx changeset
|
||||
```
|
||||
|
||||
Choose `patch`, `minor` or `major` and describe the change for users. On every push to `v5` a "chore: release Quartz" pull request collects the pending changesets, bumps `package.json` and updates `CHANGELOG.md`; merging it tags the release and publishes the GitHub release notes. CI warns (without failing) when a pull request has no changeset.
|
||||
+11
-11
@@ -6,15 +6,15 @@ The `create` command initializes a new Quartz project. It helps you set up your
|
||||
|
||||
## Flags
|
||||
|
||||
| Flag | Shorthand | Description |
|
||||
| ------------- | --------- | --------------------------------------------------------------------- |
|
||||
| `--template` | `-t` | Configuration template (`default`, `obsidian`, `ttrpg`, or `blog`) |
|
||||
| `--directory` | `-d` | The directory where Quartz will be initialized |
|
||||
| `--source` | `-s` | The source directory of your Markdown files |
|
||||
| `--strategy` | `-X` | How to handle the source files (`new`, `copy`, or `symlink`) |
|
||||
| `--links` | `-l` | How to resolve internal links (`absolute`, `shortest`, or `relative`) |
|
||||
| `--baseUrl` | `-b` | Base URL for your site (e.g. `mysite.github.io/quartz`) |
|
||||
| `--verbose` | `-v` | Enable detailed logging |
|
||||
| Flag | Shorthand | Description |
|
||||
| ------------- | --------- | -------------------------------------------------------------------------- |
|
||||
| `--template` | `-t` | Configuration template (`default`, `obsidian`, `ttrpg`, `blog`, or `docs`) |
|
||||
| `--directory` | `-d` | The directory where Quartz will be initialized |
|
||||
| `--source` | `-s` | The source directory of your Markdown files |
|
||||
| `--strategy` | `-X` | How to handle the source files (`new`, `copy`, or `symlink`) |
|
||||
| `--links` | `-l` | How to resolve internal links (`absolute`, `shortest`, or `relative`) |
|
||||
| `--baseUrl` | `-b` | Base URL for your site (e.g. `mysite.github.io/quartz`) |
|
||||
| `--verbose` | `-v` | Enable detailed logging |
|
||||
|
||||
## Templates
|
||||
|
||||
@@ -24,6 +24,7 @@ When you run `quartz create`, you can choose a configuration template that pre-c
|
||||
- **Obsidian**: Optimized for Obsidian vaults with full Obsidian Flavored Markdown support (wikilinks, callouts, mermaid diagrams, etc.). Automatically sets link resolution to `shortest` and skips the link resolution prompt.
|
||||
- **TTRPG**: Builds on the Obsidian template with the addition of the [Leaflet bases plugin](https://github.com/Requiae/quartz-leaflet-bases-plugin) and [ITS Theme](https://github.com/saberzero1/quartz-themes) (`its-theme.ttrpg-dnd`). Great for D&D and TTRPG wikis. Also skips the link resolution prompt.
|
||||
- **Blog**: A blog-focused setup with [recent notes](https://github.com/quartz-community/recent-notes) enabled (showing the 5 most recent posts with tags) and [comments](https://github.com/quartz-community/comments) enabled via giscus. You'll need to fill in the `TODO:` placeholder values in `quartz.config.yaml` with your own giscus repository details.
|
||||
- **Documentation**: The default setup with both sidebars set to scroll away with the page ([[layout#Sidebar modes|`layout.sidebars`]]: `static`), so long navigation and tables of contents are never cut off.
|
||||
|
||||
## Base URL
|
||||
|
||||
@@ -40,7 +41,6 @@ When you run `quartz create`, you must choose a strategy for your content:
|
||||
- **new**: Creates a fresh, empty content folder. Use this if you are starting a new project from scratch.
|
||||
- **copy**: Copies all files from your source directory into the Quartz content folder. This is the safest option for existing vaults as it doesn't touch your original files.
|
||||
- **symlink**: Creates a symbolic link from the Quartz content folder to your source directory. Any changes you make in your source directory (e.g. in Obsidian) will be immediately reflected in Quartz.
|
||||
- **move**: Moves your files from the source directory into the Quartz content folder.
|
||||
|
||||
## Link Resolution
|
||||
|
||||
@@ -57,7 +57,7 @@ Quartz needs to know how to interpret the internal links in your Markdown files:
|
||||
|
||||
If you run `npx quartz create` without any arguments, it will guide you through an interactive setup:
|
||||
|
||||
1. **Choose a template**: Select a configuration template (`Default`, `Obsidian`, `TTRPG`, or `Blog`).
|
||||
1. **Choose a template**: Select a configuration template (`Default`, `Obsidian`, `TTRPG`, `Blog`, or `Documentation`).
|
||||
2. **Select a strategy**: Choose between `new`, `copy`, or `symlink`.
|
||||
3. **Enter base URL**: Provide the URL where your site will be hosted.
|
||||
4. **Select link resolution**: Choose how your links are formatted (skipped for Obsidian and TTRPG templates).
|
||||
|
||||
+3
-2
@@ -16,15 +16,16 @@ You can run the CLI using `npx quartz`.
|
||||
| `upgrade` | Upgrade Quartz to the latest version (alias: `update`) | `npx quartz upgrade` |
|
||||
| `plugin` | Manage Quartz plugins (install, add, remove, etc.) | `npx quartz plugin list` |
|
||||
| `tui` | Launch the interactive plugin manager | `npx quartz tui` |
|
||||
| `info` | Print version, environment and plugins for bug reports | `npx quartz info` |
|
||||
|
||||
## Commands
|
||||
|
||||
- [[create|create]]: Initialize a new Quartz project with a choice of templates (default, obsidian, ttrpg, blog) and base URL configuration.
|
||||
- [[create|create]]: Initialize a new Quartz project with a choice of templates (default, obsidian, ttrpg, blog, docs) and base URL configuration.
|
||||
- [[build|build]]: Build your Quartz site into static HTML. Includes a development server.
|
||||
- [[sync|sync]]: Push and pull changes between your local machine and GitHub.
|
||||
- [[upgrade|upgrade]]: Upgrade the Quartz framework to the latest version. Also available as `npx quartz update`.
|
||||
- [[restore|restore]]: Recover your content folder from the local cache.
|
||||
- [[cli/plugin|plugin]]: Install, add, remove, prune, and configure plugins. Use `plugin install` with flags for lockfile/config sync, updates, and checks.
|
||||
- [[cli/plugin|plugin]]: Install, add, remove, prune, and configure plugins. Use `plugin install` with flags for lockfile/config sync, updates, and checks, and `plugin doctor` to diagnose plugin problems.
|
||||
- [[tui|tui]]: Use a terminal interface to manage plugins and layout.
|
||||
|
||||
## Global Flags
|
||||
|
||||
+93
-17
@@ -4,13 +4,20 @@ title: quartz plugin
|
||||
|
||||
The `plugin` command is the heart of the Quartz v5 plugin management system. it allows you to install, configure, and update plugins directly from the command line.
|
||||
|
||||
All plugins are stored in the `.quartz/plugins/` directory, and their versions are tracked in `quartz.lock.json`.
|
||||
Quartz plugins come from two kinds of sources:
|
||||
|
||||
- **npm packages** (`@quartz-community/explorer`) — the default plugins. They are installed into `node_modules/` by `npm install` / `npm ci` and versioned by `package.json` and `package-lock.json`.
|
||||
- **Git repositories and local directories** (`github:owner/repo`, `./my-plugin`) — cloned or symlinked into `.quartz/plugins/`. Their exact commits are pinned in `quartz.lock.json`.
|
||||
|
||||
Wherever a command takes a plugin name you can use the full name (`@quartz-community/explorer`), the source as written in `quartz.config.yaml`, or the short name (`explorer`). Misspelled names get a "did you mean" suggestion.
|
||||
|
||||
Every subcommand exits with a non-zero status when something fails (a clone, a build, an unknown plugin name), so `npx quartz plugin install && npx quartz build` stops in CI instead of building a site with missing plugins.
|
||||
|
||||
## Subcommands
|
||||
|
||||
### list
|
||||
|
||||
List all currently installed plugins and their versions.
|
||||
List all configured plugins: Git/local plugins with their pinned commit, npm plugins with their installed version, and any plugins that are in `quartz.config.yaml` but not installed yet.
|
||||
|
||||
```shell
|
||||
npx quartz plugin list
|
||||
@@ -18,10 +25,11 @@ npx quartz plugin list
|
||||
|
||||
### add
|
||||
|
||||
Add a new plugin from a Git repository.
|
||||
Add a new plugin from a Git repository. The plugin is installed, pinned in `quartz.lock.json`, and added to `quartz.config.yaml` with its default options — enabled unless the plugin is disabled by default.
|
||||
|
||||
```shell
|
||||
npx quartz plugin add github:username/repo
|
||||
npx quartz plugin add username/repo # same as github:username/repo
|
||||
```
|
||||
|
||||
To install from a specific branch or ref, append `#ref` to the source:
|
||||
@@ -44,30 +52,40 @@ Local plugins are symlinked into `.quartz/plugins/`, so any changes you make to
|
||||
|
||||
When a branch is specified, it is stored in the lockfile. All subsequent commands (`install`, `prune`) will respect that branch automatically. Use `install --latest` to fetch the latest commit from that branch.
|
||||
|
||||
`plugin add` will not create duplicate entries: if a plugin with the same name is already configured (for example `@quartz-community/graph` when you add `github:someone/graph`), it is skipped with a hint. Remove the existing plugin first, or use `--as <name>` to install the second one under a different name. If the plugin is already present in `.quartz/plugins/` but missing from the config (e.g. after you deleted its entry by hand), `add` adds it back to the config without re-cloning.
|
||||
|
||||
> [!tip]
|
||||
> `plugin add` also accepts `--concurrency` / `-c` to limit how many remote repositories are cloned and built at the same time. This is the same flag documented under [[#install]] and is useful when adding several plugins at once on low-end hardware.
|
||||
|
||||
### remove
|
||||
|
||||
Remove an installed plugin.
|
||||
Remove a plugin: deletes its entry from `quartz.config.yaml`, and for Git/local plugins also its directory in `.quartz/plugins/` and its lockfile entry.
|
||||
|
||||
```shell
|
||||
npx quartz plugin remove plugin-name
|
||||
npx quartz plugin remove explorer # short name of @quartz-community/explorer
|
||||
```
|
||||
|
||||
For npm plugins the package stays in `node_modules/` (most of them ship with Quartz). If another configured plugin declares a dependency on the one you removed, a warning tells you so.
|
||||
|
||||
### install
|
||||
|
||||
Install plugins for your Quartz project. By default, this installs all plugins listed in your `quartz.lock.json` file.
|
||||
Install plugins for your Quartz project. By default, this installs all plugins listed in your `quartz.lock.json` file, at exactly the pinned commits (including plugins installed from a repository subdirectory).
|
||||
|
||||
```shell
|
||||
npx quartz plugin install
|
||||
```
|
||||
|
||||
If there is no `quartz.lock.json` yet, `install` falls back to installing the Git/local plugins from `quartz.config.yaml` and writes the lockfile — commit it to pin those versions. If only npm plugins are configured there is nothing to do and the command says so. When `quartz.config.yaml` lists Git plugins that are missing from the lockfile, `install` prints them with a hint to run `install --from-config`.
|
||||
|
||||
> [!note]
|
||||
> `npx quartz build` also installs any configured Git plugin that is missing from `.quartz/plugins/`, and checks out the commit pinned in `quartz.lock.json` when there is one. Running `plugin install` first is still recommended in CI, because it fails loudly when a plugin cannot be installed.
|
||||
|
||||
#### Flags
|
||||
|
||||
- `--from-config`: Synchronize plugins with `quartz.config.yaml` instead of the lockfile. This will install missing plugins and prune orphaned ones.
|
||||
- `--latest`: Fetch the latest version of plugins from their remote sources instead of using the version in the lockfile.
|
||||
- `--clean`: Skip existing directories and perform a fresh installation.
|
||||
- `--clean`: Only restore plugins whose directory is missing; existing directories are left untouched.
|
||||
- `--dry-run`: Preview the changes without actually installing or removing any files.
|
||||
- `--concurrency`, `-c`: Maximum number of plugins to clone, fetch, and build in parallel. Defaults to the number of CPU cores. Lower this (e.g. `-c 1` or `-c 2`) on memory- or CPU-constrained machines where the default parallelism causes failures, OOMs, or hangs. See [[#Installing on low-end hardware]] below.
|
||||
|
||||
@@ -92,18 +110,59 @@ npx quartz plugin enable plugin-name
|
||||
npx quartz plugin disable plugin-name
|
||||
```
|
||||
|
||||
The CLI edits `quartz.config.yaml` in place: your comments, quoting and key order are preserved, and the file is only rewritten when something actually changed.
|
||||
|
||||
### config
|
||||
|
||||
View or modify the configuration for a specific plugin.
|
||||
View or modify the options of a specific plugin.
|
||||
|
||||
```shell
|
||||
# View config
|
||||
npx quartz plugin config plugin-name
|
||||
# View the options you set, plus the plugin defaults you have not overridden
|
||||
npx quartz plugin config explorer
|
||||
|
||||
# Set a value
|
||||
npx quartz plugin config plugin-name --set key=value
|
||||
# Set values (repeatable; values are parsed as JSON when possible)
|
||||
npx quartz plugin config explorer --set folderDefaultState=open --set useSavedState=false
|
||||
|
||||
# Nested option keys use dots
|
||||
npx quartz plugin config graph --set localGraph.depth=2
|
||||
|
||||
# Remove an option so the plugin default applies again
|
||||
npx quartz plugin config explorer --unset folderDefaultState
|
||||
```
|
||||
|
||||
Options are checked against the plugin's documented defaults (the `defaultOptions` and optional `configSchema` in its manifest). A likely typo or a value of the wrong type prints a warning, for example:
|
||||
|
||||
```
|
||||
⚠ @quartz-community/explorer: unknown option "folderDefaultStat" — did you mean "folderDefaultState"?
|
||||
⚠ @quartz-community/explorer: option "useSavedState" should be a boolean (default: true), got string "yes"
|
||||
```
|
||||
|
||||
The same warnings are printed at the start of `npx quartz build`, along with misspelled entry keys such as `enable:` instead of `enabled:`. They never stop the build.
|
||||
|
||||
### doctor
|
||||
|
||||
Check your plugin setup without changing anything:
|
||||
|
||||
```shell
|
||||
npx quartz plugin doctor
|
||||
npx quartz plugin doctor --verbose # also show informational notes
|
||||
npx quartz plugin doctor --fix # move settings of plugins that are now built into Quartz
|
||||
```
|
||||
|
||||
`doctor` reports, with a suggested fix for each problem:
|
||||
|
||||
- YAML syntax errors in `quartz.config.yaml`
|
||||
- misspelled or invalid entry keys (`enable:`, `option:`, `layout.positon`), non-boolean `enabled` values, and entries without `enabled` (treated as disabled)
|
||||
- unparseable sources and plugins configured twice
|
||||
- npm plugins that are not installed, and Git/local plugins that are not installed, not pinned in `quartz.lock.json`, checked out at a different commit than the lockfile pins, or whose source changed
|
||||
- broken local plugin symlinks and plugins without a built entry point (`dist/`)
|
||||
- option typos and type mismatches, and declared plugin dependencies that are missing or disabled
|
||||
- plugins that don't support your Quartz version (their `quartzVersion`, see [[versioning#Plugin compatibility]])
|
||||
- entries for plugins that are now [[built-in processing|built into Quartz]] (`crawl-links`, `remove-draft`, `content-index`); `--fix` moves their options into `configuration` (keeping your comments) and removes their now unused pins from `quartz.lock.json`
|
||||
- lockfile entries that are no longer configured (clean up with `prune`)
|
||||
|
||||
It exits with status 1 when it finds errors, so it can run as a CI check.
|
||||
|
||||
### prune
|
||||
|
||||
Remove installed plugins that are no longer referenced in your `quartz.config.yaml`. This is useful for cleaning up after removing plugin entries from your configuration.
|
||||
@@ -125,10 +184,20 @@ npx quartz plugin prune --dry-run
|
||||
|
||||
### Adding and Enabling a Plugin
|
||||
|
||||
To add a new plugin and start using it:
|
||||
`plugin add` installs the plugin and enables it right away (unless the plugin is disabled by default — the command then tells you how to enable it):
|
||||
|
||||
1. Add the plugin: `npx quartz plugin add github:quartz-community/example`
|
||||
2. Enable it: `npx quartz plugin enable example`
|
||||
```shell
|
||||
npx quartz plugin add github:quartz-community/example
|
||||
npx quartz plugin enable example # only needed for plugins that are disabled by default
|
||||
```
|
||||
|
||||
### Something is not working
|
||||
|
||||
Start with:
|
||||
|
||||
```shell
|
||||
npx quartz plugin doctor
|
||||
```
|
||||
|
||||
### Updating Everything
|
||||
|
||||
@@ -142,6 +211,9 @@ npx quartz plugin install --latest
|
||||
|
||||
By default, `plugin install` and `plugin add` clone, fetch, and build plugins in parallel across all your CPU cores. On memory-constrained machines (low-end laptops, Raspberry Pi, small VPS instances, restrictive CI runners) this can exhaust RAM or overwhelm the system because each worker may kick off its own `npm install` / `npm run build` at the same time.
|
||||
|
||||
> [!note]
|
||||
> Most community plugins now ship with a pre-built `dist/` directory. When Quartz finds this, it skips the installation and build steps entirely, making the process much faster and lighter on resources. This section is primarily relevant for plugins in development or those that don't provide pre-built distribution.
|
||||
|
||||
If `plugin install` fails, hangs, or OOMs on your machine, lower the concurrency with `--concurrency` / `-c`:
|
||||
|
||||
```shell
|
||||
@@ -208,7 +280,12 @@ For local plugin development or airgapped environments, you can add a plugin fro
|
||||
npx quartz plugin add ./my-local-plugin
|
||||
```
|
||||
|
||||
Local plugins are symlinked into `.quartz/plugins/`, so changes reflect immediately. When you run `install --latest`, local plugins are rebuilt (npm install + npm run build) without any git operations. The `install --latest --dry-run` command will show local plugins with a "local" status instead of checking for remote updates.
|
||||
Local plugins are symlinked into `.quartz/plugins/`, so changes reflect immediately. When you run `install --latest`, local plugins are rebuilt (npm install + npm run build) without any git operations.
|
||||
|
||||
> [!note]
|
||||
> Local symlinked plugins typically use this build-on-install fallback because the `dist/` directory is usually gitignored during development.
|
||||
|
||||
The `install --latest --dry-run` command will show local plugins with a "local" status instead of checking for remote updates.
|
||||
|
||||
To switch a local plugin back to a git source:
|
||||
|
||||
@@ -258,7 +335,6 @@ See [[configuration#Advanced Source Options|Advanced Source Options]] for the fu
|
||||
| `npx quartz plugin check` | `npx quartz plugin install --latest --dry-run` |
|
||||
| `npx quartz plugin resolve` | `npx quartz plugin install --from-config` |
|
||||
| `npx quartz plugin resolve --dry-run` | `npx quartz plugin install --from-config --dry-run` |
|
||||
| `npx quartz update` | `npx quartz plugin install --latest` |
|
||||
|
||||
The old commands still work as hidden aliases but will print a deprecation warning.
|
||||
|
||||
@@ -270,4 +346,4 @@ Running the plugin command without any subcommand shows a status dashboard of al
|
||||
npx quartz plugin
|
||||
```
|
||||
|
||||
This displays each plugin with its source, commit, enabled/disabled status, and checks for available updates in parallel. For the full interactive management interface, use [[tui|npx quartz tui]] instead.
|
||||
This displays each plugin with its source, commit (or npm version), enabled/disabled status, and checks Git plugins for available updates in parallel. npm plugins are updated together with Quartz (`npx quartz upgrade`). A misspelled subcommand (e.g. `npx quartz plugin lst`) is reported as an error with a suggestion instead of falling back to this dashboard. For the full interactive management interface, use [[tui|npx quartz tui]] instead.
|
||||
+7
-4
@@ -16,10 +16,13 @@ When you run `npx quartz upgrade`, Quartz performs the following steps:
|
||||
|
||||
1. **Backs up your content** — your content folder is cached locally to prevent data loss.
|
||||
2. **Pulls the latest Quartz code** — fetches and merges from the official upstream repository (`upstream/v5`) using Git.
|
||||
3. **Shows version changes** — displays the version transition (e.g., `v5.0.0 → v5.1.0`) or confirms you're already up to date.
|
||||
4. **Updates dependencies** — runs `npm install` to ensure all packages match the new version.
|
||||
5. **Restores plugins** — reinstalls plugins from `quartz.lock.json` to ensure compatibility.
|
||||
6. **Checks plugin compatibility** — verifies that installed plugins are compatible with the new Quartz version.
|
||||
3. **Updates dependencies** — runs `npm install` to ensure all packages match the new version.
|
||||
4. **Shows what changed** — the version transition (e.g. `5.0.0 → 5.1.0`) and the release notes of every version in between, from `CHANGELOG.md`. Between releases it says how many commits were pulled.
|
||||
5. **Restores plugins** — reinstalls plugins from `quartz.lock.json`. Plugins that are now [[built-in processing|built into Quartz]] are skipped.
|
||||
6. **Checks your config and plugins** — runs [[cli/plugin#doctor|`npx quartz plugin doctor`]] for the new version: plugin entries that are built in now (fix with `npx quartz plugin doctor --fix`), plugins that don't support the new Quartz version, lockfile and install problems.
|
||||
7. **Checks for plugin updates** — lists plugins with newer versions available.
|
||||
|
||||
Steps 4–7 run the code of the version you upgraded _to_, so the checks know about that version's changes. (Upgrading _from_ a Quartz older than 5.1 still runs the older steps once.)
|
||||
|
||||
## Handling Conflicts
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ Custom themes, CSS snippets, and starter templates for Quartz sites.
|
||||
<!-- Add templates/themes here -->
|
||||
<!-- Format: - **[Name](link)** — Brief description -->
|
||||
|
||||
_No community templates listed yet._
|
||||
- **[Field Notes](https://github.com/oswarren/quartz-field-notes)** — A warm, single-column reading theme with book margins, a designed dark mode, and a one-command installer that can restore your original files.
|
||||
|
||||
## Guides & Tutorials
|
||||
|
||||
|
||||
+41
-3
@@ -31,9 +31,9 @@ This part of the configuration concerns anything that can affect the whole site.
|
||||
- `null`: don't use analytics;
|
||||
- `{ provider: 'google', tagId: '<your-google-tag>' }`: use Google Analytics;
|
||||
- `{ provider: 'plausible' }` (managed) or `{ provider: 'plausible', host: 'https://<your-plausible-host>' }` (self-hosted, make sure to include the `https://` protocol prefix): use [Plausible](https://plausible.io/);
|
||||
- `{ provider: 'umami', host: '<your-umami-host>', websiteId: '<your-umami-website-id>' }`: use [Umami](https://umami.is/);
|
||||
- `{ provider: 'umami', host: '<your-umami-host>', websiteId: '<your-umami-website-id>', script: '<your-script-name.js>' }`: use [Umami](https://umami.is/);
|
||||
- `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id' }` (managed) or `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id', host: 'my-goatcounter-domain.com', scriptSrc: 'https://my-url.to/counter.js' }` (self-hosted) use [GoatCounter](https://goatcounter.com);
|
||||
- `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>', host: '<your-posthog-host>' }`: use [Posthog](https://posthog.com/);
|
||||
- `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>' }` (managed) or `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>', apiHost: '<your-posthog-api-host>', uiHost: '<your-posthog-ui-host>', personProfiles: 'identified_only' }` (self-hosted/reverse proxy): use [PostHog](https://posthog.com/). `uiHost` is required when `apiHost` is a reverse proxy. The legacy `host` option is an alias for `apiHost`;
|
||||
- `{ provider: 'tinylytics', siteId: '<your-site-id>' }`: use [Tinylytics](https://tinylytics.app/);
|
||||
- `{ provider: 'cabin' }` or `{ provider: 'cabin', host: 'https://cabin.example.com' }` (custom domain): use [Cabin](https://withcabin.com);
|
||||
- `{provider: 'clarity', projectId: '<your-clarity-id-code' }`: use [Microsoft clarity](https://clarity.microsoft.com/). The project id can be found on top of the overview page.
|
||||
@@ -45,8 +45,24 @@ This part of the configuration concerns anything that can affect the whole site.
|
||||
- You will be prompted to set this during [[create|`npx quartz create`]]. The CLI automatically strips any `https://` or `http://` protocol prefixes and trailing slashes for you.
|
||||
- This should also include the subpath if you are [[hosting]] on GitHub pages without a custom domain. For example, if my repository is `jackyzha0/quartz`, GitHub pages would deploy to `https://jackyzha0.github.io/quartz` and the `baseUrl` would be `jackyzha0.github.io/quartz`.
|
||||
- Note that Quartz 5 will avoid using this as much as possible and use relative URLs whenever it can to make sure your site works no matter _where_ you end up actually deploying it.
|
||||
- `publishAssets`: which non-Markdown files (images, PDFs, …) from `content` are copied to the site.
|
||||
- `"all"` (default): every file that isn't ignored.
|
||||
- `"referenced"`: only files a published page links to or embeds. Use this with [[ExplicitPublish]] or [[private pages|drafts]], so that files only unpublished notes use stay private.
|
||||
- `ignorePatterns`: a list of [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>) patterns that Quartz should ignore and not search through when looking for files inside the `content` folder. See [[private pages]] for more details.
|
||||
- `theme`: configure how the site looks.
|
||||
- `fontOrigin`: where to load fonts from.
|
||||
- `"googleFonts"` (default): loads fonts from Google Fonts API. Fastest option, especially with CDN caching enabled.
|
||||
- `"local"`: Quartz loads no fonts at all; you provide them. The `typography` names are still used as the font families, so declare matching `@font-face` rules in `quartz/styles/custom.scss` and put the font files in `quartz/static/fonts/` (served at `static/fonts/`):
|
||||
|
||||
```scss title="quartz/styles/custom.scss"
|
||||
@font-face {
|
||||
font-family: "Inter";
|
||||
src: url("static/fonts/Inter.woff2") format("woff2");
|
||||
font-display: swap;
|
||||
}
|
||||
```
|
||||
|
||||
Use a path relative to the site root like above (no leading `/`) so it also works when the site is served from a subpath. To have Quartz download Google Fonts at build time and serve them from your site instead, use the [[plugins/Fonts|Fonts]] plugin with `fontOrigin: selfHosted`.
|
||||
- `cdnCaching`: if `true` (default), use Google CDN to cache the fonts. This will generally be faster. Disable (`false`) this if you want Quartz to download the fonts to be self-contained.
|
||||
- `typography`: what fonts to use. Any font available on [Google Fonts](https://fonts.google.com/) works here.
|
||||
- `title`: font for the title of the site (optional, same as `header` by default)
|
||||
@@ -63,6 +79,19 @@ This part of the configuration concerns anything that can affect the whole site.
|
||||
- `tertiary`: hover states and visited [[graph view|graph]] nodes
|
||||
- `highlight`: internal link background, highlighted text, [[syntax highlighting|highlighted lines of code]]
|
||||
- `textHighlight`: markdown highlighted text background
|
||||
- `frontmatter`, `links`, `drafts`, `contentIndex`: options for Quartz's [[built-in processing]] — frontmatter parsing ([[Frontmatter]]), link resolution ([[CrawlLinks]]), draft handling ([[RemoveDrafts]]) and the content index, sitemap and RSS feed ([[ContentIndex]]). They are on by default; set e.g. `links: { markdownLinkResolution: relative }` to change an option or `contentIndex: false` to turn one off.
|
||||
|
||||
> [!note] Colors with an Obsidian theme
|
||||
> A theme from [quartz-themes](https://github.com/saberzero1/quartz-themes) (the Obsidian and TTRPG [[create#Templates|templates]] enable one) brings its own color scheme and colors the page through Obsidian's CSS variables (`--text-normal` for most text, `--text-muted` for paragraphs, `--background-primary`, `--interactive-accent`, …). The `colors` above then have little or no effect. To change a theme's colors, override its variables in `quartz/styles/custom.scss`:
|
||||
>
|
||||
> ```scss title="quartz/styles/custom.scss"
|
||||
> html[saved-theme="dark"] body {
|
||||
> --text-normal: #e0e0e0;
|
||||
> --text-muted: #a0a0a0;
|
||||
> }
|
||||
> ```
|
||||
>
|
||||
> (use `html[saved-theme="light"] body` for light mode), or disable the theme to use the `colors` above.
|
||||
|
||||
## Plugins
|
||||
|
||||
@@ -239,6 +268,7 @@ plugins:
|
||||
> Some plugin options require JavaScript callback functions (e.g. custom sort, filter, or map functions) that can't be expressed in YAML. For these, use the TS override in `quartz.ts`:
|
||||
>
|
||||
> ```ts title="quartz.ts"
|
||||
> import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
> import * as ExternalPlugin from "./.quartz/plugins"
|
||||
>
|
||||
> ExternalPlugin.Explorer({
|
||||
@@ -247,9 +277,13 @@ plugins:
|
||||
> return node
|
||||
> },
|
||||
> })
|
||||
>
|
||||
> const config = await loadQuartzConfig()
|
||||
> export default config
|
||||
> export const layout = await loadQuartzLayout()
|
||||
> ```
|
||||
>
|
||||
> Options set in `quartz.ts` are merged with YAML options and take precedence. See the plugin-specific documentation for available callback options.
|
||||
> Options set in `quartz.ts` are merged with YAML options and take precedence. Plugin overrides must be placed **before** `loadQuartzConfig()` so they are applied when components are instantiated during config loading. See the plugin-specific documentation for available callback options.
|
||||
|
||||
You can see a list of all plugins and their configuration options [[tags/plugin|here]].
|
||||
|
||||
@@ -263,6 +297,7 @@ Fonts can be specified as a simple string or with advanced options in `quartz.co
|
||||
configuration:
|
||||
theme:
|
||||
typography:
|
||||
title: Schibsted Grotesk # optional, defaults to header font
|
||||
header: Schibsted Grotesk
|
||||
body: Source Sans Pro
|
||||
code: IBM Plex Mono
|
||||
@@ -289,3 +324,6 @@ const config = await loadQuartzConfig({
|
||||
export default config
|
||||
export const layout = await loadQuartzLayout()
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> For per-heading font control, self-hosted fonts, or Obsidian theme font bridging, see the [[plugins/Fonts|Fonts]] plugin. It can download Google Fonts at build time and serve them locally with `fontOrigin: selfHosted`, making your site fully self-contained.
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: Customizing Components
|
||||
---
|
||||
|
||||
In Quartz v4, components such as the footer lived in `quartz/components/` and you customized them by editing their source. In v5, most components are [[configuration#Plugins|community plugins]]: Quartz installs them into `.quartz/plugins/` and runs their **built** code (`dist/`). Editing the files in `.quartz/plugins/` therefore has no effect, and is overwritten the next time the plugin is installed or updated.
|
||||
|
||||
There are four ways to change a component, from least to most effort. Try them in this order.
|
||||
|
||||
## 1. Options
|
||||
|
||||
Most components have options; each plugin's page under [[plugins/index|Plugins]] lists them. Set them in `quartz.config.yaml`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/footer
|
||||
enabled: true
|
||||
options:
|
||||
message: 'Licensed under <a href="/license">CC BY 4.0</a>'
|
||||
links:
|
||||
GitHub: https://github.com/you/your-site
|
||||
```
|
||||
|
||||
or from the command line with `npx quartz plugin config footer --set message="Hello"` (see [[cli/plugin|plugin]]).
|
||||
|
||||
## 2. Placement
|
||||
|
||||
Where a component appears, in which order, on which page types and screen sizes is part of the layout, not the component: `layout.position`, `layout.priority` and `layout.display` per plugin, and `layout.byPageType` to drop or move components on some page types. See [[layout]] and [[layout-components]].
|
||||
|
||||
## 3. Styles
|
||||
|
||||
Write your own styles in `quartz/styles/custom.scss`. The styles of Quartz, its plugins and themes are in [CSS cascade layers](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) and `custom.scss` is not, so your rules take precedence over theirs whatever their specificity. Find the element's classes with your browser's developer tools, then for example:
|
||||
|
||||
```scss title="quartz/styles/custom.scss"
|
||||
footer {
|
||||
opacity: 1;
|
||||
text-align: center;
|
||||
|
||||
& ul {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For site-wide colors and fonts, use the [[configuration#General Configuration|theme options]] first.
|
||||
|
||||
## 4. Your own copy of the plugin
|
||||
|
||||
When options and CSS are not enough (you want different markup or behavior), make your own copy of the plugin and use that instead:
|
||||
|
||||
1. Copy the plugin's repository (fork it on GitHub, or clone it) into a directory **outside** `.quartz/`, e.g. next to your site: `git clone https://github.com/quartz-community/footer.git ../my-footer`.
|
||||
2. Change its source (for the footer, `src/components/Footer.tsx`) and build it: `npm install && npm run build` in that directory.
|
||||
3. Replace the plugin in your site with your copy:
|
||||
|
||||
```shell
|
||||
npx quartz plugin remove footer
|
||||
npx quartz plugin add ../my-footer
|
||||
```
|
||||
|
||||
Local plugins are symlinked into `.quartz/plugins/`. After further changes, run `npm run build` in your copy again (or `npx quartz plugin install --latest`, which rebuilds local plugins) and rebuild the site.
|
||||
|
||||
If you forked on GitHub, you can instead push your changes and add the fork with `npx quartz plugin add github:you/my-footer`, so your site builds in CI too. Note that a local path only works on machines that have that directory.
|
||||
|
||||
If you think others would want your change, consider opening a pull request against the original plugin, perhaps as a new option. To write a component from scratch, see [[creating components]].
|
||||
@@ -4,7 +4,7 @@ tags:
|
||||
- component
|
||||
---
|
||||
|
||||
Quartz supports rendering [Obsidian Bases](https://obsidian.md/changelog/2025-04-15-desktop-v1.8.0/) (`.base` files) as interactive database-like views. Bases files define queries over your vault's notes and display the results in configurable views such as tables, lists, cards, galleries, and boards.
|
||||
Quartz supports rendering [Obsidian Bases](https://obsidian.md/help/bases) (`.base` files) as interactive database-like views. Bases files define queries over your vault's notes and display the results in configurable views such as tables, lists, cards, galleries, and boards.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
@@ -59,14 +59,9 @@ Similarly, inline math can be rendered by delimiting math expression with a sing
|
||||
|
||||
### Escaping symbols
|
||||
|
||||
There will be cases where you may have more than one `$` in a paragraph at once which may accidentally trigger MathJax/Katex.
|
||||
With [[ObsidianFlavoredMarkdown]], dollar signs follow Obsidian's rules: a `$` followed by a space or a digit after the closing `$` doesn't start or end math, so prices like `I have $1 and you have $2` stay text, as in Obsidian.
|
||||
|
||||
To get around this, you can escape the dollar sign by doing `\$` instead.
|
||||
|
||||
For example:
|
||||
|
||||
- Incorrect: `I have $1 and you have $2` produces I have $1 and you have $2
|
||||
- Correct: `I have \$1 and you have \$2` produces I have \$1 and you have \$2
|
||||
If a pair of `$` would still be read as math where you don't want it (for example `$a and b$`), escape the dollar sign as `\$`: `\$a and b\$` produces \$a and b\$.
|
||||
|
||||
### Using mhchem
|
||||
|
||||
|
||||
@@ -4,13 +4,23 @@ tags:
|
||||
- feature/transformer
|
||||
---
|
||||
|
||||
Quartz supports Mermaid which allows you to add diagrams and charts to your notes. Mermaid supports a range of diagrams, such as [flow charts](https://mermaid.js.org/syntax/flowchart.html), [sequence diagrams](https://mermaid.js.org/syntax/sequenceDiagram.html), and [timelines](https://mermaid.js.org/syntax/timeline.html). This is enabled as a part of [[Obsidian compatibility]] and can be configured and enabled/disabled from that plugin.
|
||||
Quartz supports [Mermaid](https://mermaid.js.org) for diagrams and charts in your notes (flow charts, sequence diagrams, timelines, and so on). This is part of [[Obsidian compatibility]] and can be turned on or off on that plugin.
|
||||
|
||||
By default, Quartz will render Mermaid diagrams to match the site theme.
|
||||
Default renderer is Mermaid.js. Set `diagramRenderer: pele` on [[ObsidianFlavoredMarkdown]] to use [Pele](https://pele.run) instead. Mermaid.js is deprecated; Pele will become the default later.
|
||||
|
||||
> [!warning]
|
||||
> Wondering why Mermaid diagrams may not be showing up even if you have them enabled? You may need to reorder your plugins so that [[ObsidianFlavoredMarkdown]] is _after_ [[SyntaxHighlighting]].
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/obsidian-flavored-markdown
|
||||
options:
|
||||
mermaid: true
|
||||
diagramRenderer: pele # default: mermaid
|
||||
```
|
||||
|
||||
Both renderers only load on pages that contain a Mermaid diagram. Pele is served from your own site (Quartz 5.1+) and only downloads the code for the diagram types on the page; on older Quartz versions it is loaded from jsDelivr. Mermaid.js is always loaded from a CDN.
|
||||
|
||||
## Syntax
|
||||
|
||||
To add a Mermaid diagram, create a mermaid code block.
|
||||
|
||||
@@ -8,9 +8,9 @@ Quartz was originally designed as a tool to publish Obsidian vaults as websites.
|
||||
|
||||
By default, Quartz ships with the [[ObsidianFlavoredMarkdown]] plugin, which is a transformer plugin that adds support for [Obsidian Flavored Markdown](https://help.obsidian.md/Editing+and+formatting/Obsidian+Flavored+Markdown). This includes support for features like [[wikilinks]] and [[Mermaid diagrams]].
|
||||
|
||||
It also ships with support for [frontmatter parsing](https://help.obsidian.md/Editing+and+formatting/Properties) with the same fields that Obsidian uses through the [[Frontmatter]] transformer plugin.
|
||||
It also ships with support for [frontmatter parsing](https://help.obsidian.md/Editing+and+formatting/Properties) with the same fields that Obsidian uses through its built-in [[Frontmatter]] transformer plugin.
|
||||
|
||||
Finally, Quartz also provides [[CrawlLinks]] plugin, which allows you to customize Quartz's link resolution behaviour to match Obsidian.
|
||||
Finally, Quartz's built-in [[CrawlLinks|link processing]] (`configuration.links`) lets you customize link resolution to match Obsidian.
|
||||
|
||||
## Supported Features
|
||||
|
||||
@@ -123,7 +123,7 @@ Each custom character is preserved as a `data-task` attribute on the rendered el
|
||||
|
||||
### Mermaid Diagrams
|
||||
|
||||
[[Mermaid diagrams|Mermaid]] code blocks are rendered as diagrams:
|
||||
[[Mermaid diagrams|Mermaid]] code blocks render as diagrams. Default is Mermaid.js; set `diagramRenderer: pele` for [Pele](https://pele.run):
|
||||
|
||||
````markdown
|
||||
```mermaid
|
||||
@@ -194,6 +194,30 @@ Video files can be embedded using standard image syntax:
|
||||
|
||||
By default, Obsidian does not render its Markdown syntax inside HTML blocks. Quartz extends this with the `enableInHtmlEmbed` option, which parses wikilinks, highlights, and tags inside raw HTML nodes.
|
||||
|
||||
### Footnotes
|
||||
|
||||
Footnotes using the `[^1]` syntax are fully supported through the [[GitHubFlavoredMarkdown]] plugin:
|
||||
|
||||
```markdown
|
||||
Here is a sentence with a footnote.[^1]
|
||||
|
||||
[^1]: This is the footnote content.
|
||||
```
|
||||
|
||||
## Obsidian Community Plugin Support
|
||||
|
||||
Quartz focuses on supporting Obsidian's core features. Functionality from Obsidian community plugins is handled by Quartz community plugins:
|
||||
|
||||
| Obsidian Plugin | Quartz Support |
|
||||
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Dataview | Supported via [Quartz Syncer](https://community.obsidian.md/plugins/quartz-syncer) — exports Dataview queries as static content during sync |
|
||||
| Excalidraw | Supported via the `obsidian-plugin-excalidraw` community plugin |
|
||||
| Leaflet Maps | Supported via the `obsidian-plugin-leaflet` community plugin |
|
||||
| Style Settings | Supported via the `quartz-themes` community plugin |
|
||||
|
||||
> [!tip]
|
||||
> As a general rule: Obsidian core features are supported by Quartz directly, while Obsidian community plugin features are supported by corresponding Quartz community plugins. Not all Obsidian community plugins will have Quartz equivalents, but popular ones are likely to be supported by the community.
|
||||
|
||||
## Configuration
|
||||
|
||||
This functionality is provided by the [[ObsidianFlavoredMarkdown]], [[Frontmatter]] and [[CrawlLinks]] plugins. See the plugin pages for customization options.
|
||||
This functionality is provided by the [[ObsidianFlavoredMarkdown]] plugin and Quartz's built-in [[Frontmatter|frontmatter parsing]] and [[CrawlLinks|link processing]]. See those pages for customization options.
|
||||
@@ -27,18 +27,13 @@ plugins:
|
||||
order: 5
|
||||
```
|
||||
|
||||
For the TS override approach:
|
||||
For the TS override approach, place overrides before `loadQuartzConfig()` in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
plugins: {
|
||||
transformers: [
|
||||
ExternalPlugin.FrontMatter({ delims: "+++", language: "toml" }),
|
||||
// ...
|
||||
ExternalPlugin.OxHugoFlavouredMarkdown(),
|
||||
ExternalPlugin.GitHubFlavoredMarkdown(),
|
||||
// ...
|
||||
],
|
||||
}
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
ExternalPlugin.NoteProperties({ delims: "+++", language: "toml" })
|
||||
ExternalPlugin.OxHugoFlavouredMarkdown()
|
||||
```
|
||||
|
||||
> [!note]
|
||||
|
||||
@@ -3,8 +3,8 @@ Quartz emits an RSS feed for all the content on your site by generating an `inde
|
||||
> [!info]
|
||||
> After deploying, the generated RSS link will be available at `https://${baseUrl}/index.xml` by default.
|
||||
>
|
||||
> The `index.xml` path can be customized by passing the `rssSlug` option to the [[ContentIndex]] plugin.
|
||||
> The `index.xml` path can be customized with `configuration.contentIndex.rssSlug` (see [[ContentIndex]]).
|
||||
|
||||
## Configuration
|
||||
|
||||
This functionality is provided by the [[ContentIndex]] plugin. See the plugin page for customization options.
|
||||
This functionality is [[built-in processing|built into Quartz]]. See [[ContentIndex]] for customization options.
|
||||
@@ -19,17 +19,12 @@ plugins:
|
||||
order: 30
|
||||
```
|
||||
|
||||
For the TS override approach:
|
||||
For the TS override approach, place overrides before `loadQuartzConfig()` in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
plugins: {
|
||||
transformers: [
|
||||
// ...
|
||||
ExternalPlugin.RoamFlavoredMarkdown(),
|
||||
ExternalPlugin.ObsidianFlavoredMarkdown(),
|
||||
// ...
|
||||
],
|
||||
}
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
ExternalPlugin.RoamFlavoredMarkdown()
|
||||
```
|
||||
|
||||
> [!warning]
|
||||
|
||||
@@ -34,6 +34,7 @@ plugins:
|
||||
For the TS override approach:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.Breadcrumbs({
|
||||
spacerSymbol: "❯",
|
||||
rootName: "Home",
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
title: Built-in processing
|
||||
description: Frontmatter parsing, link resolution, drafts and the content index are part of Quartz itself.
|
||||
tags:
|
||||
- feature
|
||||
---
|
||||
|
||||
Some processing steps are needed by every Quartz site. They are built into Quartz instead of being plugins, so they cannot be removed by accident or run in the wrong order:
|
||||
|
||||
| Built-in | Configure under | What it does | Formerly |
|
||||
| ------------------------------ | ---------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------- |
|
||||
| [[Frontmatter\|frontmatter]] | `configuration.frontmatter` | Parses frontmatter: titles, tags, aliases, dates, `draft`, `permalink`, … | the parsing half of `note-properties` |
|
||||
| [[CrawlLinks\|links]] | `configuration.links` | Makes internal links relative, classifies links, records outgoing links for backlinks and graph | `crawl-links` |
|
||||
| [[RemoveDrafts\|drafts]] | `configuration.drafts` | Does not publish pages with `draft: true` | `remove-draft` |
|
||||
| [[ContentIndex\|contentIndex]] | `configuration.contentIndex` | Emits `static/contentIndex.json` (search, explorer, graph, …), `sitemap.xml` and the RSS feed | `content-index` |
|
||||
|
||||
Without them a site would silently break: pages titled "Untitled", links that 404 on nested pages, empty backlinks and graph, drafts published, no search.
|
||||
|
||||
## Configuration
|
||||
|
||||
All built-ins are on by default. Options go under their key in the `configuration` section of `quartz.config.yaml`:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
pageTitle: My garden
|
||||
frontmatter:
|
||||
language: yaml # or toml
|
||||
delimiters: "---"
|
||||
links:
|
||||
markdownLinkResolution: shortest # absolute | relative | shortest
|
||||
prettyLinks: true
|
||||
openLinksInNewTab: false
|
||||
lazyLoad: false
|
||||
externalLinkIcon: true
|
||||
disableBrokenWikilinks: false
|
||||
drafts:
|
||||
publish: false # true = publish drafts anyway (e.g. preview deployments)
|
||||
contentIndex:
|
||||
enableSiteMap: true
|
||||
enableRSS: true
|
||||
rssLimit: 10
|
||||
rssFullHtml: false
|
||||
rssSlug: index
|
||||
includeEmptyFiles: true
|
||||
```
|
||||
|
||||
Each built-in also accepts:
|
||||
|
||||
- `enabled: false` (or the shorthand `links: false`) to turn it off;
|
||||
- `order` to change where it runs relative to plugins of the same kind (frontmatter runs at `0`, links at `60`, the same scale as plugin `order`).
|
||||
|
||||
See the individual pages for every option: [[Frontmatter]], [[CrawlLinks]], [[RemoveDrafts]], [[ContentIndex]].
|
||||
|
||||
## Replacing a built-in
|
||||
|
||||
A plugin can take over a built-in by declaring that it provides the same thing in its [[plugin capabilities|capabilities]] (`package.json` → `quartz.capabilities.provides`):
|
||||
|
||||
| Built-in | Replaced by a plugin that provides |
|
||||
| ------------ | ------------------------------------- |
|
||||
| frontmatter | `data: ["frontmatter"]` |
|
||||
| links | `data: ["links"]` |
|
||||
| contentIndex | `files: ["static/contentIndex.json"]` |
|
||||
|
||||
When such a plugin is enabled, the built-in steps aside (`quartz build --verbose` shows `off — replaced by plugin "…"`). Set `enabled: true` on the built-in to run both.
|
||||
|
||||
## Upgrading from the plugins
|
||||
|
||||
Existing `quartz.config.yaml` files keep working: entries for `@quartz-community/crawl-links`, `@quartz-community/remove-draft` and `@quartz-community/content-index` are applied to the matching built-in (options, `order` and `enabled: false` carry over) and the packages are no longer loaded. The build prints a notice for each.
|
||||
|
||||
To update the file, run:
|
||||
|
||||
```shell
|
||||
npx quartz plugin doctor --fix
|
||||
```
|
||||
|
||||
It moves the options into `configuration`, removes the old entries, and moves note-properties' `delimiters`/`language` options to `configuration.frontmatter`. Comments elsewhere in the file are kept.
|
||||
|
||||
> [!note]
|
||||
> `crawl-links` defaulted to `markdownLinkResolution: absolute`; the built-in defaults to `shortest` (Obsidian's default). Migrated entries keep `absolute` unless you set something else.
|
||||
|
||||
The [[Frontmatter#Properties panel|properties panel]] is still a plugin (`note-properties`) — it now only renders the panel.
|
||||
|
||||
## For plugin authors
|
||||
|
||||
- The data the built-ins produce is unchanged: `file.data.frontmatter`, `aliases`, `frontmatterLinks`, `links`, and the same `contentIndex.json` format. Plugins that read them need no changes.
|
||||
- Built-ins count as providers for [[plugin capabilities]], so a requirement such as `requires: { data: ["links"] }` is satisfied without any plugin.
|
||||
- Plugins can add their own fields to `contentIndex.json` — see [[making plugins#Extending the content index]].
|
||||
@@ -37,7 +37,7 @@ Display names for folders get determined by the `title` frontmatter field in `fo
|
||||
> [!info]
|
||||
> The explorer uses local storage by default to save the state of your explorer. This is done to ensure a smooth experience when navigating to different pages.
|
||||
>
|
||||
> To clear/delete the explorer state from local storage, delete the `fileTree` entry (guide on how to delete a key from local storage in chromium based browsers can be found [here](https://docs.devolutions.net/kb/general-knowledge-base/clear-browser-local-storage/clear-chrome-local-storage/)). You can disable this by passing `useSavedState: false` as an argument.
|
||||
> To clear/delete the explorer state from local storage, delete the `fileTree` entry (guide on how to delete a key from local storage in chromium based browsers can be found [here](https://developer.chrome.com/docs/devtools/storage/localstorage)). You can disable this by passing `useSavedState: false` as an argument.
|
||||
|
||||
## Customization
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ To search content by tags, you can either press `⌘`/`ctrl` + `shift` + `K` or
|
||||
This component is also keyboard accessible: Tab and Shift+Tab will cycle forward and backward through search results and Enter will navigate to the highlighted result (first result by default). You are also able to navigate search results using `ArrowUp` and `ArrowDown`.
|
||||
|
||||
> [!info]
|
||||
> Search requires the `ContentIndex` emitter plugin to be present in the [[configuration]].
|
||||
> Search reads `contentIndex.json`, which Quartz emits by default (see [[ContentIndex]]). It has no data if `configuration.contentIndex` is disabled.
|
||||
|
||||
### Indexing Behaviour
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ By default, the node radius is proportional to the total number of incoming and
|
||||
Additionally, similar to how browsers highlight visited links a different colour, the graph view will also show nodes that you have visited in a different colour.
|
||||
|
||||
> [!info]
|
||||
> Graph View requires the `ContentIndex` emitter plugin to be present in the [[configuration]].
|
||||
> Graph View reads `contentIndex.json`, which Quartz emits by default (see [[ContentIndex]]). It is empty if `configuration.contentIndex` is disabled.
|
||||
|
||||
## Customization
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Quartz comes with a wide variety of features out of the box. Most features are p
|
||||
- [[wikilinks]] — Link between notes using `[[wikilinks]]` syntax
|
||||
- [[callouts]] — Obsidian-style callout blocks
|
||||
- [[features/Latex|Latex]] — LaTeX math rendering
|
||||
- [[Mermaid diagrams]] — Diagram support via Mermaid
|
||||
- [[Mermaid diagrams]] — Mermaid fences (Mermaid.js default, Pele via `diagramRenderer`)
|
||||
- [[syntax highlighting|Syntax highlighting]] — Code block highlighting with themes
|
||||
- [[OxHugo compatibility]] — Support for ox-hugo Markdown
|
||||
- [[Roam Research compatibility]] — Support for Roam Research syntax
|
||||
|
||||
@@ -8,12 +8,12 @@ There may be some notes you want to avoid publishing as a website. Quartz suppor
|
||||
|
||||
## Filter Plugins
|
||||
|
||||
[[making plugins#Filters|Filter plugins]] are plugins that filter out content based off of certain criteria. By default, Quartz uses the [[RemoveDrafts]] plugin which filters out any note that has `draft: true` in the frontmatter.
|
||||
[[making plugins#Filters|Filter plugins]] are plugins that filter out content based off of certain criteria. By default, Quartz's built-in [[RemoveDrafts|draft handling]] filters out any note that has `draft: true` in the frontmatter.
|
||||
|
||||
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.
|
||||
|
||||
> [!warning]
|
||||
> Regardless of the filter plugin used, **all non-markdown files will be emitted and available publically in the final build.** This includes files such as images, voice recordings, PDFs, etc.
|
||||
> 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.
|
||||
|
||||
## `ignorePatterns`
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Wikilinks
|
||||
|
||||
Wikilinks were pioneered by earlier internet wikis to make it easier to write links across pages without needing to write Markdown or HTML links each time.
|
||||
|
||||
Quartz supports Wikilinks by default and these links are resolved by Quartz using the [[CrawlLinks]] plugin. See the [Obsidian Help page on Internal Links](https://help.obsidian.md/Linking+notes+and+files/Internal+links) for more information on Wikilink syntax.
|
||||
Quartz supports Wikilinks by default and these links are resolved by Quartz's built-in [[CrawlLinks|link processing]]. See the [Obsidian Help page on Internal Links](https://help.obsidian.md/Linking+notes+and+files/Internal+links) for more information on Wikilink syntax.
|
||||
|
||||
This is enabled as a part of [[Obsidian compatibility]] and can be configured and enabled/disabled from that plugin.
|
||||
|
||||
@@ -21,6 +21,26 @@ Wikilink matching is case-insensitive to mirror Obsidian: `[[My Note]]`, `[[my n
|
||||
|
||||
- `![[Path to image]]`: embeds an image into the page
|
||||
- `![[Path to image|100x145]]`: embeds an image into the page with dimensions 100px by 145px
|
||||
- `![[Path to image|Alt text|300]]`: embeds an image with alt text and a width of 300px. Markdown images take a size the same way: ``
|
||||
- `![[Path to file]]`: transclude an entire page
|
||||
- `![[Path to file#Anchor]]`: transclude everything under the header `Anchor`
|
||||
- `![[Path to file#^b15695]]`: transclude block with ID `^b15695`
|
||||
|
||||
### Styling individual images
|
||||
|
||||
The text between `|`s that isn't a size becomes the image's alt text: `![[diagram.png|invert center|300]]` gives `<img alt="invert center" width="300">` (likewise ``). SVG files are embedded as `<object>` and get it as `aria-label`. You can use words in the alt text as flags for styles in `quartz/styles/custom.scss`, for example to invert diagrams in dark mode and to center images:
|
||||
|
||||
```scss title="quartz/styles/custom.scss"
|
||||
// ![[diagram.png|invert]]: invert colors in dark mode (hue-rotate keeps hues roughly the same)
|
||||
html[saved-theme="dark"] :is(img[alt~="invert"], object[aria-label~="invert"]) {
|
||||
filter: invert(1) hue-rotate(180deg);
|
||||
}
|
||||
|
||||
// ![[photo.png|center]] or ![[photo.png|center|300]]: center the image
|
||||
:is(img[alt~="center"], object[aria-label~="center"]) {
|
||||
display: block;
|
||||
margin-inline: auto;
|
||||
}
|
||||
```
|
||||
|
||||
`~=` matches one word of the alt text, so flags combine (`|invert center|`), and an alt text such as `|Network diagram invert|` still describes the image for screen readers.
|
||||
@@ -4,11 +4,11 @@ aliases:
|
||||
- "authoring content"
|
||||
---
|
||||
|
||||
All of the content in your Quartz should go in the `/content` folder. The content for the home page of your Quartz lives in `content/index.md`. If you've [[index#🪴 Get Started|setup Quartz]] already, this folder should already be initialized. Any Markdown in this folder will get processed by Quartz.
|
||||
All of the content in your Quartz should go in the `/content` folder. The content for the home page of your Quartz lives in `content/index.md`. If you've followed the [[installation|installation guide]], this folder should already be initialized. Any Markdown in this folder will get processed by Quartz.
|
||||
|
||||
It is recommended that you use [Obsidian](https://obsidian.md/) as a way to edit and maintain your Quartz. It comes with a nice editor and graphical interface to preview, edit, and link your local files and attachments.
|
||||
|
||||
Got everything setup? Let's [[build]] and preview your Quartz locally!
|
||||
Got everything set up? Preview your site locally with `npx quartz build --serve`, or see the [[build|build reference]] for more options.
|
||||
|
||||
## Syntax
|
||||
|
||||
@@ -31,8 +31,8 @@ Some common frontmatter fields that are natively supported by Quartz:
|
||||
|
||||
- `title`: Title of the page. If it isn't provided, Quartz will use the name of the file as the title.
|
||||
- `description`: Description of the page used for link previews.
|
||||
- `permalink`: A custom URL for the page that will remain constant even if the path to the file changes.
|
||||
- `aliases`: Other names for this note. This is a list of strings.
|
||||
- `permalink`: The page's address on the site, as in Obsidian Publish: `note.md` with `permalink: page` is published at `/page`, whatever its folder or file name. Links to the note (`[[note]]`) point there, and its file path redirects to it. A permalink that is already another page's address is ignored with a warning.
|
||||
- `aliases`: Other addresses for this note that redirect to it (with the [[AliasRedirects]] plugin), so old links and links from other sites keep working after a note is renamed or moved. This is a list of strings.
|
||||
- `tags`: Tags for this note.
|
||||
- `draft`: Whether to publish the page or not. This is one way to make [[private pages|pages private]] in Quartz.
|
||||
- `date`: A string representing the day the note was published. Normally uses `YYYY-MM-DD` format.
|
||||
@@ -42,8 +42,8 @@ See [[Frontmatter]] for a complete list of frontmatter.
|
||||
## Syncing your Content
|
||||
|
||||
When your Quartz is at a point you're happy with, you can save your changes to GitHub.
|
||||
First, make sure you've [[installation|already setup your GitHub repository]] and then do `npx quartz sync`.
|
||||
First, make sure you've [[installation#Setting Up Your GitHub Repository|set up your GitHub repository]] and then run `npx quartz sync`.
|
||||
|
||||
## Customization
|
||||
|
||||
Frontmatter parsing for `title`, `tags`, `aliases` and `cssclasses` is a functionality of the [[Frontmatter]] plugin, `date` is handled by the [[CreatedModifiedDate]] plugin and `description` by the [[Description]] plugin. See the plugin pages for customization options.
|
||||
Frontmatter parsing for `title`, `tags`, `aliases` and `cssclasses` is built into Quartz (see [[Frontmatter]]), `date` is handled by the [[CreatedModifiedDate]] plugin and `description` by the [[Description]] plugin. See the plugin pages for customization options.
|
||||
@@ -2,16 +2,36 @@
|
||||
title: Getting Started
|
||||
---
|
||||
|
||||
Welcome to Quartz! This section will walk you through setting up your digital garden from scratch.
|
||||
This guide walks you through setting up Quartz from scratch. If you already ran the [[index#🪴 Get Started|quickstart]] on the home page, you can skip ahead to whichever step you're on.
|
||||
|
||||
## Setup
|
||||
## Prerequisites
|
||||
|
||||
1. **[[installation|Installation]]** — Clone Quartz, create your repository, and push your first sync
|
||||
2. **[[authoring-content|Authoring Content]]** — Write and organize your notes in the `content` folder
|
||||
3. **[[build|Building]]** — Preview your site locally with `npx quartz build --serve`
|
||||
4. **[[hosting|Hosting]]** — Deploy your Quartz site to the web
|
||||
You need these tools installed before continuing:
|
||||
|
||||
- **[Node.js](https://nodejs.org/) v22 or later** (run `node -v` to check)
|
||||
- **npm v10.9.2 or later** (bundled with Node — run `npm -v` to check)
|
||||
- **[Git](https://git-scm.com/)** (run `git -v` to check)
|
||||
|
||||
> [!warning] Common issues
|
||||
>
|
||||
> - **Linux**: System packages (`apt install nodejs`) often ship much older versions. Use [nvm](https://github.com/nvm-sh/nvm) or the [NodeSource](https://github.com/nodesource/distributions) repository to get Node.js v22.
|
||||
> - **Windows**: When installing Git, make sure **"Git from the command line and also from 3rd-party software"** is selected so that `git` is available in your terminal. If `node -v` or `git -v` shows "command not found", restart your terminal or check your PATH.
|
||||
> - **macOS**: The Xcode command-line tools include Git (`xcode-select --install`). For Node.js, [nvm](https://github.com/nvm-sh/nvm) or the [official installer](https://nodejs.org/) both work.
|
||||
|
||||
> [!tip] Using Bun
|
||||
> Quartz runs on Node.js, but you can install its dependencies with [Bun](https://bun.sh/) (`bun install`). Bun does not link a package's own commands the way npm does, so `bunx quartz` fails with "could not determine executable to run". Use `bun run quartz` instead, followed by the command, wherever these docs say `npx quartz`: `bun run quartz create`, `bun run quartz build --serve`.
|
||||
|
||||
## Setup Steps
|
||||
|
||||
Follow these in order:
|
||||
|
||||
1. **[[installation|Installation]]** — Get Quartz (via GitHub template or clone), install dependencies, run the setup wizard (`npx quartz create`), install plugins, and preview your site locally
|
||||
2. **[[authoring-content|Authoring Content]]** — Write and organize your Markdown notes in the `content/` folder
|
||||
3. **[[installation#Setting Up Your GitHub Repository|Push to GitHub]]** — Create a repository and push your site with `npx quartz sync`
|
||||
4. **[[hosting|Deploy]]** — Host your site for free on GitHub Pages, Cloudflare, Netlify, or Vercel
|
||||
|
||||
## Upgrading & Migrating
|
||||
|
||||
- **[[whats-new|What's New in Quartz 5]]** — Overview of new features and changes
|
||||
- **[[upgrading|Upgrading Quartz]]** — Keep your Quartz installation up to date
|
||||
- **[[migrating|Migrating to Quartz 5]]** — Migrate from Quartz 4 or Quartz 3
|
||||
@@ -4,55 +4,144 @@ aliases:
|
||||
- "setting up your GitHub repository"
|
||||
---
|
||||
|
||||
First, make sure you have Quartz [[index#🪴 Get Started|cloned and setup locally]].
|
||||
This page walks you through the full Quartz setup: from getting the source code to previewing your site locally, then pushing it to GitHub.
|
||||
|
||||
Then, create a new repository on GitHub.com. Do **not** initialize the new repository with `README`, license, or `gitignore` files.
|
||||
## 1. Get Quartz
|
||||
|
||||
![[github-init-repo-options.png]]
|
||||
There are two ways to get started. Pick whichever you prefer:
|
||||
|
||||
At the top of your repository on GitHub.com's Quick Setup page, click the clipboard to copy the remote repository URL.
|
||||
### Option A: Use the GitHub Template (Recommended)
|
||||
|
||||
![[github-quick-setup.png]]
|
||||
> [!tip] Why this option?
|
||||
> Using the template creates your own repository in one click — no need to reconfigure Git remotes later.
|
||||
|
||||
In your terminal of choice, navigate to the root of your Quartz folder. Then, run the following commands, replacing `REMOTE-URL` with the URL you just copied from the previous step.
|
||||
1. Go to the [Quartz repository](https://github.com/jackyzha0/quartz) and click **Use this template** → **Create a new repository**
|
||||
2. Give your repository a name (e.g. `quartz`, `notes`, `garden`), choose public or private, then click **Create repository**
|
||||
3. Clone **your new repository** and enter the folder:
|
||||
|
||||
```bash
|
||||
# list all the repositories that are tracked
|
||||
git remote -v
|
||||
|
||||
# if the origin doesn't match your own repository, set your repository as the origin
|
||||
git remote set-url origin REMOTE-URL
|
||||
|
||||
# if you don't have upstream as a remote, add it so updates work
|
||||
git remote add upstream https://github.com/jackyzha0/quartz.git
|
||||
git clone https://github.com/<your-username>/<your-repo>.git
|
||||
cd <your-repo>
|
||||
```
|
||||
|
||||
Then, you can sync the content to upload it to your repository. This is a helper command that will do the initial push of your content to your repository.
|
||||
### Option B: Clone Directly
|
||||
|
||||
If you don't use GitHub or prefer a manual setup:
|
||||
|
||||
```bash
|
||||
npx quartz sync --no-pull
|
||||
git clone https://github.com/jackyzha0/quartz.git
|
||||
cd quartz
|
||||
```
|
||||
|
||||
> [!warning]- `fatal: --[no-]autostash option is only valid with --rebase`
|
||||
> You may have an outdated version of `git`. Updating `git` should fix this issue.
|
||||
> [!note]
|
||||
> With this option, you'll need to [[#Connect Your Local Clone|point the `origin` remote]] to your own repository later when you're ready to publish.
|
||||
|
||||
> [!warning]- `fatal: The remote end hung up unexpectedly`
|
||||
> It might be due to Git's default buffer size. You can fix it by increasing the buffer with this command:
|
||||
>
|
||||
> ```bash
|
||||
> git config http.postBuffer 524288000
|
||||
> ```
|
||||
## 2. Install Dependencies
|
||||
|
||||
In future updates, you can simply run `npx quartz sync` every time you want to push updates to your repository.
|
||||
> [!important]
|
||||
> Quartz requires **Node.js 22** or later. Check your version with `node -v` and upgrade at [nodejs.org](https://nodejs.org/) if needed.
|
||||
|
||||
> [!tip] First-time plugin install on a fresh clone
|
||||
> The Quartz template ships with a `quartz.lock.json` that pins community plugins to specific commits. On a brand-new clone those pins may be older than the plugins' current dependency versions, which can cause a handful of plugins to fail to build on first install. If you hit build errors during initial setup, run:
|
||||
```bash
|
||||
npm i
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> On subsequent clones of your own repository (e.g. on a new machine), use `npm ci` instead for a faster, reproducible install from the lockfile.
|
||||
|
||||
## 3. Initialize Your Site
|
||||
|
||||
Run the interactive setup wizard:
|
||||
|
||||
```bash
|
||||
npx quartz create
|
||||
```
|
||||
|
||||
This will prompt you for:
|
||||
|
||||
- A **template** (`default`, `obsidian`, `ttrpg`, `blog`, `docs`) — pick the one that matches your use case. See [[create#Templates]] for details on each.
|
||||
- A **content strategy** — choose how to populate the `content/` folder:
|
||||
- **new**: Start with an empty folder
|
||||
- **copy**: Copy files from an existing folder (e.g. your Obsidian vault)
|
||||
- **symlink**: Link to an existing folder so changes sync automatically
|
||||
- A **base URL** — the URL where your site will be deployed (e.g. `mysite.github.io/quartz`). Don't include `https://`.
|
||||
- A **link resolution** strategy — how to resolve internal links (`shortest`, `absolute`, or `relative`). Skipped for Obsidian and TTRPG templates.
|
||||
|
||||
For non-interactive usage and more details, see the [[create|`quartz create` CLI reference]].
|
||||
|
||||
## 4. Install Plugins
|
||||
|
||||
The template you chose references community plugins that need to be installed:
|
||||
|
||||
```bash
|
||||
npx quartz plugin install --from-config
|
||||
```
|
||||
|
||||
This downloads and builds all plugins listed in `quartz.config.yaml` into `.quartz/plugins/`.
|
||||
|
||||
> [!tip]
|
||||
> If some plugins fail to build, try refreshing them to their latest versions:
|
||||
>
|
||||
> ```bash
|
||||
> npx quartz plugin install --latest
|
||||
> ```
|
||||
>
|
||||
> This refreshes every plugin to the latest commit on its default branch and rewrites `quartz.lock.json`. See [[troubleshooting#Plugins fail to build on a fresh clone]] for details.
|
||||
> See [[troubleshooting#Plugins fail to build on a fresh clone]] for more details.
|
||||
|
||||
## 5. Preview Your Site
|
||||
|
||||
```bash
|
||||
npx quartz build --serve
|
||||
```
|
||||
|
||||
Your site is now running at `http://localhost:8080`. The dev server watches for file changes and reloads automatically.
|
||||
|
||||
At this point you can [[authoring-content|start writing content]] in the `content/` folder. When you're ready to publish, continue below to push your site to GitHub and [[hosting|deploy it]].
|
||||
|
||||
---
|
||||
|
||||
## Setting Up Your GitHub Repository
|
||||
|
||||
> [!note]
|
||||
> If you used **Option A** (GitHub Template) in step 1, your repository already exists and `origin` is already set. You can skip straight to [[#Push Your Site]].
|
||||
|
||||
To publish your site, you'll need your own GitHub repository. This section is for **Option B** (direct clone) users.
|
||||
|
||||
### Create the Repository
|
||||
|
||||
Create a new repository on [GitHub.com](https://github.com/new). Do **not** initialize it with a README, license, or `.gitignore` — Quartz already includes these files, and duplicating them will cause merge conflicts on your first push.
|
||||
|
||||
![[github-init-repo-options.png]]
|
||||
|
||||
Copy the repository URL from the Quick Setup page:
|
||||
|
||||
![[github-quick-setup.png]]
|
||||
|
||||
### Connect Your Local Clone
|
||||
|
||||
Point your local Quartz at your new repository:
|
||||
|
||||
```bash
|
||||
# Check current remotes
|
||||
git remote -v
|
||||
|
||||
# Point origin to your repository
|
||||
git remote set-url origin REMOTE-URL
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> You don't need to add an `upstream` remote manually — `npx quartz create` already configured it for you. The upstream remote is used by `npx quartz upgrade` to pull in future Quartz updates.
|
||||
|
||||
### Push Your Site
|
||||
|
||||
```bash
|
||||
npx quartz sync --no-pull
|
||||
```
|
||||
|
||||
This commits your content and pushes everything to your repository. For subsequent updates, just run:
|
||||
|
||||
```bash
|
||||
npx quartz sync
|
||||
```
|
||||
|
||||
> [!hint] Flags and options
|
||||
> For full help options, you can run `npx quartz sync --help`.
|
||||
@@ -64,3 +153,9 @@ In future updates, you can simply run `npx quartz sync` every time you want to p
|
||||
> - `--commit` or `--no-commit`: whether to make a `git` commit for your changes
|
||||
> - `--push` or `--no-push`: whether to push updates to your GitHub fork of Quartz
|
||||
> - `--pull` or `--no-pull`: whether to try and pull in any updates from your GitHub fork (i.e. from other devices) before pushing
|
||||
|
||||
## Next Steps
|
||||
|
||||
- **[[authoring-content|Authoring Content]]** — Write and organize your notes
|
||||
- **[[hosting|Hosting]]** — Deploy your site to GitHub Pages, Cloudflare, Netlify, or Vercel
|
||||
- **[[configuration|Configuration]]** — Customize your site's appearance and behavior
|
||||
@@ -7,7 +7,7 @@ aliases:
|
||||
|
||||
This guide covers migrating to Quartz 5 from previous versions. If you're already on Quartz 5 and want to update to the latest version, see [[upgrading|Upgrading Quartz]] instead.
|
||||
|
||||
If you're new to Quartz entirely, skip this guide and follow the [[installation|Installation guide]] instead.
|
||||
If you're new to Quartz entirely, skip this guide and follow the [[installation|installation guide]] instead.
|
||||
|
||||
## Before You Start: Save Your Content
|
||||
|
||||
@@ -57,7 +57,7 @@ npx quartz create
|
||||
|
||||
This will prompt you for:
|
||||
|
||||
- A **template** (`default`, `obsidian`, `ttrpg`, `blog`) — pick the one closest to your old setup. `obsidian` is recommended if you use an Obsidian vault.
|
||||
- A **template** (`default`, `obsidian`, `ttrpg`, `blog`, `docs`) — pick the one closest to your old setup. `obsidian` is recommended if you use an Obsidian vault.
|
||||
- A **content strategy** — choose "Copy" and point it to your backed-up content folder.
|
||||
|
||||
If you skipped the `create` wizard or need to restore your content manually:
|
||||
@@ -87,6 +87,26 @@ Key changes:
|
||||
- **Import pattern**: Community plugins use `ExternalPlugin.X()` (from `.quartz/plugins`) instead of `Plugin.X()` (from `./quartz/plugins`)
|
||||
- **Layout structure**: `quartz.layout.ts` is gone — layout position is now a per-plugin property in `quartz.config.yaml`
|
||||
- **Page types**: A new plugin category for page rendering (content, folder, tag pages)
|
||||
- **URL casing**: All generated URLs are now lowercased and hyphenated (e.g. `My Notes/Hello World.md` → `/my-notes/hello-world`). In v4, the original casing of file and folder names was preserved in URLs.
|
||||
|
||||
### URL Casing and SEO
|
||||
|
||||
If your v4 site had URLs with uppercase letters, those URLs will return 404 errors after upgrading to v5. This also affects search engine indexing, since Google treats URLs as [case-sensitive](https://developers.google.com/search/docs/crawling-indexing/url-structure).
|
||||
|
||||
The [[AliasRedirects]] plugin (enabled by default) automatically handles this. During build, it detects files whose original path contained uppercase characters and generates redirect pages at the old URLs. These redirect pages include proper SEO signals (`<link rel="canonical">`, `<meta http-equiv="refresh">`, `<meta name="robots" content="noindex">`) so that search engines transfer ranking to the new lowercase URLs.
|
||||
|
||||
No manual configuration is needed — the plugin is enabled by default and the case redirect behavior is on by default. If you want to disable it, set `enableCaseRedirects: false` in the plugin options:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/alias-redirects
|
||||
enabled: true
|
||||
options:
|
||||
enableCaseRedirects: false
|
||||
```
|
||||
|
||||
> [!tip] Hosting on Netlify?
|
||||
> Netlify automatically lowercases all URLs and issues server-side 301 redirects. If you're hosting on Netlify, the case redirect pages aren't strictly necessary, but they don't hurt either.
|
||||
|
||||
> [!note] Most users don't need to worry about these details
|
||||
> If you used the default Quartz 4 configuration (or only changed settings that `npx quartz create` prompts for), the setup wizard handles everything. The details below are for users who had custom plugin configurations.
|
||||
@@ -97,15 +117,15 @@ Mapping v4 plugin names to v5 equivalents:
|
||||
|
||||
| v4 | v5 | Type |
|
||||
| ----------------------------------- | ------------------------------------------- | --------------------- |
|
||||
| `Plugin.FrontMatter()` | `ExternalPlugin.NoteProperties()` | Community |
|
||||
| `Plugin.FrontMatter()` | built in (`configuration.frontmatter`) | Internal |
|
||||
| `Plugin.CreatedModifiedDate()` | `ExternalPlugin.CreatedModifiedDate()` | Community |
|
||||
| `Plugin.SyntaxHighlighting()` | `ExternalPlugin.SyntaxHighlighting()` | Community |
|
||||
| `Plugin.ObsidianFlavoredMarkdown()` | `ExternalPlugin.ObsidianFlavoredMarkdown()` | Community |
|
||||
| `Plugin.GitHubFlavoredMarkdown()` | `ExternalPlugin.GitHubFlavoredMarkdown()` | Community |
|
||||
| `Plugin.CrawlLinks()` | `ExternalPlugin.CrawlLinks()` | Community |
|
||||
| `Plugin.CrawlLinks()` | built in (`configuration.links`) | Internal |
|
||||
| `Plugin.Description()` | `ExternalPlugin.Description()` | Community |
|
||||
| `Plugin.Latex()` | `ExternalPlugin.Latex()` | Community |
|
||||
| `Plugin.RemoveDrafts()` | `ExternalPlugin.RemoveDrafts()` | Community |
|
||||
| `Plugin.RemoveDrafts()` | built in (`configuration.drafts`) | Internal |
|
||||
| `Plugin.ContentPage()` | `ExternalPlugin.ContentPage()` | Community (pageTypes) |
|
||||
| `Plugin.FolderPage()` | `ExternalPlugin.FolderPage()` | Community (pageTypes) |
|
||||
| `Plugin.TagPage()` | `ExternalPlugin.TagPage()` | Community (pageTypes) |
|
||||
@@ -114,7 +134,7 @@ Mapping v4 plugin names to v5 equivalents:
|
||||
| `Plugin.Assets()` | `Plugin.Assets()` (unchanged) | Internal |
|
||||
| `Plugin.Static()` | `Plugin.Static()` (unchanged) | Internal |
|
||||
| `Plugin.AliasRedirects()` | `ExternalPlugin.AliasRedirects()` | Community |
|
||||
| `Plugin.ContentIndex()` | `ExternalPlugin.ContentIndex()` | Community |
|
||||
| `Plugin.ContentIndex()` | built in (`configuration.contentIndex`) | Internal |
|
||||
|
||||
Component layout mapping:
|
||||
|
||||
@@ -130,6 +150,8 @@ Component layout mapping:
|
||||
| `Component.Head()` | `Component.Head()` (unchanged, internal) |
|
||||
| `Component.Spacer()` | `Plugin.Spacer()` |
|
||||
|
||||
If you edited a component's source in `quartz/components/` (for example `Footer.tsx`), that no longer works: components are now installed plugins. See [[customizing components]] for the v5 ways to change them.
|
||||
|
||||
## Updating Your CI/CD
|
||||
|
||||
Quartz 5 requires plugins to be installed before building. Add a plugin install step and (optionally) caching to your CI pipeline.
|
||||
|
||||
@@ -28,6 +28,42 @@ npx quartz plugin install --latest
|
||||
|
||||
See the [[upgrade|CLI reference for upgrade]] for more details on available flags.
|
||||
|
||||
### Layout System Changes
|
||||
|
||||
The `footer` layout slot is now an array of components, consistent with other layout slots like `header`, `left`, and `right`. Additionally, `header` and `footer` are now configurable layout positions — plugins can declare `layout: { position: header }` or `layout: { position: footer }` in their YAML config.
|
||||
|
||||
**If you override layouts in `quartz.ts`**, update any `footer` assignments to use arrays:
|
||||
|
||||
```ts title="quartz.ts"
|
||||
// Before
|
||||
export const layout = await loadQuartzLayout({
|
||||
defaults: { footer: MyFooterComponent },
|
||||
})
|
||||
|
||||
// After
|
||||
export const layout = await loadQuartzLayout({
|
||||
defaults: { footer: [MyFooterComponent] },
|
||||
})
|
||||
```
|
||||
|
||||
**If you have a custom page frame**, update the `render` function to iterate the footer array:
|
||||
|
||||
```tsx
|
||||
// Before
|
||||
render({ footer: Footer, ...rest }: PageFrameProps) {
|
||||
return <Footer {...componentData} />
|
||||
}
|
||||
|
||||
// After
|
||||
render({ footer, ...rest }: PageFrameProps) {
|
||||
return footer.map((F) => <F {...componentData} />)
|
||||
}
|
||||
```
|
||||
|
||||
Both changes are caught by TypeScript at compile time — running `npx quartz build` will show the error.
|
||||
|
||||
No changes are needed for `quartz.config.yaml` — the YAML format is unchanged.
|
||||
|
||||
### Cleaning Up Unused Plugins
|
||||
|
||||
If you've removed plugins from your configuration during an upgrade, you can clean up the leftover files:
|
||||
@@ -38,3 +74,48 @@ npx quartz plugin prune # remove orphaned plugins
|
||||
```
|
||||
|
||||
See the [[cli/plugin#prune|plugin prune reference]] for more details.
|
||||
|
||||
## Switching to npm Plugin Specifiers
|
||||
|
||||
First-party Quartz plugins are now published to npm under the `@quartz-community` scope. If your `quartz.config.yaml` uses `github:` specifiers, you can optionally switch to npm specifiers for faster installs and better version pinning.
|
||||
|
||||
### Why Switch?
|
||||
|
||||
- **Faster installs**: npm packages are cached locally and don't require git cloning
|
||||
- **Version pinning**: npm uses semver ranges, so you control when to update
|
||||
- **No build step**: npm packages ship pre-built, unlike git sources which may need to build on install
|
||||
|
||||
### How to Migrate
|
||||
|
||||
Update each plugin source in your `quartz.config.yaml` from the `github:` format to the quoted npm format:
|
||||
|
||||
```yaml
|
||||
# Before
|
||||
plugins:
|
||||
- source: github:quartz-community/syntax-highlighting
|
||||
enabled: true
|
||||
|
||||
# After
|
||||
plugins:
|
||||
- source: "@quartz-community/syntax-highlighting"
|
||||
enabled: true
|
||||
```
|
||||
|
||||
> [!important]
|
||||
> The `@` scoped name must be quoted in YAML. Use double quotes around the source value.
|
||||
|
||||
Then install the packages:
|
||||
|
||||
```bash
|
||||
npm install @quartz-community/syntax-highlighting
|
||||
```
|
||||
|
||||
Or install all default plugins at once:
|
||||
|
||||
```bash
|
||||
npm install @quartz-community/created-modified-date @quartz-community/syntax-highlighting @quartz-community/obsidian-flavored-markdown @quartz-community/github-flavored-markdown @quartz-community/table-of-contents @quartz-community/description @quartz-community/latex @quartz-community/quartz-fonts @quartz-community/alias-redirects @quartz-community/favicon @quartz-community/og-image @quartz-community/cname @quartz-community/canvas-page @quartz-community/content-page @quartz-community/folder-page @quartz-community/tag-page @quartz-community/explorer @quartz-community/graph @quartz-community/search @quartz-community/backlinks @quartz-community/article-title @quartz-community/content-meta @quartz-community/page-title @quartz-community/darkmode @quartz-community/reader-mode @quartz-community/breadcrumbs @quartz-community/footer @quartz-community/spacer @quartz-community/bases-page @quartz-community/note-properties @quartz-community/unlisted-pages @quartz-community/encrypted-pages
|
||||
```
|
||||
|
||||
### Do I Have to Switch?
|
||||
|
||||
No. The `github:` specifiers continue to work and will be supported indefinitely. They are still the recommended approach for third-party and community plugins that are not published to npm. The npm path is an optional improvement for first-party plugins.
|
||||
@@ -0,0 +1,193 @@
|
||||
---
|
||||
title: "What's New in Quartz 5"
|
||||
aliases:
|
||||
- "changelog"
|
||||
- "v5"
|
||||
---
|
||||
|
||||
Quartz 5 is a ground-up rearchitecture of Quartz focused on extensibility, performance, and Obsidian compatibility. If you're coming from v4, see [[migrating|Migrating to Quartz 5]] for the upgrade path.
|
||||
|
||||
## Plugin Ecosystem
|
||||
|
||||
The biggest change in v5 is the move to a **community plugin ecosystem**. Plugins are now standalone packages maintained in the [quartz-community](https://github.com/quartz-community) GitHub organization and installed via git:
|
||||
|
||||
```bash
|
||||
npx quartz plugin add github:quartz-community/explorer
|
||||
```
|
||||
|
||||
This means:
|
||||
|
||||
- **Independent versioning**: Plugins can be updated without upgrading Quartz itself
|
||||
- **Community contributions**: Anyone can publish a Quartz plugin
|
||||
- **Smaller core**: Quartz core is leaner; features live in plugins
|
||||
- **Plugin registry**: Discover plugins via `npx quartz tui` or the [plugin registry](https://github.com/quartz-community/registry)
|
||||
|
||||
Over 40 official plugins ship with Quartz, covering everything from search and graph view to encrypted pages and canvas rendering.
|
||||
|
||||
## YAML Configuration
|
||||
|
||||
Configuration moved from TypeScript (`quartz.config.ts`) to **YAML** (`quartz.config.yaml`):
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
pageTitle: My Digital Garden
|
||||
enableSPA: true
|
||||
enablePopovers: true
|
||||
locale: en-US
|
||||
baseUrl: mysite.github.io
|
||||
theme:
|
||||
typography:
|
||||
header: Schibsted Grotesk
|
||||
body: Source Sans Pro
|
||||
code: IBM Plex Mono
|
||||
plugins:
|
||||
- source: github:quartz-community/obsidian-flavored-markdown
|
||||
enabled: true
|
||||
order: 30
|
||||
- source: github:quartz-community/explorer
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
```
|
||||
|
||||
Benefits:
|
||||
|
||||
- **No TypeScript knowledge required** for basic customization
|
||||
- **JSON Schema validation** — editors with YAML support show errors inline
|
||||
- **Layout defined per-plugin** — each plugin declares its own position and priority
|
||||
- **Templates** — `npx quartz create` offers preconfigured templates (default, obsidian, ttrpg, blog, docs)
|
||||
|
||||
For advanced options that need JavaScript (callbacks, custom components), the `quartz.ts` override system provides full programmatic control.
|
||||
|
||||
## Improved Obsidian Compatibility
|
||||
|
||||
Quartz 5 aims for full compatibility with Obsidian's core features:
|
||||
|
||||
- **Wikilinks** — all variations including aliases, headings, block references, and pipe escaping in tables
|
||||
- **Callouts** — all built-in types, collapsible variants, and nested callouts
|
||||
- **Highlights** — `==highlighted text==` syntax
|
||||
- **Comments** — `%%hidden comments%%` (inline and block)
|
||||
- **Tags** — `#tag` and `#nested/tag` with tag pages
|
||||
- **Custom task characters** — `[?]`, `[!]`, `[>]`, etc. preserved as `data-task` attributes
|
||||
- **Mermaid diagrams** — Mermaid.js default; [Pele](https://pele.run) via `diagramRenderer: pele`
|
||||
- **YouTube and Tweet embeds** — via image syntax
|
||||
- **Block references** — `^block-id` with broad character support
|
||||
- **Video/audio embeds** — full format support (mp4, webm, ogv, mov, mkv, avi, flac, aac, etc.)
|
||||
- **Canvas files** — rendered as interactive, pannable pages via the canvas-page plugin
|
||||
- **Obsidian URI links** — marked with CSS class for custom styling
|
||||
- **Footnotes** — via the GitHub Flavored Markdown plugin
|
||||
|
||||
See [[Obsidian compatibility]] for the full list.
|
||||
|
||||
## Page Type System
|
||||
|
||||
Quartz 5 introduces **page types** — plugins that define how different kinds of pages are rendered:
|
||||
|
||||
- **Content pages** — regular markdown notes
|
||||
- **Folder pages** — directory listing pages
|
||||
- **Tag pages** — pages listing notes with a given tag
|
||||
- **Canvas pages** — interactive JSON Canvas renderings
|
||||
- **Bases pages** — database-style views of your content
|
||||
|
||||
Each page type can use a different [[layout#Page Frames|page frame]] for fundamentally different HTML structures (three-column, full-width, minimal, etc.).
|
||||
|
||||
## Layout System
|
||||
|
||||
The layout system is now declarative. Plugins declare their position (`left`, `right`, `beforeBody`, `afterBody`) and priority in the config:
|
||||
|
||||
```yaml
|
||||
plugins:
|
||||
- source: github:quartz-community/explorer
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
- source: github:quartz-community/graph
|
||||
layout:
|
||||
position: right
|
||||
priority: 10
|
||||
```
|
||||
|
||||
Additional features:
|
||||
|
||||
- **Groups** — combine components into flex rows/columns (e.g., toolbar with search + darkmode toggle)
|
||||
- **Conditional rendering** — show/hide components based on page properties (`condition: not-index`, `condition: has-tags`)
|
||||
- **Display modifiers** — `display: mobile-only` or `display: desktop-only`
|
||||
- **Per-page-type overrides** — different layouts for content, folder, tag, and 404 pages
|
||||
|
||||
## Performance
|
||||
|
||||
- **Parallel processing** — markdown parsing uses a worker pool across all CPU cores
|
||||
- **Incremental rebuilds** — watch mode only re-processes changed files
|
||||
- **Pre-built plugins** — community plugins ship compiled `dist/` directories, skipping build-from-source on install
|
||||
- **SPA routing** — client-side navigation with `micromorph` for instant page transitions
|
||||
- **CDN-cached fonts** — Google Fonts with aggressive caching, or fully self-hosted with `fontOrigin: local`
|
||||
|
||||
## CLI Improvements
|
||||
|
||||
The CLI is simpler and more helpful:
|
||||
|
||||
| Command | Description |
|
||||
| -------------------------------- | --------------------------------------- |
|
||||
| `npx quartz create` | Interactive setup wizard with templates |
|
||||
| `npx quartz build --serve` | Build and serve with hot reload |
|
||||
| `npx quartz sync` | Commit and push to GitHub |
|
||||
| `npx quartz upgrade` | Pull latest Quartz updates |
|
||||
| `npx quartz plugin install` | Install plugins from lockfile |
|
||||
| `npx quartz plugin add <source>` | Add a new plugin |
|
||||
| `npx quartz plugin list` | List installed plugins |
|
||||
| `npx quartz plugin prune` | Remove unused plugins |
|
||||
|
||||
Other improvements:
|
||||
|
||||
- **Node.js version check** — clear error message if running on Node < 22
|
||||
- **Port conflict handling** — helpful message when port is already in use
|
||||
- **Plugin lockfile** — `quartz.lock.json` pins plugin versions for reproducible builds
|
||||
- **Concurrency control** — `--concurrency` flag for memory-constrained environments
|
||||
|
||||
## Internationalization
|
||||
|
||||
Quartz 5 supports multiple locales out of the box. Set `locale: ja-JP` (or any supported locale) in your config to translate all UI strings — search placeholders, "table of contents", date formatting, and more.
|
||||
|
||||
## New Plugins
|
||||
|
||||
Plugins new to v5 (not available in v4):
|
||||
|
||||
```base
|
||||
filters:
|
||||
and:
|
||||
- file.ext == "md"
|
||||
- file.inFolder("plugins")
|
||||
- note["new-in-v5"] == true
|
||||
properties:
|
||||
title:
|
||||
displayName: Plugin
|
||||
repository:
|
||||
displayName: Repository
|
||||
description:
|
||||
displayName: Description
|
||||
views:
|
||||
- type: table
|
||||
name: New in v5
|
||||
order:
|
||||
- title
|
||||
- repository
|
||||
- description
|
||||
sort:
|
||||
- property: title
|
||||
direction: ASC
|
||||
```
|
||||
|
||||
## For Plugin Developers
|
||||
|
||||
If you built plugins for v4, the development model has changed significantly:
|
||||
|
||||
- Plugins are **standalone npm packages** with their own `package.json`, `tsconfig.json`, and build system
|
||||
- The **factory function pattern** (inspired by Astro integrations) replaces class-based plugins
|
||||
- **`@quartz-community/types`** provides full type safety without depending on the Quartz core
|
||||
- **`@quartz-community/utils`** provides shared path, DOM, and language utilities
|
||||
- **`@quartz-community/runtime`** provides browser runtime utilities
|
||||
- Plugins can ship **components**, **frames**, **stylesheets**, and **client scripts**
|
||||
- A **plugin template** is available at [quartz-community/plugin-template](https://github.com/quartz-community/plugin-template)
|
||||
|
||||
See [[making plugins]] for the full guide.
|
||||
+41
-2
@@ -7,7 +7,7 @@ Quartz effectively turns your Markdown files and other resources into a bundle o
|
||||
However, if you'd like to publish your site to the world, you need a way to host it online. This guide will detail how to deploy with common hosting providers but any service that allows you to deploy static HTML should work as well.
|
||||
|
||||
> [!warning]
|
||||
> The rest of this guide assumes that you've already created your own GitHub repository for Quartz. If you haven't already, [[setting up your GitHub repository|make sure you do so]].
|
||||
> The rest of this guide assumes that you've already created your own GitHub repository for Quartz. If you haven't already, follow the [[installation#Setting Up Your GitHub Repository|GitHub repository setup]] section of the installation guide.
|
||||
|
||||
> [!hint]
|
||||
> Some Quartz features (like [[RSS Feed]] and sitemap generation) require `baseUrl` to be configured properly in your [[configuration]] to work properly. Make sure you set this before deploying!
|
||||
@@ -134,7 +134,11 @@ Here's how to add a custom domain to your GitHub pages deployment.
|
||||
- `185.199.111.153`
|
||||
- If you are using a subdomain, navigate to your DNS provider and create a `CNAME` record that points your subdomain to the default domain for your site. For example, if you want to use the subdomain `quartz.example.com` for your user site, create a `CNAME` record that points `quartz.example.com` to `<github-username>.github.io`.
|
||||
|
||||
![[dns records.png]]_The above shows a screenshot of Google Domains configured for both `jzhao.xyz` (an apex domain) and `quartz.jzhao.xyz` (a subdomain)._
|
||||
![[dns records.png]]_The above shows a screenshot of Google Domains configured for both `jzhao.xyz`
|
||||
|
||||
(an apex domain) and `quartz.jzhao.xyz`
|
||||
|
||||
(a subdomain)._
|
||||
|
||||
See the [GitHub documentation](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-a-subdomain) for more detail about how to setup your own custom domain with GitHub Pages.
|
||||
|
||||
@@ -310,3 +314,38 @@ example.com {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Caching
|
||||
|
||||
Quartz emits CSS and JS files with content hashes in their filenames (e.g. `index-a3f2c1b.css`, `component-7d4e2f.css`). Since the filename changes whenever the content changes, these files can be cached indefinitely. HTML files should not be cached long-term since they reference the hashed filenames and need to stay fresh.
|
||||
|
||||
### Cloudflare Pages / Vercel / Netlify
|
||||
|
||||
These platforms handle caching automatically. No configuration is needed — hashed assets will be served with appropriate cache headers out of the box.
|
||||
|
||||
### Nginx
|
||||
|
||||
```nginx title="nginx.conf"
|
||||
# Immutable cache for hashed assets
|
||||
location ~* \.(css|js)$ {
|
||||
if ($uri ~* "-[0-9a-f]{8}\.") {
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Caddy
|
||||
|
||||
```caddy title="Caddyfile"
|
||||
@hashed path_regexp hashed -[0-9a-f]{8}\.(css|js)$
|
||||
header @hashed Cache-Control "public, max-age=31536000, immutable"
|
||||
```
|
||||
|
||||
### Apache
|
||||
|
||||
```apache title=".htaccess"
|
||||
# Immutable cache for content-hashed assets
|
||||
<FilesMatch "-[0-9a-f]{8}\.(css|js)$">
|
||||
Header set Cache-Control "public, max-age=31536000, immutable"
|
||||
</FilesMatch>
|
||||
```
|
||||
+36
-8
@@ -4,26 +4,54 @@ title: Welcome to Quartz 5
|
||||
|
||||
Quartz is a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites. Thousands of students, developers, and teachers are [[showcase|already using Quartz]] to publish personal notes, websites, and [digital gardens](https://jzhao.xyz/posts/networked-thought) to the web.
|
||||
|
||||
## Getting Started
|
||||
## 🪴 Get Started
|
||||
|
||||
Quartz requires **at least [Node](https://nodejs.org/) v22** and `npm` v10.9.2 to function correctly. Ensure you have this installed on your machine before continuing.
|
||||
Quartz requires **at least [Node](https://nodejs.org/) v22** and `npm` v10.9.2 to function correctly. Ensure you have these installed on your machine before continuing. See the [[getting-started/index#Prerequisites|prerequisites]] for help installing them.
|
||||
|
||||
### New to Quartz?
|
||||
> [!tip] GitHub users
|
||||
> You can also use the **[GitHub template](https://github.com/jackyzha0/quartz/generate)** to create your repository in one click, then clone that instead. See [[installation#Option A Use the GitHub Template Recommended|Option A]] in the installation guide.
|
||||
|
||||
1. **[[installation|Set up your repository]]** — Fork and clone the Quartz template
|
||||
2. **[[installation|Initialize]]** — Run `npx quartz create` to choose a template and configure your site
|
||||
3. **[[build|Build]]** — Preview your site locally with `npx quartz build --serve`
|
||||
4. **[[hosting|Deploy]]** — Host your site for free on GitHub Pages, Cloudflare, or Netlify
|
||||
```shell
|
||||
# 1. Clone the Quartz repository
|
||||
git clone https://github.com/jackyzha0/quartz.git
|
||||
cd quartz
|
||||
|
||||
# 2. Install dependencies
|
||||
npm i
|
||||
|
||||
# 3. Initialize your site (choose a template, set your base URL, import content)
|
||||
npx quartz create
|
||||
|
||||
# 4. Install plugins referenced by your chosen template
|
||||
npx quartz plugin install --from-config
|
||||
|
||||
# 5. Preview your site locally
|
||||
npx quartz build --serve
|
||||
```
|
||||
|
||||
Your site is now running at `http://localhost:8080`. From here:
|
||||
|
||||
- **[[authoring-content|Write content]]** in the `content/` folder
|
||||
- **[[installation|Push to GitHub]]** with `npx quartz sync`
|
||||
- **[[hosting|Deploy]]** to GitHub Pages, Cloudflare, Netlify, or Vercel
|
||||
|
||||
For the full walkthrough, see the [[getting-started/index|Getting Started]] guide.
|
||||
|
||||
### Returning User?
|
||||
|
||||
If you've already set up Quartz and are cloning your repository on a new machine:
|
||||
Already have a Quartz repository and cloning it on a new machine?
|
||||
|
||||
```shell
|
||||
git clone https://github.com/<your-username>/<your-repo>.git
|
||||
cd <your-repo>
|
||||
npm ci
|
||||
npx quartz plugin install
|
||||
npx quartz build --serve
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> If you hit build errors on a fresh clone, try `npx quartz plugin install --latest` to refresh plugins to their latest versions. See [[troubleshooting#Plugins fail to build on a fresh clone]] for details.
|
||||
|
||||
## 🔧 Features
|
||||
|
||||
- [[Obsidian compatibility]], [[full-text search]], [[graph view]], [[wikilinks|wikilinks, transclusions]], [[plugins/Backlinks]], [[features/Latex|Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], [[i18n|internationalization]], [[features/comments|comments]] and [many more](./features/) right out of the box
|
||||
|
||||
+33
-14
@@ -57,11 +57,14 @@ The `groupOptions` field on each plugin entry supports the following flex item p
|
||||
|
||||
The top-level `layout.groups` section configures the flex container itself:
|
||||
|
||||
| Option | Type | Description |
|
||||
| ----------- | -------------------------------------------------------------- | ----------------------------------------- |
|
||||
| `direction` | `"row"` \| `"row-reverse"` \| `"column"` \| `"column-reverse"` | Flex direction |
|
||||
| `wrap` | `"nowrap"` \| `"wrap"` \| `"wrap-reverse"` | Flex wrap behavior |
|
||||
| `gap` | `string` | Gap between flex items (e.g., `"0.5rem"`) |
|
||||
| Option | Type | Description |
|
||||
| ----------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
||||
| `direction` | `"row"` \| `"row-reverse"` \| `"column"` \| `"column-reverse"` | Flex direction |
|
||||
| `wrap` | `"nowrap"` \| `"wrap"` \| `"wrap-reverse"` | Flex wrap behavior |
|
||||
| `gap` | `string` | Gap between flex items (e.g., `"0.5rem"`) |
|
||||
| `priority` | `number` | Position of the whole group in its slot (defaults to its first member's priority) |
|
||||
|
||||
Groups work in the `header`, `beforeBody`, `afterBody`, `left` and `right` slots. Groups are formed per slot: members with different `position`s end up in separate groups. Avoid groups in the `footer` slot — the frames place footer components directly in the page grid, and a group wrapper is not assigned to the footer area.
|
||||
|
||||
### TS Override
|
||||
|
||||
@@ -127,11 +130,13 @@ plugins:
|
||||
|
||||
Available `display` values:
|
||||
|
||||
| Value | Description |
|
||||
| -------------- | ------------------------------------- |
|
||||
| `all` | Visible on all screen sizes (default) |
|
||||
| `mobile-only` | Only visible on mobile devices |
|
||||
| `desktop-only` | Only visible on desktop devices |
|
||||
| Value | Description |
|
||||
| -------------- | --------------------------------------------------------------------------- |
|
||||
| `all` | Visible on all screen sizes (default) |
|
||||
| `mobile-only` | Only visible below the `mobile` breakpoint (800px by default) |
|
||||
| `desktop-only` | Hidden below the `mobile` breakpoint (visible on tablet and desktop widths) |
|
||||
|
||||
Any other value is ignored with a build warning.
|
||||
|
||||
### TS Override
|
||||
|
||||
@@ -174,15 +179,29 @@ Available built-in conditions:
|
||||
|
||||
### TS Override
|
||||
|
||||
For custom conditions that aren't covered by the built-in presets, use `Component.ConditionalRender()` in `quartz.ts`:
|
||||
For custom conditions that aren't covered by the built-in presets, import the internal component utilities and the component you want to wrap in `quartz.ts`. Place `Component.ConditionalRender()` in the layout slot where the wrapped component should appear. For example, this renders Search in the left sidebar only for pages under `notes/`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
Component.ConditionalRender({
|
||||
component: Plugin.Search(),
|
||||
condition: (props) => props.displayClass !== "fullpage",
|
||||
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
import * as Component from "./quartz/components"
|
||||
import { Search } from "./.quartz/plugins/search"
|
||||
|
||||
const config = await loadQuartzConfig()
|
||||
export default config
|
||||
export const layout = await loadQuartzLayout({
|
||||
defaults: {
|
||||
left: [
|
||||
Component.ConditionalRender({
|
||||
component: Search(),
|
||||
condition: (props) => props.fileData.slug?.startsWith("notes/") ?? false,
|
||||
}),
|
||||
],
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
The wrapped plugin must be installed and enabled in `quartz.config.yaml`. A TypeScript layout override replaces the selected slot, so include any other components you want to keep in that slot alongside the conditional component.
|
||||
|
||||
```typescript
|
||||
type ConditionalRenderConfig = {
|
||||
component: QuartzComponent
|
||||
|
||||
+105
-5
@@ -7,7 +7,7 @@ Certain emitters may also output [HTML](https://developer.mozilla.org/en-US/docs
|
||||
In v5, the layout is defined in `quartz.config.yaml`. Each plugin controls its own layout position via `layout.position` and `layout.priority` fields. The top-level `layout` section provides two additional mechanisms:
|
||||
|
||||
- `layout.groups` defines flex containers (like `toolbar`) that group multiple components into a single row or column. See [[layout-components]] for details.
|
||||
- `layout.byPageType` contains per-page-type overrides (content, folder, tag, 404) for beforeBody, left, right sections, and optionally a `template` to control the page's [[#Page Frames|page frame]].
|
||||
- `layout.byPageType` contains per-page-type overrides (content, folder, tag, 404, …): `exclude` plugins, clear slots with `positions`, and optionally a `template` to control the page's [[#Page Frames|page frame]]. See [[#Per-page-type overrides]].
|
||||
|
||||
Each page is composed of multiple different sections which contain `QuartzComponents`. The following code snippet lists all of the valid sections that you can add components to:
|
||||
|
||||
@@ -20,7 +20,7 @@ export interface FullPageLayout {
|
||||
afterBody: QuartzComponent[] // laid out vertically
|
||||
left: QuartzComponent[] // vertical on desktop and tablet, horizontal on mobile
|
||||
right: QuartzComponent[] // vertical on desktop, horizontal on tablet and mobile
|
||||
footer: QuartzComponent // single component
|
||||
footer: QuartzComponent[] // laid out vertically
|
||||
}
|
||||
```
|
||||
|
||||
@@ -36,7 +36,7 @@ These correspond to following parts of the page:
|
||||
> There are two additional layout fields that are _not_ shown in the above diagram.
|
||||
>
|
||||
> 1. `head` is a single component that renders the `<head>` [tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head) in the HTML. This doesn't appear visually on the page and is only is responsible for metadata about the document like the tab title, scripts, and styles.
|
||||
> 2. `header` is a set of components that are laid out horizontally and appears _before_ the `beforeBody` section. This enables you to replicate the old Quartz 3 header bar where the title, search bar, and dark mode toggle. By default, Quartz doesn't place any components in the `header`.
|
||||
> 2. `header` is a set of components that are laid out horizontally and appears _before_ the `beforeBody` section. You can place components in the header by setting `layout.position: header` in your plugin configuration. This enables layouts similar to Quartz 3's header bar with title, search bar, and dark mode toggle.
|
||||
|
||||
Layout components are configured in the `layout` section of `quartz.config.yaml`. Plugins declare their position and priority, and the layout system arranges them automatically:
|
||||
|
||||
@@ -77,12 +77,20 @@ plugins:
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 30
|
||||
- source: github:quartz-community/darkmode
|
||||
enabled: true
|
||||
layout:
|
||||
position: header
|
||||
priority: 10
|
||||
- source: github:quartz-community/footer
|
||||
enabled: true
|
||||
options:
|
||||
links:
|
||||
GitHub: https://github.com/jackyzha0/quartz
|
||||
Discord Community: https://discord.gg/cRFFHYye7t
|
||||
layout:
|
||||
position: footer
|
||||
priority: 50
|
||||
|
||||
layout:
|
||||
groups:
|
||||
@@ -108,6 +116,76 @@ layout:
|
||||
right: []
|
||||
```
|
||||
|
||||
### Conditional Rendering
|
||||
|
||||
Plugins can specify a `condition` in their layout block to control when they appear. This uses built-in presets:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/breadcrumbs
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 5
|
||||
condition: not-index
|
||||
```
|
||||
|
||||
Available conditions:
|
||||
|
||||
| Condition | Effect |
|
||||
| --------------- | ------------------------------------------------------------------------ |
|
||||
| `not-index` | Hidden on the root index page, shown everywhere else |
|
||||
| `has-tags` | Only shown on pages that have tags in frontmatter |
|
||||
| `has-backlinks` | Only shown on pages that another (listed) page links to |
|
||||
| `has-toc` | Only shown on pages with a table of contents (needs `table-of-contents`) |
|
||||
|
||||
Plugins can register additional conditions. An unknown condition name prints a warning at build time and the component is always shown.
|
||||
|
||||
### Plugin layout fields
|
||||
|
||||
| Field | Required | Description |
|
||||
| -------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
|
||||
| `position` | no | `header`, `beforeBody`, `afterBody`, `left`, `right` or `footer`. Defaults to the plugin's `defaultPosition`. |
|
||||
| `priority` | no | Order within the slot, lower first. Defaults to the plugin's `defaultPriority`, else `50`. |
|
||||
| `display` | no | `all` (default), `mobile-only`, `desktop-only` — see [[layout-components]]. |
|
||||
| `condition` | no | One of the conditions above. |
|
||||
| `group` | no | Name of a flex group from `layout.groups`. Works in every slot except `footer`. |
|
||||
| `groupOptions` | no | Flex item options inside the group — see [[layout-components]]. |
|
||||
|
||||
Because `position` and `priority` fall back to the plugin's defaults, a layout block can contain only what you want to change, e.g. `layout: { condition: has-tags }`. A plugin without a `layout` block is placed at its default position (if it declares one).
|
||||
|
||||
Components with equal priority keep the order in which they appear in `quartz.config.yaml`; components placed by their plugin default come after explicitly configured ones.
|
||||
|
||||
### Per-page-type overrides
|
||||
|
||||
`layout.byPageType.<layout-key>` adjusts the layout for one page type. The key is the page type's layout name (`content`, `folder`, `tag`, `404`, `canvas`, `bases`, …).
|
||||
|
||||
| Field | Description |
|
||||
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `exclude` | Plugins to leave out on this page type. Use the plugin name (`reader-mode`); the full source (`@quartz-community/reader-mode`, `github:…/reader-mode`) works too. |
|
||||
| `positions` | Clear slots: `right: []` removes everything from the right sidebar. Only empty lists are supported. |
|
||||
| `template` | The [[#Page Frames\|page frame]] to use, e.g. `full-width` or `minimal`. |
|
||||
|
||||
Slots that a page type does not change follow the defaults.
|
||||
|
||||
### Checking your layout
|
||||
|
||||
Layout problems that would otherwise silently drop or misplace a component are reported as `⚠ Layout:` warnings during the build — for example an unknown `position` (with a "did you mean" hint), an unknown `display` or `condition`, a `layout` block for a plugin that provides no component, a plugin listed twice, or a `byPageType` entry that excludes a plugin that doesn't exist.
|
||||
|
||||
To see where every component ended up, run the build with `--verbose`:
|
||||
|
||||
```bash
|
||||
npx quartz build --verbose
|
||||
```
|
||||
|
||||
This prints, for the defaults and for each page type, every slot with its components in render order, their priority, whether the position came from your config or the plugin default, and any `display`, `condition` or `group`; plus the frame each page type uses and which slots that frame does not render.
|
||||
|
||||
### Mobile layout
|
||||
|
||||
On screens narrower than the `mobile` [[#Layout breakpoints|breakpoint]] the left sidebar becomes a single horizontal row at the top of the page — intended for compact components such as the page title, search, darkmode toggle and the explorer menu button. Taller components placed in `left` (recent notes, graph, table of contents, …) get squeezed into that row. Give them `display: desktop-only`, or place them in `right`/`afterBody`, which stack below the content on mobile.
|
||||
|
||||
See [[layout-components]] for more details on conditional rendering and display options.
|
||||
|
||||
For advanced layout overrides using TypeScript (e.g. custom component wrappers or conditional logic), you can use the TS override in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts"
|
||||
@@ -130,7 +208,12 @@ export const layout = await loadQuartzLayout({
|
||||
})
|
||||
```
|
||||
|
||||
Fields defined in `defaults` can be overridden by specific entries in `byPageType`.
|
||||
`loadQuartzConfig()` must be called first (as in the default `quartz.ts`); calling `loadQuartzLayout()` with overrides afterwards applies them to the layout used for rendering. For each slot the precedence is, from highest to lowest:
|
||||
|
||||
1. `byPageType` in `quartz.ts`
|
||||
2. `layout.byPageType` changes in `quartz.config.yaml` (`exclude`, cleared `positions`)
|
||||
3. `defaults` in `quartz.ts`
|
||||
4. the layout built from each plugin's `layout` block
|
||||
|
||||
Community component plugins are installed via `npx quartz plugin add github:quartz-community/<name>`. See [[layout-components]] for built-in layout utilities (Flex, MobileOnly, DesktopOnly, etc.).
|
||||
|
||||
@@ -190,6 +273,23 @@ Frames are applied as a `data-frame` attribute on the `.page` element, which you
|
||||
|
||||
Frame CSS should be scoped with `[data-frame="name"]` selectors to avoid conflicts with other frames.
|
||||
|
||||
### Sidebar modes
|
||||
|
||||
`layout.sidebars` sets how each sidebar handles content taller than the screen:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
layout:
|
||||
sidebars:
|
||||
left: static
|
||||
right: fit
|
||||
```
|
||||
|
||||
- `fit` (default): the sidebar stays in view and is exactly one screen tall. Its components shrink and scroll themselves (the explorer and table of contents get their own scroll area).
|
||||
- `scroll`: the sidebar stays in view, and scrolls itself when its components are taller than the screen. Components take their natural height, so nothing can end up out of reach.
|
||||
- `static`: the sidebar scrolls away with the page, like most documentation sites. The [[create#Templates|docs template]] uses this for both sidebars.
|
||||
|
||||
The modes apply where a sidebar is a column: the left sidebar above mobile width, the right sidebar on desktop. A page type can override them with `byPageType.<type>.sidebars`, merged over `layout.sidebars`.
|
||||
|
||||
### Layout breakpoints
|
||||
|
||||
Quartz has different layouts depending on the width the screen viewing the website.
|
||||
@@ -214,4 +314,4 @@ Most meaningful style changes like colour scheme and font can be done simply thr
|
||||
You can see the base style sheet in `quartz/styles/base.scss` and write your own in `quartz/styles/custom.scss`.
|
||||
|
||||
> [!note]
|
||||
> Some components may provide their own styling as well! Community plugins bundle their own styles. If you'd like to customize styling for a specific component, double check the component definition to see how its styles are defined.
|
||||
> Some components may provide their own styling as well! Community plugins bundle their own styles. If you'd like to customize styling for a specific component, double check the component definition to see how its styles are defined. See also [[customizing components]].
|
||||
@@ -1,35 +1,66 @@
|
||||
---
|
||||
title: AliasRedirects
|
||||
description: Generates redirect pages from frontmatter aliases and case-preserving URLs.
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image: https://images.unsplash.com/photo-1601735479770-bb5de9dbe844
|
||||
repository: "[quartz-community/alias-redirects](https://github.com/quartz-community/alias-redirects)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin emits HTML redirect pages for aliases and permalinks defined in the frontmatter of content files.
|
||||
This plugin emits HTML redirect pages so that old URLs redirect to the canonical page. It handles two types of redirects:
|
||||
|
||||
For example, A `foo.md` has the following frontmatter
|
||||
1. **Frontmatter aliases**: Redirect pages for aliases defined in your content's frontmatter.
|
||||
2. **Case-preserving redirects**: Automatic redirect pages for URLs that changed due to Quartz v5's lowercase slug normalization.
|
||||
|
||||
### Frontmatter Aliases
|
||||
|
||||
If `foo.md` has the following frontmatter:
|
||||
|
||||
```md title="foo.md"
|
||||
---
|
||||
title: "Foo"
|
||||
alias:
|
||||
aliases:
|
||||
- "bar"
|
||||
---
|
||||
```
|
||||
|
||||
The target `host.me/bar` will be redirected to `host.me/foo`
|
||||
The target `host.me/bar` will be permanently redirected to `host.me/foo`.
|
||||
|
||||
Note that these are permanent redirect.
|
||||
|
||||
The emitter supports the following aliases:
|
||||
The emitter supports the following frontmatter fields:
|
||||
|
||||
- `aliases`
|
||||
- `alias`
|
||||
|
||||
A note with a `permalink` is published at its permalink, and its file path becomes a redirect as well: `notes/foo.md` with `permalink: foo` lives at `host.me/foo`, and `host.me/notes/foo` redirects there. An alias that is another page's address (or the page's own) is skipped with a warning, so a redirect never replaces a page.
|
||||
|
||||
### Case-Preserving Redirects
|
||||
|
||||
Quartz v5 normalizes all URLs to lowercase. If you are migrating from v4 (which preserved the original casing), previously indexed URLs containing uppercase letters (e.g. `/Diary/My-Note`) would return 404 errors.
|
||||
|
||||
When `enableCaseRedirects` is enabled (the default), this plugin automatically detects files whose original path differs from the lowercased slug and generates redirect pages at the original-case URL. For example, if your content directory contains `Diary/2026-01-01.md`, the plugin generates:
|
||||
|
||||
- The canonical page at `/diary/2026-01-01` (produced by the normal build)
|
||||
- A redirect page at `/Diary/2026-01-01` (produced by this plugin)
|
||||
|
||||
The redirect page includes proper SEO signals:
|
||||
|
||||
- `<meta http-equiv="refresh" content="0; url=...">` for an instant redirect
|
||||
- `<link rel="canonical">` pointing to the lowercase URL
|
||||
- `<meta name="robots" content="noindex">` to prevent duplicate indexing
|
||||
|
||||
This preserves search engine rankings and ensures inbound links continue to work.
|
||||
|
||||
> [!note]
|
||||
> Case-preserving redirects have no effect on case-insensitive filesystems (macOS, Windows) where the server already resolves either casing to the same file. The plugin automatically detects the filesystem type and skips redirect generation when unnecessary.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
This plugin has no configuration options.
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `enableCaseRedirects`: If `true` (default), automatically generates redirect pages for URLs that changed casing due to v5's lowercase normalization. Set to `false` to disable this behavior.
|
||||
|
||||
## API
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: ArticleTitle
|
||||
description: Renders the article title as an h1 heading.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/article-title](https://github.com/quartz-community/article-title)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin renders the article title from the page's frontmatter as an `<h1>` heading at the top of the page content. It reads the `title` field from frontmatter (falling back to the filename if no title is set).
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Backlinks
|
||||
description: Shows pages that link to the current page.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/backlinks](https://github.com/quartz-community/backlinks)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Shows pages that link to the current page.
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
---
|
||||
title: BasesPage
|
||||
description: Renders Obsidian Bases files as database-style views.
|
||||
tags:
|
||||
- plugin/pageType
|
||||
- plugin/component
|
||||
image:
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/bases-page](https://github.com/quartz-community/bases-page)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin provides support for [Obsidian Bases](https://obsidian.md/changelog/2025-04-15-desktop-v1.8.0/) (`.base` files) in Quartz. It reads `.base` files from your vault, resolves matching notes based on the query definition, and renders them as interactive database-like views with support for tables, lists, cards, and maps. It uses the `default` [[layout#Page Frames|page frame]] (three-column layout with sidebars).
|
||||
This plugin provides support for [Obsidian Bases](https://obsidian.md/help/bases) (`.base` files) in Quartz. It reads `.base` files from your vault, resolves matching notes based on the query definition, and renders them as interactive database-like views with support for tables, lists, cards, and maps. It uses the `default` [[layout#Page Frames|page frame]] (three-column layout with sidebars).
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
@@ -36,6 +41,7 @@ This plugin provides support for [Obsidian Bases](https://obsidian.md/changelog/
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `defaultViewType`: The default view type when none is specified in the `.base` file. Defaults to `"table"`.
|
||||
- `linkResolution`: How to resolve internal links in view renderers. Should match `configuration.links.markdownLinkResolution` (built-in [[CrawlLinks|link processing]]). Can be `"absolute"`, `"relative"`, or `"shortest"`. Defaults to `"shortest"`.
|
||||
- `customViews`: A map of custom view renderers. Keys are view type names. These override built-in renderers for the same type, or add new view types. Requires a TS override.
|
||||
|
||||
### Default options
|
||||
@@ -50,6 +56,7 @@ For custom view renderers, use a TS override in `quartz.ts`:
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.BasesPage({
|
||||
defaultViewType: "table",
|
||||
customViews: {
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Breadcrumbs
|
||||
description: Breadcrumb navigation trail.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/breadcrumbs](https://github.com/quartz-community/breadcrumbs)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Navigation breadcrumb trail.
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: CNAME
|
||||
description: Emits a CNAME file for custom domain deployment.
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image:
|
||||
repository: "[quartz-community/cname](https://github.com/quartz-community/cname)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin emits a `CNAME` record that points your subdomain to the default domain of your site.
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
---
|
||||
title: CanvasPage
|
||||
description: Renders JSON Canvas files as interactive, pannable pages.
|
||||
tags:
|
||||
- plugin/pageType
|
||||
image: "#7852ee"
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/canvas-page](https://github.com/quartz-community/canvas-page)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin is a page type plugin that renders [JSON Canvas](https://jsoncanvas.org) (`.canvas`) files as interactive, pannable and zoomable canvas pages. It uses a custom `"canvas"` [[layout#Page Frames|page frame]] that provides a fullscreen, always-on canvas experience with a togglable left sidebar for navigation. It supports the full [JSON Canvas 1.0 spec](https://jsoncanvas.org/spec/1.0/), including text nodes with Markdown rendering, file nodes that link to other pages in your vault, link nodes for external URLs, and group nodes for visual organization. Edges between nodes are rendered as SVG paths with optional labels, arrow markers, and colors.
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Citations
|
||||
description: Academic citation and bibliography support via BibTeX.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image: https://images.unsplash.com/photo-1582079133805-43655f026448
|
||||
repository: "[quartz-community/citations](https://github.com/quartz-community/citations)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin adds Citation support to Quartz.
|
||||
@@ -16,7 +20,6 @@ This plugin accepts the following configuration options:
|
||||
- `suppressBibliography`: whether to suppress the bibliography at the end of the document. Defaults to `false`.
|
||||
- `linkCitations`: whether to link citations to the bibliography. Defaults to `false`.
|
||||
- `csl`: the citation style to use. Defaults to `apa`. Reference [rehype-citation](https://rehype-citation.netlify.app/custom-csl) for more options.
|
||||
- `prettyLink`: whether to use pretty links for citations. Defaults to `true`.
|
||||
|
||||
## API
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Comments
|
||||
description: Comment system integration (Giscus, Utterances, etc.).
|
||||
tags:
|
||||
- plugin/component
|
||||
image: "[[giscus-results.png]]"
|
||||
repository: "[quartz-community/comments](https://github.com/quartz-community/comments)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
Comment system (giscus, utterances, etc.).
|
||||
|
||||
@@ -1,29 +1,47 @@
|
||||
---
|
||||
title: ContentIndex
|
||||
description: Built-in content index, sitemap and RSS feed (formerly the content-index plugin). Configured under configuration.contentIndex.
|
||||
aliases:
|
||||
- contentIndex
|
||||
- content-index
|
||||
tags:
|
||||
- plugin/emitter
|
||||
- built-in
|
||||
image:
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin emits both RSS and an XML sitemap for your site. The [[RSS Feed]] allows users to subscribe to content on your site and the sitemap allows search engines to better index your site. The plugin also emits a `contentIndex.json` file which is used by dynamic frontend components like search and graph.
|
||||
The content index is [[built-in processing|built into Quartz]] (it used to be the `content-index` plugin). It emits both RSS and an XML sitemap for your site. The [[RSS Feed]] allows users to subscribe to content on your site and the sitemap allows search engines to better index your site. It also emits a `contentIndex.json` file which is used by dynamic frontend components like search and graph.
|
||||
|
||||
This plugin emits a comprehensive index of the site's content, generating additional resources such as a sitemap, an RSS feed, and a
|
||||
Configure it under `configuration.contentIndex` in `quartz.config.yaml`:
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
contentIndex:
|
||||
enableSiteMap: true
|
||||
enableRSS: true
|
||||
```
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
Options:
|
||||
|
||||
- `enableSiteMap`: If `true` (default), generates a sitemap XML file (`sitemap.xml`) listing all site URLs for search engines in content discovery.
|
||||
- `enableRSS`: If `true` (default), produces an RSS feed (`index.xml`) with recent content updates.
|
||||
- `rssLimit`: Defines the maximum number of entries to include in the RSS feed, helping to focus on the most recent or relevant content. Defaults to `10`.
|
||||
- `rssFullHtml`: If `true`, the RSS feed includes full HTML content. Otherwise it includes just summaries.
|
||||
- `rssFullHtml`: If `true`, the RSS feed includes the full rendered HTML content of each page. Defaults to `false`.
|
||||
- `rssSlug`: Slug to the generated RSS feed XML file. Defaults to `"index"`.
|
||||
- `includeEmptyFiles`: If `true` (default), content files with no body text are included in the generated index and resources.
|
||||
- `enabled`: set to `false` to emit none of these files ([[full-text search|search]], [[features/explorer|explorer]] and the [[graph view]] then have no data).
|
||||
|
||||
> [!note]
|
||||
> An existing `@quartz-community/content-index` entry is applied to `configuration.contentIndex` automatically. Run `npx quartz plugin doctor --fix` to move it.
|
||||
|
||||
## Adding fields
|
||||
|
||||
Plugins can add their own fields to each entry of `contentIndex.json` with `extendContentIndex` — see [[making plugins#Extending the content index]].
|
||||
|
||||
## API
|
||||
|
||||
- Category: Emitter
|
||||
- Function name: `ExternalPlugin.ContentIndex()`.
|
||||
- Source: [`quartz-community/content-index`](https://github.com/quartz-community/content-index)
|
||||
- Install: `npx quartz plugin add github:quartz-community/content-index`
|
||||
- Category: Emitter (built-in)
|
||||
- Source: [`quartz/plugins/builtins/contentIndex.ts`](https://github.com/jackyzha0/quartz/blob/v5/quartz/plugins/builtins/contentIndex.ts)
|
||||
- Can be replaced by a plugin that declares `quartz.capabilities.provides.files: ["static/contentIndex.json"]`.
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: ContentMeta
|
||||
description: Displays creation date and reading time.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/content-meta](https://github.com/quartz-community/content-meta)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin displays content metadata below the article title, such as the creation date and estimated reading time.
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: ContentPage
|
||||
description: Generates HTML pages for Markdown content.
|
||||
tags:
|
||||
- plugin/pageType
|
||||
image:
|
||||
repository: "[quartz-community/content-page](https://github.com/quartz-community/content-page)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin is a page type plugin for the Quartz framework. It generates the HTML pages for each piece of Markdown content. It emits the full-page [[layout]], including headers, footers, and body content, among others. It uses the `default` [[layout#Page Frames|page frame]] (three-column layout with sidebars). It is now configured in the `pageTypes` section of `quartz.config.yaml`.
|
||||
|
||||
+25
-12
@@ -1,18 +1,30 @@
|
||||
---
|
||||
title: CrawlLinks
|
||||
description: Built-in link resolution (formerly the crawl-links plugin). Configured under configuration.links.
|
||||
aliases:
|
||||
- links
|
||||
- crawl-links
|
||||
tags:
|
||||
- plugin/transformer
|
||||
- built-in
|
||||
image:
|
||||
enabled: true
|
||||
required: true
|
||||
---
|
||||
|
||||
This plugin parses links and processes them to point to the right places. It is also needed for embedded links (like images). See [[Obsidian compatibility]] for more information.
|
||||
Link processing is [[built-in processing|built into Quartz]] (it used to be the `crawl-links` plugin). It rewrites links and embedded resources (images, videos, SVG embeds, …) so they point to the right place from any page, adds the `internal` / `external` / `alias` / `broken` classes, and records each page's outgoing links in `file.data.links` — used by [[features/backlinks|backlinks]], the [[graph view]], the content index and the `has-backlinks` layout condition. See [[Obsidian compatibility]] for more information.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
Configure it under `configuration.links` in `quartz.config.yaml`:
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
links:
|
||||
markdownLinkResolution: shortest
|
||||
```
|
||||
|
||||
- `markdownLinkResolution`: Sets the strategy for resolving Markdown paths, can be `"absolute"` (default), `"relative"` or `"shortest"`. You should use the same setting here as in [[Obsidian compatibility|Obsidian]].
|
||||
Options:
|
||||
|
||||
- `markdownLinkResolution`: Sets the strategy for resolving Markdown paths, can be `"absolute"`, `"relative"` or `"shortest"` (default; the `crawl-links` plugin defaulted to `"absolute"`). You should use the same setting here as in [[Obsidian compatibility|Obsidian]].
|
||||
- `absolute`: Path relative to the root of the content folder.
|
||||
- `relative`: Path relative to the file you are linking from.
|
||||
- `shortest`: Name of the file. If this isn't enough to identify the file, use the full absolute path.
|
||||
@@ -20,14 +32,15 @@ This plugin accepts the following configuration options:
|
||||
- `openLinksInNewTab`: If `true`, configures external links to open in a new tab. Defaults to `false`.
|
||||
- `lazyLoad`: If `true`, adds lazy loading to resource elements (`img`, `video`, etc.) to improve page load performance. Defaults to `false`.
|
||||
- `externalLinkIcon`: Adds an icon next to external links when `true` (default) to visually distinguishing them from internal links.
|
||||
- `disableBrokenWikilinks`: If `true`, internal links whose resolved slug is not present in the site (i.e. no matching file under `markdownLinkResolution`) gain an additional `broken` CSS class alongside `internal`, so they can be styled distinctly. Defaults to `false`. Applies to both wikilinks and regular Markdown links, since both are indistinguishable `<a>` elements by the time this plugin runs.
|
||||
- `disableBrokenWikilinks`: If `true`, internal links whose resolved slug is not present in the site (i.e. no matching file under `markdownLinkResolution`) gain an additional `broken` CSS class alongside `internal`, so they can be styled distinctly. Defaults to `false`. Applies to both wikilinks and regular Markdown links, since both are indistinguishable `<a>` elements by the time links are processed.
|
||||
- `enabled`: set to `false` to turn link processing off (not recommended — links break on nested pages and backlinks/graph are empty).
|
||||
- `order`: position among transformers. Defaults to `60`, after the Markdown flavour plugins (e.g. [[ObsidianFlavoredMarkdown]] at `40`) that turn wikilinks into links.
|
||||
|
||||
> [!warning]
|
||||
> Removing this plugin is _not_ recommended and will likely break the page.
|
||||
> [!note]
|
||||
> An existing `@quartz-community/crawl-links` entry in `quartz.config.yaml` is applied to `configuration.links` automatically. Run `npx quartz plugin doctor --fix` to move it.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Transformer
|
||||
- Function name: `ExternalPlugin.CrawlLinks()`.
|
||||
- Source: [`quartz-community/crawl-links`](https://github.com/quartz-community/crawl-links)
|
||||
- Install: `npx quartz plugin add github:quartz-community/crawl-links`
|
||||
- Category: Transformer (built-in)
|
||||
- Source: [`quartz/plugins/builtins/links.ts`](https://github.com/jackyzha0/quartz/blob/v5/quartz/plugins/builtins/links.ts)
|
||||
- Can be replaced by a plugin that declares `quartz.capabilities.provides.data: ["links"]` (see [[built-in processing#Replacing a built-in]]).
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: CreatedModifiedDate
|
||||
description: Determines creation and modification dates from frontmatter, git, or filesystem.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
repository: "[quartz-community/created-modified-date](https://github.com/quartz-community/created-modified-date)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin determines the created, modified, and published dates for a document using three potential data sources: frontmatter metadata, Git history, and the filesystem. See [[authoring content#Syntax]] for more information.
|
||||
@@ -13,6 +17,7 @@ This plugin determines the created, modified, and published dates for a document
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `priority`: The data sources to consult for date information. Highest priority first. Possible values are `"frontmatter"`, `"git"`, and `"filesystem"`. Defaults to `["frontmatter", "git", "filesystem"]`.
|
||||
- `defaultDateType`: Which date type to use when displaying dates. Can be `"created"`, `"modified"`, or `"published"`. Defaults to `"modified"`.
|
||||
|
||||
When loading the frontmatter, the value of [[Frontmatter#List]] is used.
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Custom OG Images
|
||||
description: Generates Open Graph social preview images.
|
||||
tags:
|
||||
- feature/emitter
|
||||
image: "[[social-image-preview-dark.png]]"
|
||||
repository: "[quartz-community/og-image](https://github.com/quartz-community/og-image)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
The Custom OG Images emitter plugin generates social media preview images for your pages. It uses [satori](https://github.com/vercel/satori) to convert HTML/CSS into images, allowing you to create beautiful and consistent social media preview cards for your content.
|
||||
@@ -43,24 +47,30 @@ For the TS override approach (needed for custom `imageStructure`):
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
import { defaultImage } from "./quartz/plugins/emitters/ogImage"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.CustomOgImages({
|
||||
colorScheme: "lightMode",
|
||||
width: 1200,
|
||||
height: 630,
|
||||
excludeRoot: false,
|
||||
imageStructure: defaultImage, // custom JSX component — requires TS
|
||||
imageStructure: defaultImage,
|
||||
})
|
||||
```
|
||||
|
||||
### Configuration Options
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
| ---------------- | --------- | ------------ | ----------------------------------------------------------------- |
|
||||
| `colorScheme` | string | "lightMode" | Theme to use for generating images ("darkMode" or "lightMode") |
|
||||
| `width` | number | 1200 | Width of the generated image in pixels |
|
||||
| `height` | number | 630 | Height of the generated image in pixels |
|
||||
| `excludeRoot` | boolean | false | Whether to exclude the root index page from auto-generated images |
|
||||
| `imageStructure` | component | defaultImage | Custom component to use for image generation |
|
||||
| Option | Type | Default | Description |
|
||||
| ------------------------- | --------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `colorScheme` | string | "lightMode" | Theme to use for generating images ("darkMode" or "lightMode") |
|
||||
| `width` | number | 1200 | Width of the generated image in pixels |
|
||||
| `height` | number | 630 | Height of the generated image in pixels |
|
||||
| `excludeRoot` | boolean | false | Whether to exclude the root index page from auto-generated images |
|
||||
| `defaultTitle` | string | "Untitled" | Fallback title when a page has no title |
|
||||
| `defaultDescription` | string | "No description provided" | Fallback description when a page has no description |
|
||||
| `useGeneratedDescription` | boolean | true | Use a generated description (the [[Description]] plugin's excerpt of the page) when the frontmatter has none. Set to `false` to show `defaultDescription` instead |
|
||||
| `imageStructure` | component | defaultImage | Custom component to use for image generation |
|
||||
|
||||
The description on an image is, in order: the frontmatter's `socialDescription`, its `description`, the generated description (unless `useGeneratedDescription` is `false`), and finally `defaultDescription`. With the [[Description]] plugin enabled, every page with text has a generated description, so `defaultDescription` mostly shows with `useGeneratedDescription: false`.
|
||||
|
||||
## Frontmatter Properties
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Darkmode
|
||||
description: Toggle between light and dark themes.
|
||||
tags:
|
||||
- plugin/component
|
||||
image: "#0052cc"
|
||||
repository: "[quartz-community/darkmode](https://github.com/quartz-community/darkmode)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Dark mode toggle.
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Description
|
||||
description: Generates page descriptions for metadata and previews.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
repository: "[quartz-community/description](https://github.com/quartz-community/description)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin generates descriptions that are used as metadata for the HTML `head`, the [[RSS Feed]] and in [[folder and tag listings]] if there is no main body content, the description is used as the text between the title and the listing.
|
||||
@@ -14,7 +18,8 @@ If the frontmatter contains a `description` property, it is used (see [[authorin
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `descriptionLength`: the maximum length of the generated description. Default is 150 characters. The cut off happens after the first _sentence_ that ends after the given length.
|
||||
- `descriptionLength`: the target length of the generated description. Default is 150 characters. The cut off happens after the first _sentence_ that ends after the given length.
|
||||
- `maxDescriptionLength`: the hard maximum length of the description. If the generated description exceeds this, it is truncated with an ellipsis. Default is 300 characters.
|
||||
- `replaceExternalLinks`: If `true` (default), replace external links with their domain and path in the description (e.g. `https://domain.tld/some_page/another_page?query=hello&target=world` is replaced with `domain.tld/some_page/another_page`).
|
||||
|
||||
## API
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
---
|
||||
title: EncryptedPages
|
||||
description: Password-protected encrypted pages with shadow content index.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
- plugin/emitter
|
||||
image: "#FF1493"
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/encrypted-pages](https://github.com/quartz-community/encrypted-pages)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Password-protected encrypted pages. Encrypts page content at build time using AES-256-GCM and decrypts client-side with the Web Crypto API. Passwords are set per-page via frontmatter. A companion emitter writes an encrypted shadow content index so unlisted encrypted pages can be dynamically revealed in graph, explorer, and search after a successful decryption — without ever leaking their metadata to visitors who do not hold the password.
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: ExplicitPublish
|
||||
description: "Only publishes pages explicitly marked with publish: true."
|
||||
tags:
|
||||
- plugin/filter
|
||||
image:
|
||||
repository: "[quartz-community/explicit-publish](https://github.com/quartz-community/explicit-publish)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin filters content based on an explicit `publish` flag in the frontmatter, allowing only content that is explicitly marked for publication to pass through. It's the opt-in version of [[RemoveDrafts]]. See [[private pages]] for more information.
|
||||
@@ -12,6 +16,9 @@ This plugin filters content based on an explicit `publish` flag in the frontmatt
|
||||
|
||||
This plugin has no configuration options.
|
||||
|
||||
> [!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.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Filter
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Explorer
|
||||
description: File tree explorer sidebar.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/explorer](https://github.com/quartz-community/explorer)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
File tree explorer sidebar.
|
||||
@@ -19,7 +23,7 @@ This plugin accepts the following configuration options:
|
||||
**YAML options** (in `quartz.config.yaml`):
|
||||
|
||||
- `title`: The title of the explorer. Defaults to `Explorer`.
|
||||
- `folderClickBehavior`: The behavior when a folder is clicked. Can be `"link"` to navigate or `"collapse"` to toggle. Defaults to `collapse`.
|
||||
- `folderClickBehavior`: The behavior when a folder is clicked. Can be `"link"` to navigate or `"collapse"` to toggle. Defaults to `link`.
|
||||
- `folderDefaultState`: The default state of folders. Can be `"collapsed"` or `"open"`. Defaults to `collapsed`.
|
||||
- `useSavedState`: Whether to use local storage to save the state of the explorer. Defaults to `true`.
|
||||
|
||||
@@ -37,7 +41,7 @@ This plugin accepts the following configuration options:
|
||||
enabled: true
|
||||
options:
|
||||
title: Explorer
|
||||
folderClickBehavior: collapse
|
||||
folderClickBehavior: link
|
||||
folderDefaultState: collapsed
|
||||
useSavedState: true
|
||||
```
|
||||
@@ -47,6 +51,7 @@ This plugin accepts the following configuration options:
|
||||
```ts title="quartz.ts"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.Explorer({
|
||||
mapFn: (node) => {
|
||||
node.displayName = node.displayName.toUpperCase()
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Favicon
|
||||
description: Emits the site favicon.
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image:
|
||||
repository: "[quartz-community/favicon](https://github.com/quartz-community/favicon)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin emits a `favicon.ico` into the `public` folder. It creates the favicon from `icon.png` located in the `quartz/static` folder.
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: FolderPage
|
||||
description: Generates listing pages for folders.
|
||||
tags:
|
||||
- plugin/pageType
|
||||
image:
|
||||
repository: "[quartz-community/folder-page](https://github.com/quartz-community/folder-page)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin is a page type plugin that generates index pages for folders, creating a listing page for each folder that contains multiple content files. It uses the `default` [[layout#Page Frames|page frame]] (three-column layout with sidebars). See [[folder and tag listings]] for more information.
|
||||
@@ -14,7 +18,9 @@ Example: [[advanced/|Advanced]]
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `sort`: A function of type `(f1: QuartzPluginData, f2: QuartzPluginData) => number{:ts}` used to sort entries. Defaults to sorting by date and tie-breaking on lexographical order.
|
||||
- `showFolderCount`: Whether to display the number of pages in the folder. Defaults to `true`.
|
||||
- `showSubfolders`: Whether to include pages from subfolders in the listing. Defaults to `true`.
|
||||
- `sort`: A function of type `(f1: QuartzPluginData, f2: QuartzPluginData) => number{:ts}` used to sort entries. Defaults to sorting by date and tie-breaking on lexographical order. Requires a TS override.
|
||||
- `prefixFolders`: If `true`, generated folder page titles are prefixed with "Folder: " (e.g. "Folder: notes"). Defaults to `false`.
|
||||
|
||||
## API
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
---
|
||||
title: Fonts
|
||||
description: Fine-grained font control with per-heading support, Google Fonts integration, and theme font discovery.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
- plugin/emitter
|
||||
image:
|
||||
repository: "[quartz-community/fonts](https://github.com/quartz-community/fonts)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin provides fine-grained control over fonts in your Quartz site. It supports per-heading font families, automatic theme font discovery when used with [Quartz Themes](https://github.com/saberzero1/quartz-themes), Google Fonts integration with automatic weight and italic loading, and falls back to Obsidian's default system font stacks.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
## Why use Fonts?
|
||||
|
||||
Quartz uses three CSS variables for fonts: `--headerFont`, `--bodyFont`, and `--codeFont`. Obsidian themes use a different system with per-heading variables (`--h1-font` through `--h6-font`), `--font-text`, and `--font-monospace`. These two systems don't bridge correctly, causing heading fonts to not render as themes intend.
|
||||
|
||||
Fonts solves this by:
|
||||
|
||||
1. Bridging the Obsidian and Quartz font systems
|
||||
2. Emitting **unlayered** CSS that correctly overrides Quartz's base heading styles
|
||||
3. Providing per-heading font control that neither system offers alone
|
||||
4. Optionally loading fonts from Google Fonts with fine-grained weight and italic control
|
||||
|
||||
## Configuration
|
||||
|
||||
Font options accept either a CSS font-family string or an object with Google Fonts loading control:
|
||||
|
||||
```yaml
|
||||
# String form
|
||||
body: '"Inter", sans-serif'
|
||||
|
||||
# Object form (for Google Fonts weight/italic control)
|
||||
body:
|
||||
name: Inter
|
||||
weights: [400, 600, 700]
|
||||
includeItalic: true
|
||||
```
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
| --------------- | ------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
| `title` | `FontSpecification` | `header` value | Font family for the site title. |
|
||||
| `body` | `FontSpecification` | Obsidian default | Font family for body text. |
|
||||
| `header` | `FontSpecification` | Obsidian default | Default font family for all headings (h1-h6). |
|
||||
| `code` | `FontSpecification` | Obsidian default | Font family for code and monospace elements. |
|
||||
| `interface` | `FontSpecification` | Obsidian default | Font family for UI elements. |
|
||||
| `h1` – `h6` | `FontSpecification` | `header` value | Per-heading font family overrides. |
|
||||
| `useThemeFonts` | `boolean` | `true` | Use fonts from [Quartz Themes](https://github.com/saberzero1/quartz-themes) as defaults when it is installed. |
|
||||
| `fontOrigin` | `string` | `"googleFonts"` | `"googleFonts"` to load from Google Fonts CDN, `"selfHosted"` to download and serve locally, `"local"` for no loading. |
|
||||
|
||||
### Default options
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
options:
|
||||
useThemeFonts: true
|
||||
fontOrigin: googleFonts
|
||||
```
|
||||
|
||||
### Font resolution
|
||||
|
||||
Fonts are resolved using a priority chain:
|
||||
|
||||
```
|
||||
User config (plugin options)
|
||||
→ Theme fonts (from Quartz Themes, if installed)
|
||||
→ Obsidian defaults (system font stacks)
|
||||
```
|
||||
|
||||
For individual headings:
|
||||
|
||||
```
|
||||
h1 option → header option → theme --h1-font → theme font → Obsidian default
|
||||
```
|
||||
|
||||
For the site title:
|
||||
|
||||
```
|
||||
title option → header option → theme font → Obsidian default
|
||||
```
|
||||
|
||||
## Usage with Quartz Themes
|
||||
|
||||
When [Quartz Themes](https://github.com/saberzero1/quartz-themes) is installed and enabled, Fonts automatically discovers the theme's font metadata and uses it as defaults. Any options you explicitly set in Fonts will override the theme fonts.
|
||||
|
||||
Fonts must run **after** Quartz Themes. This is handled automatically by plugin ordering (Quartz Themes = 10, Fonts = 60).
|
||||
|
||||
> [!warning]
|
||||
> If Quartz Themes is enabled but hasn't run yet when Fonts executes, you'll see a warning in the console. Make sure Quartz Themes has a lower `defaultOrder` than Fonts.
|
||||
|
||||
## Usage without Quartz Themes
|
||||
|
||||
Fonts works standalone. Without a theme, it falls back to Obsidian's default system font stacks. You can set fonts explicitly via the plugin options.
|
||||
|
||||
## Examples
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
# Use theme fonts automatically (default behavior)
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
|
||||
# Override just the heading font
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
options:
|
||||
header: '"Playfair Display", serif'
|
||||
|
||||
# Full control with per-heading fonts
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
options:
|
||||
body: '"Inter", sans-serif'
|
||||
header: '"Playfair Display", serif'
|
||||
code: '"JetBrains Mono", monospace'
|
||||
h1: '"Playfair Display", serif'
|
||||
h2: '"Lora", serif'
|
||||
|
||||
# Load from Google Fonts automatically
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
options:
|
||||
fontOrigin: googleFonts
|
||||
body: Inter
|
||||
header: Playfair Display
|
||||
code: JetBrains Mono
|
||||
|
||||
# Google Fonts with weight/italic control
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
options:
|
||||
fontOrigin: googleFonts
|
||||
body:
|
||||
name: Inter
|
||||
weights: [400, 600, 700]
|
||||
includeItalic: true
|
||||
header:
|
||||
name: Playfair Display
|
||||
weights: [400, 700]
|
||||
code:
|
||||
name: JetBrains Mono
|
||||
weights: [400]
|
||||
|
||||
# Custom title font (separate from header)
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
options:
|
||||
fontOrigin: googleFonts
|
||||
title: Abril Fatface
|
||||
header: Playfair Display
|
||||
body: Inter
|
||||
code: JetBrains Mono
|
||||
|
||||
# Self-hosted fonts (downloaded at build time, no external requests)
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
options:
|
||||
fontOrigin: selfHosted
|
||||
body: Inter
|
||||
header: Playfair Display
|
||||
code: JetBrains Mono
|
||||
|
||||
# Ignore theme fonts entirely
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
options:
|
||||
useThemeFonts: false
|
||||
body: '"Inter", sans-serif'
|
||||
```
|
||||
|
||||
## Self-Hosted Fonts
|
||||
|
||||
When `fontOrigin: selfHosted` is set, Fonts downloads fonts from Google Fonts during the build and serves them from your site's `static/fonts/` directory. This makes your site fully self-contained with no external requests to Google at runtime.
|
||||
|
||||
At build time, the plugin:
|
||||
|
||||
1. Fetches the Google Fonts CSS for your configured fonts
|
||||
2. Downloads each font file (`.woff2`, `.woff`, etc.)
|
||||
3. Writes the font files to `static/fonts/` in your build output
|
||||
4. Generates a `quartz-fonts.css` file with `@font-face` rules pointing to the local files
|
||||
|
||||
> [!note]
|
||||
> Self-hosted fonts require `baseUrl` to be set in your Quartz configuration, since font URLs in the CSS need an absolute path.
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
baseUrl: "example.com"
|
||||
|
||||
plugins:
|
||||
- source: github:quartz-community/fonts
|
||||
enabled: true
|
||||
options:
|
||||
fontOrigin: selfHosted
|
||||
body: Inter
|
||||
header: Playfair Display
|
||||
code: JetBrains Mono
|
||||
```
|
||||
|
||||
## Google Fonts Validation
|
||||
|
||||
When `fontOrigin: googleFonts` is set and the optional [`google-font-metadata`](https://www.npmjs.com/package/google-font-metadata) package is installed, Fonts validates your font configuration at build time:
|
||||
|
||||
- Checks that font family names exist in Google Fonts.
|
||||
- Warns if requested weights are not available for a font.
|
||||
- Warns if italic is requested but the font doesn't support it.
|
||||
|
||||
Install it to enable validation:
|
||||
|
||||
```bash
|
||||
npm install google-font-metadata
|
||||
```
|
||||
|
||||
Validation warnings are logged to the console but do not block the build.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Transformer, Emitter
|
||||
- Function name: `ExternalPlugin.Fonts()` (transformer), `ExternalPlugin.FontsEmitter()` (emitter).
|
||||
- Source: [`quartz-community/fonts`](https://github.com/quartz-community/fonts)
|
||||
- Install: `npx quartz plugin add github:quartz-community/fonts`
|
||||
@@ -1,11 +1,15 @@
|
||||
---
|
||||
title: Footer
|
||||
description: Page footer with configurable links and text.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/footer](https://github.com/quartz-community/footer)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin renders a footer at the bottom of the page with a "Created with Quartz" message and a set of configurable links.
|
||||
This plugin renders a footer at the bottom of the page with a "Created with Quartz" message, an optional message of your own and a set of configurable links.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
@@ -15,6 +19,9 @@ This plugin renders a footer at the bottom of the page with a "Created with Quar
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `links`: A map of link labels to their URLs to display in the footer. Defaults to `{}`.
|
||||
- `message`: Extra text shown below the "Created with Quartz" line, e.g. a license notice or contact details. HTML is allowed: `'Licensed under <a href="/license">CC BY 4.0</a>'`. Not set by default.
|
||||
|
||||
To change the footer further (styles, different markup), see [[customizing components]].
|
||||
|
||||
### Default options
|
||||
|
||||
|
||||
+31
-16
@@ -3,33 +3,50 @@ title: Frontmatter
|
||||
aliases:
|
||||
- note-properties
|
||||
- Note Properties
|
||||
description: Parses frontmatter and displays note properties in a collapsible panel.
|
||||
description: Built-in frontmatter parsing, plus the note-properties plugin that displays properties in a collapsible panel.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
- plugin/component
|
||||
- built-in
|
||||
publish: true
|
||||
enableToc: true
|
||||
image:
|
||||
repository: "[quartz-community/note-properties](https://github.com/quartz-community/note-properties)"
|
||||
enabled: true
|
||||
required: true
|
||||
---
|
||||
|
||||
This plugin parses the frontmatter of the page using the [gray-matter](https://github.com/jonschlinkert/gray-matter) library and optionally displays selected properties in a collapsible panel. See [[authoring content#Syntax]], [[Obsidian compatibility]] and [[OxHugo compatibility]] for more information.
|
||||
Frontmatter parsing is [[built-in processing|built into Quartz]]: every page's frontmatter is parsed with [gray-matter](https://github.com/jonschlinkert/gray-matter) and normalised (see [[#Supported frontmatter]]). Displaying properties on the page is done by the optional `note-properties` plugin ([[#Properties panel]]). See [[authoring content#Syntax]], [[Obsidian compatibility]] and [[OxHugo compatibility]] for more information.
|
||||
|
||||
## Parsing (built-in)
|
||||
|
||||
Configure it under `configuration.frontmatter` in `quartz.config.yaml`:
|
||||
|
||||
- `delimiters`: the delimiters to use for the frontmatter. Can have one value (e.g. `"---"`) or separate values for opening and closing delimiters (e.g. `["---", "~~~"]`). Defaults to `"---"`.
|
||||
- `language`: the language to use for parsing the frontmatter. Can be `yaml` (default) or `toml`.
|
||||
- `enabled`: set to `false` to turn parsing off — only useful when a plugin replaces it (see [[built-in processing#Replacing a built-in]]).
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
configuration:
|
||||
frontmatter:
|
||||
language: toml
|
||||
delimiters: "+++"
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> These two options used to be set on the note-properties plugin. If they are still there, they are applied automatically; `npx quartz plugin doctor --fix` moves them.
|
||||
|
||||
## Properties panel plugin (note-properties)
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
> [!warning]
|
||||
> This plugin must not be removed, otherwise Quartz will break.
|
||||
The `note-properties` plugin accepts the following configuration options:
|
||||
|
||||
## Configuration
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `delimiters`: the delimiters to use for the frontmatter. Can have one value (e.g. `"---"`) or separate values for opening and closing delimiters (e.g. `["---", "~~~"]`). Defaults to `"---"`.
|
||||
- `language`: the language to use for parsing the frontmatter. Can be `yaml` (default) or `toml`.
|
||||
- `includeAll`: include all frontmatter properties in the properties panel. When `false`, only `includedProperties` are shown. Defaults to `false`.
|
||||
- `includedProperties`: properties to include when `includeAll` is `false`. Defaults to `["description", "tags", "aliases"]`.
|
||||
- `excludedProperties`: properties to always exclude from display, even when `includeAll` is `true`. Defaults to `[]`.
|
||||
- `hidePropertiesView`: hide the visual properties panel while still processing frontmatter. Useful if you only need frontmatter parsing without the UI. Defaults to `false`.
|
||||
- `hidePropertiesView`: hide the visual properties panel by default (it can still be shown per note, see [[#Per-note overrides]]). Defaults to `false`. To never show it, disable the plugin — frontmatter is parsed either way.
|
||||
|
||||
### Default options
|
||||
|
||||
@@ -44,8 +61,6 @@ This plugin accepts the following configuration options:
|
||||
- aliases
|
||||
excludedProperties: []
|
||||
hidePropertiesView: false
|
||||
delimiters: "---"
|
||||
language: yaml
|
||||
```
|
||||
|
||||
## Properties panel
|
||||
@@ -87,7 +102,7 @@ Quartz supports the following frontmatter fields. Where multiple keys are listed
|
||||
| Description | `description` | Page description for metadata and search. |
|
||||
| Tags | `tags`, `tag` | Categorization tags. Slugified the same way as file paths: spaces become `-`, `&` becomes `-and-`, `%` becomes `-percent`, and tags are lowercased so that `#MyTag` and `#mytag` resolve to the same tag page (matching Obsidian). |
|
||||
| Aliases | `aliases`, `alias` | Alternative names for the page, used for link resolution. |
|
||||
| Permalink | `permalink` | Custom URL slug. Also added to aliases. |
|
||||
| Permalink | `permalink` | The page's address (Obsidian Publish): published at this path; its file path redirects there. |
|
||||
| CSS classes | `cssclasses`, `cssclass` | CSS classes applied to the page body. |
|
||||
| Social image | `socialImage`, `image`, `cover` | Image used for social media previews. |
|
||||
| Social description | `socialDescription` | Description used specifically for social media previews. |
|
||||
@@ -102,7 +117,7 @@ Quartz supports the following frontmatter fields. Where multiple keys are listed
|
||||
|
||||
## API
|
||||
|
||||
- Category: Transformer, Component
|
||||
- Function name: `ExternalPlugin.NoteProperties()`.
|
||||
- Parsing: built-in transformer, [`quartz/plugins/builtins/frontmatter.ts`](https://github.com/jackyzha0/quartz/blob/v5/quartz/plugins/builtins/frontmatter.ts)
|
||||
- Properties panel: Transformer, Component — `ExternalPlugin.NoteProperties()`.
|
||||
- Source: [`quartz-community/note-properties`](https://github.com/quartz-community/note-properties)
|
||||
- Install: `npx quartz plugin add github:quartz-community/note-properties`
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: GitHubFlavoredMarkdown
|
||||
description: GitHub Flavored Markdown support (tables, task lists, footnotes, strikethrough).
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
repository: "[quartz-community/github-flavored-markdown](https://github.com/quartz-community/github-flavored-markdown)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin enhances Markdown processing to support GitHub Flavored Markdown (GFM) which adds features like autolink literals, footnotes, strikethrough, tables and tasklists.
|
||||
|
||||
+15
-10
@@ -1,8 +1,12 @@
|
||||
---
|
||||
title: Graph
|
||||
description: Interactive link graph visualization.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/graph](https://github.com/quartz-community/graph)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Interactive graph visualization.
|
||||
@@ -24,16 +28,16 @@ Both `localGraph` and `globalGraph` accept the following options:
|
||||
- `drag`: Enable dragging nodes. Defaults to `true`.
|
||||
- `zoom`: Enable zooming. Defaults to `true`.
|
||||
- `depth`: The depth of the graph. Defaults to `1` for local and `-1` for global.
|
||||
- `scale`: The initial scale of the graph.
|
||||
- `repelForce`: The force that pushes nodes apart.
|
||||
- `centerForce`: The force that pulls nodes to the center.
|
||||
- `linkDistance`: The distance between linked nodes.
|
||||
- `fontSize`: The font size of node labels.
|
||||
- `opacityScale`: The scale of node opacity.
|
||||
- `removeTags`: Tags to exclude from the graph.
|
||||
- `showTags`: Whether to show tags in the graph.
|
||||
- `enableRadial`: Whether to enable radial layout.
|
||||
- `focusOnHover`: Whether to focus on the hovered node (global only).
|
||||
- `scale`: The initial scale of the graph. Defaults to `1.1` for local and `0.9` for global.
|
||||
- `repelForce`: The force that pushes nodes apart. Defaults to `0.5`.
|
||||
- `centerForce`: The force that pulls nodes to the center. Defaults to `0.3` for local and `0.2` for global.
|
||||
- `linkDistance`: The distance between linked nodes. Defaults to `30`.
|
||||
- `fontSize`: The font size of node labels. Defaults to `0.6`.
|
||||
- `opacityScale`: The scale of node opacity. Defaults to `1`.
|
||||
- `removeTags`: Tags to exclude from the graph. Defaults to `[]`.
|
||||
- `showTags`: Whether to show tags in the graph. Defaults to `true`.
|
||||
- `enableRadial`: Whether to enable radial layout. Defaults to `false` for local and `true` for global.
|
||||
- `focusOnHover`: Whether to focus on the hovered node. Defaults to `false` for local and `true` for global.
|
||||
|
||||
### Default options
|
||||
|
||||
@@ -53,6 +57,7 @@ Both `localGraph` and `globalGraph` accept the following options:
|
||||
opacityScale: 1
|
||||
removeTags: []
|
||||
showTags: true
|
||||
focusOnHover: false
|
||||
enableRadial: false
|
||||
globalGraph:
|
||||
drag: true
|
||||
|
||||
Loaded 100 of 233 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user