mirror of
https://github.com/jackyzha0/quartz
synced 2026-11-30 22:44:41 +01:00
Compare commits
292
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
041de1c692 | ||
|
|
075afd3f71 | ||
|
|
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 | ||
|
|
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 | ||
|
|
6a2bb304d2 | ||
|
|
8e45841e34 | ||
|
|
a85c3bd814 | ||
|
|
dfc2369140 | ||
|
|
710db1f161 | ||
|
|
4ffe041f13 | ||
|
|
b3082c32dc | ||
|
|
ff19a3bf38 | ||
|
|
dc88017b37 | ||
|
|
4fc6be7850 | ||
|
|
e15b3da014 | ||
|
|
f370898c56 | ||
|
|
cab4b523df | ||
|
|
6c3b94e474 | ||
|
|
c32d11cb8b | ||
|
|
0572f06d08 | ||
|
|
17d5ae76bf | ||
|
|
f711071020 | ||
|
|
85563ffaab | ||
|
|
6def58c0d0 | ||
|
|
5f513a80bb | ||
|
|
9c118804a9 | ||
|
|
5bec6fb87b | ||
|
|
b9d4298321 | ||
|
|
64001920a0 | ||
|
|
64802f858b | ||
|
|
7e01af6a4d | ||
|
|
232781cbca | ||
|
|
2c1d9b5fb6 | ||
|
|
b8b71edffe | ||
|
|
d2e2df8518 | ||
|
|
afa63033cc | ||
|
|
9d26e48dc5 | ||
|
|
341b800663 | ||
|
|
07c9bb6976 | ||
|
|
512d48d719 | ||
|
|
bbcaa22413 | ||
|
|
7a86a76f44 | ||
|
|
c4c6016755 | ||
|
|
f5b66ec3f0 | ||
|
|
0f84b66cea | ||
|
|
88337abbe1 | ||
|
|
2bf6cb655b | ||
|
|
5c934ca1c6 | ||
|
|
9c62152257 | ||
|
|
287d41b2ac | ||
|
|
1f555cf6c4 | ||
|
|
e0fadf7e77 | ||
|
|
31ca75e762 | ||
|
|
0c50cca1f6 | ||
|
|
b7885ce779 | ||
|
|
1d5d069174 | ||
|
|
2a6117142c | ||
|
|
52e4257bda | ||
|
|
785ac92347 | ||
|
|
c0d3a30fdd | ||
|
|
2180e2e17b | ||
|
|
712b4477b7 | ||
|
|
00c4e392ff | ||
|
|
1342728ce2 | ||
|
|
84ee01f790 | ||
|
|
8e7100a562 | ||
|
|
3012aa01ea | ||
|
|
04912ac2e5 | ||
|
|
db2cc6abca | ||
|
|
704484d6a5 | ||
|
|
0b377b36d6 | ||
|
|
442159a21c | ||
|
|
13f8d5b41b | ||
|
|
4a8b10f60d | ||
|
|
dce936ffd4 | ||
|
|
31ad9edd2a | ||
|
|
144b7d9a4a | ||
|
|
a876a1e11e | ||
|
|
8a98878e5c | ||
|
|
328ef01c67 | ||
|
|
2d579c0f9e | ||
|
|
f881d5e332 | ||
|
|
6d08b5f070 | ||
|
|
96bf848aa9 | ||
|
|
31d5c025b2 | ||
|
|
434c166ed0 | ||
|
|
c1de25ebe8 | ||
|
|
619a3b7f0f | ||
|
|
b61e023759 | ||
|
|
d9bfbf876f | ||
|
|
28414da76e | ||
|
|
c7b527ae9f | ||
|
|
d413917f8f | ||
|
|
f7ead71ee5 | ||
|
|
67c5433fe6 | ||
|
|
4c854f845c | ||
|
|
627fa78f19 | ||
|
|
b4e07a560e | ||
|
|
de4826a83f | ||
|
|
49a1ddfd84 | ||
|
|
cd17a74eeb | ||
|
|
cc6cb46114 | ||
|
|
954306ab21 | ||
|
|
da6c498dc9 | ||
|
|
db11f757c2 | ||
|
|
c65fb652d2 | ||
|
|
7cd15f5aba | ||
|
|
1b999a792f | ||
|
|
75aef3b0a9 | ||
|
|
f2c2a31292 | ||
|
|
166b9c87d8 | ||
|
|
a7dca22667 | ||
|
|
bd32a98749 | ||
|
|
219bed15bf | ||
|
|
7b85aa3464 | ||
|
|
b2ae694b9a | ||
|
|
51b05e79e2 | ||
|
|
13a25cbfaf | ||
|
|
94cb313ce6 | ||
|
|
02488d07b2 | ||
|
|
d792d8ebf9 | ||
|
|
a932000421 | ||
|
|
56a801345a | ||
|
|
f7f33444ca | ||
|
|
7e28a970e7 | ||
|
|
49caf725dd | ||
|
|
24634934d1 | ||
|
|
4bb075cc64 | ||
|
|
14328062da | ||
|
|
6ec256dcbc | ||
|
|
52ca3aef4c | ||
|
|
0f67327a6c | ||
|
|
b2971bde6b | ||
|
|
cc8756b0c7 | ||
|
|
b11bad1326 | ||
|
|
f8c9a2926d | ||
|
|
1b878e655e | ||
|
|
a7d91f05f9 | ||
|
|
821e124ca2 | ||
|
|
cd8abda27c | ||
|
|
cdda0dc520 | ||
|
|
b0724bf99d | ||
|
|
341b8b3779 | ||
|
|
85680868b7 | ||
|
|
6dbb287c14 | ||
|
|
171ddcf753 | ||
|
|
5ec3f4a13a |
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v5
|
||||
@@ -33,7 +33,18 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- run: npm ci
|
||||
- name: Cache Quartz plugins
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .quartz/plugins
|
||||
key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
|
||||
- run: npm install
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
|
||||
- name: Check types and style
|
||||
run: npm run check
|
||||
|
||||
@@ -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: |
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -122,3 +122,14 @@ views:
|
||||
- formula.section
|
||||
- formula.last_modified
|
||||
limit: 24
|
||||
- type: cards
|
||||
name: Image Cards
|
||||
filters:
|
||||
and:
|
||||
- file.folder == "plugins"
|
||||
- "!image.isEmpty()"
|
||||
order:
|
||||
- file.name
|
||||
image: note.image
|
||||
cardSize: 220
|
||||
imageAspectRatio: 1
|
||||
@@ -50,6 +50,26 @@ This question is best answered by tracing what happens when a user (you!) runs `
|
||||
2. If it's not, we wire up the `"nav"` event to just be fired a single time after page load to allow for consistency across how state is setup across both SPA and non-SPA contexts.
|
||||
3. A separate `"render"` event can be dispatched when the DOM is updated in-place without a full navigation (e.g. after content decryption). Components that attach listeners to content elements should listen for both `"nav"` and `"render"`.
|
||||
|
||||
## Community Package Layering
|
||||
|
||||
Quartz v5 separates shared code into three community packages, each with a distinct responsibility:
|
||||
|
||||
- **`@quartz-community/types`** — Type definitions, interfaces, and the canonical `vfile` DataMap augmentation. This is the "contract" between Quartz and plugins. It has no runtime dependencies.
|
||||
- **`@quartz-community/utils`** — Shared utility functions (path manipulation, DOM helpers, sorting, date formatting, JSX conversion, etc.). Depends on `@quartz-community/types`.
|
||||
- **`@quartz-community/runtime`** — Browser-only utilities for client-side scripts (event handling, navigation, storage, script loading). Depends on both `types` and `utils`.
|
||||
|
||||
```
|
||||
types (no deps)
|
||||
↑
|
||||
utils (depends on types)
|
||||
↑
|
||||
runtime (depends on types + utils)
|
||||
↑
|
||||
plugins (depend on any combination)
|
||||
```
|
||||
|
||||
Plugins should import types from `@quartz-community/types`, utility functions from `@quartz-community/utils`, and browser utilities from `@quartz-community/runtime`. This layering ensures plugins don't depend on Quartz core.
|
||||
|
||||
## Plugin System
|
||||
|
||||
Page types define how a category of pages is rendered. They are configured in the `pageTypes` array in `quartz.config.yaml`.
|
||||
@@ -64,6 +84,9 @@ There are now four plugin categories:
|
||||
- **Filters**: Filter content (remove drafts, explicit publish)
|
||||
- **Emitters**: Reduce over content (generate RSS, sitemaps, alias redirects, OG images)
|
||||
- **Page Types**: Define how pages are rendered. Each page type handles a specific kind of page (content notes, folder listings, tag listings, 404). The `PageTypeDispatcher` emitter routes pages to the appropriate page type plugin based on the content.
|
||||
- **Bases Views**: Custom view renderers for the `bases-page` plugin's database-like view system. Plugins can register new view types (e.g., timeline, kanban) via the `ViewRegistry`. See [[making plugins#Bases Views]] for details.
|
||||
|
||||
Note that plugin types are **not mutually exclusive** — a single plugin can be a transformer AND provide components (e.g., `obsidian-flavored-markdown`), or be a page type AND provide custom frames (e.g., `canvas-page`).
|
||||
|
||||
### Plugin Resolution
|
||||
|
||||
@@ -77,8 +100,8 @@ When `npx quartz plugin add github:quartz-community/explorer` is run:
|
||||
### Plugin CLI Commands
|
||||
|
||||
- `npx quartz plugin add github:quartz-community/<name>` — Install a community plugin
|
||||
- `npx quartz plugin update` — Update all plugins to latest commits
|
||||
- `npx quartz plugin restore` — Restore plugins from locked commits in `quartz.lock.json` (used in CI/CD)
|
||||
- `npx quartz plugin install --latest` — Update all plugins to latest commits
|
||||
- `npx quartz plugin install --clean` — Restore plugins from locked commits in `quartz.lock.json` (used in CI/CD)
|
||||
- `npx quartz plugin remove <name>` — Remove an installed plugin
|
||||
|
||||
### Plugin Structure
|
||||
|
||||
@@ -109,6 +109,23 @@ 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.
|
||||
|
||||
### Internationalization
|
||||
|
||||
Component plugins should use the i18n pattern for any user-facing strings. See [[making plugins#Internationalization (i18n)]] for the full setup guide.
|
||||
|
||||
Quick reference:
|
||||
|
||||
```tsx
|
||||
import { i18n } from "../i18n"
|
||||
|
||||
const MyComponent: QuartzComponent = ({ cfg }) => {
|
||||
const t = i18n(cfg.locale ?? "en-US").components.myComponent
|
||||
return <h2>{t.title}</h2>
|
||||
}
|
||||
```
|
||||
|
||||
Always provide at least an `en-US` locale as the fallback. Additional locales are optional but encouraged for international reach.
|
||||
|
||||
### Scripts and Interactivity
|
||||
|
||||
For interactivity, you can declare `.beforeDOMLoaded` and `.afterDOMLoaded` properties on the component. These should be strings containing the JavaScript to be executed in the browser.
|
||||
@@ -201,6 +218,37 @@ export const layout = await loadQuartzLayout({
|
||||
})
|
||||
```
|
||||
|
||||
### Receiving YAML Options in Component-Only Plugins
|
||||
|
||||
Component plugins that also belong to a processing category (transformer, filter, emitter, page type) receive options through their factory function automatically. However, **component-only plugins** — those whose manifest declares only `"category": ["component"]` — are loaded via side-effect import and don't go through the factory path.
|
||||
|
||||
To receive YAML options in a component-only plugin, export an `init` function from your entry point:
|
||||
|
||||
```ts title="src/index.ts"
|
||||
export function init(options?: Record<string, unknown>): void {
|
||||
// options contains merged defaultOptions + user's YAML options
|
||||
const myFlag = (options?.myFlag as boolean) ?? false
|
||||
// Use options to configure registrations, global state, etc.
|
||||
}
|
||||
```
|
||||
|
||||
Quartz's config-loader calls `init()` after importing the module, passing the merged result of your manifest's `defaultOptions` and the user's `options` from `quartz.config.yaml`. The merge follows the same `{ ...defaultOptions, ...userOptions }` pattern used for processing plugins — user values take precedence.
|
||||
|
||||
Declare your defaults in `package.json`:
|
||||
|
||||
```json title="package.json"
|
||||
{
|
||||
"quartz": {
|
||||
"category": ["component"],
|
||||
"defaultOptions": {
|
||||
"myFlag": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If your plugin does not export `init`, it continues to work as a pure side-effect import — this is fully backward compatible.
|
||||
|
||||
## Internal Components
|
||||
|
||||
Quartz also has internal components that provide layout utilities. These live in `quartz/components/` and are primarily used for structural purposes:
|
||||
|
||||
+220
-10
@@ -63,6 +63,25 @@ The plugin's `package.json` should declare dependencies on `@quartz-community/ty
|
||||
|
||||
## Plugin Types
|
||||
|
||||
## Choosing a Plugin Type
|
||||
|
||||
Quartz supports six plugin capabilities. A single plugin can combine multiple types.
|
||||
|
||||
| I want to... | Plugin Type |
|
||||
| ------------------------------------------------ | ----------- |
|
||||
| Transform Markdown/HTML content | Transformer |
|
||||
| Decide which pages to publish | Filter |
|
||||
| Generate output files (RSS, sitemaps, manifests) | Emitter |
|
||||
| Define how a category of pages renders | Page Type |
|
||||
| Add a UI component to the layout | Component |
|
||||
| Add a custom view to the Bases database system | Bases View |
|
||||
|
||||
These are **not mutually exclusive**. For example:
|
||||
|
||||
- `obsidian-flavored-markdown` is both a **transformer** (processes OFM syntax) and provides **components** (mermaid rendering)
|
||||
- `canvas-page` is a **page type** that also provides a custom **frame**
|
||||
- A plugin could be a **transformer** that adds metadata AND a **component** that displays it
|
||||
|
||||
### Transformers
|
||||
|
||||
Transformers **map** over content, taking a Markdown file and outputting modified content or adding metadata to the file itself.
|
||||
@@ -393,13 +412,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>
|
||||
)
|
||||
},
|
||||
@@ -409,7 +428,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:**
|
||||
@@ -466,7 +485,87 @@ When a user installs your plugin, Quartz automatically loads the frame from the
|
||||
> [!tip]
|
||||
> See the [`canvas-page`](https://github.com/quartz-community/canvas-page) plugin for a complete real-world example of a plugin-provided frame.
|
||||
|
||||
## Building and Testing
|
||||
### Bases Views
|
||||
|
||||
The `bases-page` plugin provides a database-like view system similar to Obsidian Bases. Other plugins can register custom view types via the `ViewRegistry`:
|
||||
|
||||
```ts
|
||||
import { viewRegistry } from "@quartz-community/bases-page";
|
||||
import type { ViewTypeRegistration } from "@quartz-community/bases-page";
|
||||
|
||||
viewRegistry.register({
|
||||
id: "timeline",
|
||||
name: "Timeline",
|
||||
icon: "git-branch",
|
||||
render: ({ entries, view, slug, allSlugs }) => (
|
||||
<div class="bases-timeline">
|
||||
{entries.map(entry => <div>{entry.properties.title}</div>)}
|
||||
</div>
|
||||
),
|
||||
css: `.bases-timeline { display: flex; flex-direction: column; }`,
|
||||
afterDOMLoaded: `document.addEventListener("nav", () => { /* setup */ })`,
|
||||
});
|
||||
```
|
||||
|
||||
Each view registration includes:
|
||||
|
||||
- `id`: Unique identifier (e.g., `"timeline"`, `"kanban"`)
|
||||
- `name`: Display name shown in the view selector
|
||||
- `icon`: Optional Lucide icon name
|
||||
- `render`: Function that receives `ViewRendererProps` and returns Preact JSX
|
||||
- `css`: Optional CSS string (deduplicated by view ID)
|
||||
- `afterDOMLoaded`: Optional client-side script (same lifecycle as component scripts)
|
||||
- `options`: Optional configuration passed to every render invocation
|
||||
|
||||
The `ViewRegistry` is a global singleton (via `Symbol.for`) ensuring all copies of the module share the same registry.
|
||||
|
||||
## 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).
|
||||
|
||||
### 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
|
||||
@@ -475,6 +574,108 @@ npm run build
|
||||
npx tsup
|
||||
```
|
||||
|
||||
## What to Import from Where
|
||||
|
||||
| You need... | Import from |
|
||||
| ---------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
||||
| Type definitions (`QuartzTransformerPlugin`, `QuartzComponent`, etc.) | `@quartz-community/types` |
|
||||
| Path utilities (`simplifySlug`, `resolveRelative`, `pathToRoot`) | `@quartz-community/utils/path` |
|
||||
| DOM utilities (`removeAllChildren`, `registerEscapeHandler`) | `@quartz-community/utils/dom` |
|
||||
| JSX conversion (`htmlToJsx`) | `@quartz-community/utils/jsx` |
|
||||
| Language utilities (`classNames`, `capitalize`) | `@quartz-community/utils/lang` |
|
||||
| Date/sort utilities (`formatDate`, `getDate`, `byDateAndAlphabetical`) | `@quartz-community/utils/date` and `@quartz-community/utils/sort` |
|
||||
| HTML escaping (`escapeHTML`, `unescapeHTML`) | `@quartz-community/utils/escape` |
|
||||
| Emoji utilities (`getIconCode`) | `@quartz-community/utils/emoji` |
|
||||
| Browser runtime (`onNav`, `onRender`, `fetchContentIndex`) | `@quartz-community/runtime` |
|
||||
|
||||
Do **not** import from `@jackyzha0/quartz` or from `vfile` directly. Use the community packages instead.
|
||||
|
||||
## Internationalization (i18n)
|
||||
|
||||
Plugins should provide their own translations for user-facing strings. Do **not** hardcode strings in components.
|
||||
|
||||
### Setting Up i18n
|
||||
|
||||
Create the following structure:
|
||||
|
||||
```
|
||||
src/i18n/
|
||||
├── index.ts
|
||||
└── locales/
|
||||
└── en-US.ts
|
||||
```
|
||||
|
||||
**`src/i18n/locales/en-US.ts`** (required base locale):
|
||||
|
||||
```ts
|
||||
export default {
|
||||
components: {
|
||||
myPlugin: {
|
||||
title: "My Plugin",
|
||||
description: "A description",
|
||||
itemCount: ({ count }: { count: number }) => (count === 1 ? "1 item" : `${count} items`),
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
**`src/i18n/index.ts`**:
|
||||
|
||||
```ts
|
||||
import enUS from "./locales/en-US"
|
||||
|
||||
const locales: Record<string, typeof enUS> = {
|
||||
"en-US": enUS,
|
||||
}
|
||||
|
||||
export function i18n(locale: string) {
|
||||
return locales[locale] || enUS
|
||||
}
|
||||
```
|
||||
|
||||
### Using i18n in Components
|
||||
|
||||
```tsx
|
||||
import { i18n } from "../i18n"
|
||||
|
||||
const MyComponent: QuartzComponent = ({ cfg }) => {
|
||||
const locale = cfg.locale ?? "en-US"
|
||||
const t = i18n(locale).components.myPlugin
|
||||
return <h2>{t.title}</h2>
|
||||
}
|
||||
```
|
||||
|
||||
### Adding Translations
|
||||
|
||||
To add a new locale, copy `en-US.ts`, translate the strings, and register it:
|
||||
|
||||
```ts
|
||||
// src/i18n/locales/fr-FR.ts
|
||||
export default {
|
||||
components: {
|
||||
myPlugin: {
|
||||
title: "Mon Plugin",
|
||||
description: "Une description",
|
||||
itemCount: ({ count }: { count: number }) =>
|
||||
count === 1 ? "1 élément" : `${count} éléments`,
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
```ts
|
||||
// src/i18n/index.ts
|
||||
import enUS from "./locales/en-US"
|
||||
import frFR from "./locales/fr-FR"
|
||||
|
||||
const locales: Record<string, typeof enUS> = {
|
||||
"en-US": enUS,
|
||||
"fr-FR": frFR,
|
||||
}
|
||||
```
|
||||
|
||||
Use [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) locale codes (e.g., `en-US`, `de-DE`, `ja-JP`, `zh-CN`). For dynamic content, use function-based translations as shown with `itemCount` above.
|
||||
|
||||
## Installing Your Plugin
|
||||
|
||||
```shell
|
||||
@@ -482,7 +683,7 @@ npx tsup
|
||||
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:
|
||||
@@ -490,14 +691,21 @@ plugins:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
Or via TS override in `quartz.ts`:
|
||||
For options that require JavaScript callback functions (not expressible in YAML), use the TS override in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
// ...
|
||||
transformers: [ExternalPlugin.MyPlugin()]
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.MyPlugin({
|
||||
customFn: (data) => {
|
||||
// ...
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
During plugin development, you'll frequently install and uninstall your plugin to test changes. The following commands help manage this cycle:
|
||||
@@ -514,10 +722,10 @@ If you've updated your `quartz.config.yaml` to reference a plugin that isn't ins
|
||||
|
||||
```shell
|
||||
# Install all config-referenced plugins missing from the lockfile
|
||||
npx quartz plugin resolve
|
||||
npx quartz plugin install --from-config
|
||||
|
||||
# Preview first without making changes
|
||||
npx quartz plugin resolve --dry-run
|
||||
npx quartz plugin install --from-config --dry-run
|
||||
```
|
||||
|
||||
To clean up plugins that are installed but no longer referenced in your config:
|
||||
@@ -536,3 +744,5 @@ npx quartz plugin prune --dry-run
|
||||
## Component Plugins
|
||||
|
||||
For plugins that provide visual components (like Explorer, Graph, Search), see the [[creating components|creating component plugins]] guide.
|
||||
|
||||
Component-only plugins (those with `"category": ["component"]` in their manifest) are loaded via side-effect import rather than a factory function. If your component-only plugin needs to receive user options from `quartz.config.yaml`, export an `init(options)` function — see [[creating components#Receiving YAML Options in Component-Only Plugins|receiving YAML options]] for details.
|
||||
+14
-1
@@ -20,7 +20,7 @@ The `build` command transforms your Markdown content into a static HTML website.
|
||||
| `--baseDir` | | Set a base directory for the site (e.g. for GitHub Pages) | `/` |
|
||||
| `--remoteDevHost` | | The hostname to use for the development server | `localhost` |
|
||||
| `--bundleInfo` | | Output a JSON file with bundle size information | `false` |
|
||||
| `--concurrency` | | Number of worker threads to use for building | CPU core count |
|
||||
| `--concurrency` | `-c` | Number of worker threads to use for building | CPU core count |
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -56,6 +56,19 @@ If you have a very large vault, you can limit the number of concurrent workers t
|
||||
npx quartz build --concurrency 2
|
||||
```
|
||||
|
||||
## Serve vs Watch
|
||||
|
||||
The `--serve` and `--watch` flags control different behaviors:
|
||||
|
||||
- **`--serve`** starts a local development server AND automatically watches for changes (implies `--watch`). This is the recommended mode for local development.
|
||||
- **`--watch`** only watches for file changes and rebuilds automatically, without starting a server. This is useful for CI pipelines or custom server setups where you want automatic rebuilds but handle serving separately.
|
||||
|
||||
In most cases, you want `--serve`:
|
||||
|
||||
```shell
|
||||
npx quartz build --serve
|
||||
```
|
||||
|
||||
## Development Server
|
||||
|
||||
The `--serve` flag starts a local web server. This server is intended for development and previewing only. It is not designed for production use. For information on how to deploy your site, see [[hosting]].
|
||||
|
||||
+3
-4
@@ -18,11 +18,11 @@ The `create` command initializes a new Quartz project. It helps you set up your
|
||||
|
||||
## Templates
|
||||
|
||||
When you run `quartz create`, you can choose a configuration template that pre-configures Quartz for your use case:
|
||||
When you run `quartz create`, you can choose a configuration template that pre-configures Quartz for your use case. The selected template always overwrites `quartz.config.yaml`, even if one already exists. After applying the template, Quartz automatically runs plugin resolution to install any plugins the template requires and remove any that are no longer referenced.
|
||||
|
||||
- **Default**: A clean Quartz setup with sensible defaults. Best for starting from scratch.
|
||||
- **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 map plugin](https://github.com/quartz-community/external-quartz-leaflet-map-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.
|
||||
- **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.
|
||||
|
||||
## Base URL
|
||||
@@ -40,7 +40,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
|
||||
|
||||
@@ -61,7 +60,7 @@ If you run `npx quartz create` without any arguments, it will guide you through
|
||||
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).
|
||||
5. **Finish**: Quartz will set up the directory structure and create your configuration.
|
||||
5. **Finish**: Quartz will set up the directory structure, create your configuration, and automatically install any plugins referenced in the template.
|
||||
|
||||
## Example: Importing an Obsidian Vault
|
||||
|
||||
|
||||
+21
-12
@@ -13,22 +13,31 @@ You can run the CLI using `npx quartz`.
|
||||
| `create` | Initialize a new Quartz project with template selection | `npx quartz create` |
|
||||
| `build` | Generate static HTML files | `npx quartz build` |
|
||||
| `sync` | Sync content with GitHub | `npx quartz sync` |
|
||||
| `upgrade` | Upgrade Quartz to the latest version | `npx quartz upgrade` |
|
||||
| `update` | Update installed plugins | `npx quartz update` |
|
||||
| `plugin` | Manage Quartz plugins | `npx quartz plugin list` |
|
||||
| `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` |
|
||||
|
||||
## Commands
|
||||
|
||||
- [[cli/create|create]]: Initialize a new Quartz project with a choice of templates (default, obsidian, ttrpg, blog) and base URL configuration.
|
||||
- [[cli/build|build]]: Build your Quartz site into static HTML. Includes a development server.
|
||||
- [[cli/sync|sync]]: Push and pull changes between your local machine and GitHub.
|
||||
- [[cli/upgrade|upgrade]]: Upgrade the Quartz framework to the latest version.
|
||||
- [[cli/update|update]]: Update installed plugins to their latest versions.
|
||||
- [[cli/restore|restore]]: Recover your content folder from the local cache.
|
||||
- [[cli/migrate|migrate]]: Convert older configuration files to the new YAML format.
|
||||
- [[cli/plugin|plugin]]: Install, add, remove, prune, resolve, and configure plugins from the command line.
|
||||
- [[cli/tui|tui]]: Use a terminal interface to manage plugins and layout.
|
||||
- [[create|create]]: Initialize a new Quartz project with a choice of templates (default, obsidian, ttrpg, blog) 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.
|
||||
- [[tui|tui]]: Use a terminal interface to manage plugins and layout.
|
||||
|
||||
## Global Flags
|
||||
|
||||
These flags are accepted by every Quartz command:
|
||||
|
||||
| Flag | Shorthand | Description | Default |
|
||||
| --------------- | --------- | ------------------------------------------------------------------------------------------------------- | -------------- |
|
||||
| `--directory` | `-d` | The directory containing your Quartz project | `content` |
|
||||
| `--verbose` | `-v` | Enable detailed logging for debugging | `false` |
|
||||
| `--concurrency` | `-c` | Max parallel workers for operations that run in parallel (e.g. `build`, `plugin install`, `plugin add`) | CPU core count |
|
||||
|
||||
Commands that don't perform parallel work accept `-c` as a no-op, so it's always safe to pass. See [[build#Performance Tuning|build]] and [[cli/plugin#Installing on low-end hardware|plugin]] for practical examples.
|
||||
|
||||
## Help and Versioning
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
title: quartz migrate
|
||||
---
|
||||
|
||||
The `migrate` command helps you transition your project from Quartz 4 to Quartz v5 by converting your configuration files.
|
||||
|
||||
## When to Use
|
||||
|
||||
Use this command if you have an existing Quartz 4 project and want to upgrade to the new YAML-based configuration system introduced in v5.
|
||||
|
||||
## What it Does
|
||||
|
||||
When you run `npx quartz migrate`, the CLI performs several automated steps:
|
||||
|
||||
1. **Read Configuration**: It parses your existing `quartz.config.ts` and `quartz.layout.ts` files.
|
||||
2. **Map Plugins**: It identifies the plugins you are using and maps them to their v5 equivalents.
|
||||
3. **Generate YAML**: It creates a new `quartz.config.yaml` file that contains all your settings, theme colors, and plugin configurations.
|
||||
4. **Backup**: It keeps your old `.ts` files so you can refer back to them if needed.
|
||||
|
||||
```shell
|
||||
npx quartz migrate
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
After running the migration, you should check the following:
|
||||
|
||||
- **Theme Colors**: Ensure your custom colors were correctly transferred to the `theme` section of `quartz.config.yaml`.
|
||||
- **Plugin Options**: Verify that any custom options you passed to plugins (like `linkClickBehavior`) are present in the new config.
|
||||
- **Layout**: Check that your component order in the `layout` section matches your previous setup.
|
||||
|
||||
For a comprehensive guide on the entire migration process, including manual steps, see [[getting-started/migrating]].
|
||||
+105
-43
@@ -42,7 +42,10 @@ npx quartz plugin add /absolute/path/to/plugin
|
||||
|
||||
Local plugins are symlinked into `.quartz/plugins/`, so any changes you make to the source directory are reflected immediately without re-installing.
|
||||
|
||||
When a branch is specified, it is stored in the lockfile. All subsequent commands (`install`, `update`, `restore`, `check`, `resolve`) will respect that branch automatically.
|
||||
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.
|
||||
|
||||
> [!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
|
||||
|
||||
@@ -54,27 +57,30 @@ npx quartz plugin remove plugin-name
|
||||
|
||||
### install
|
||||
|
||||
Install all plugins listed in your `quartz.lock.json` file. This is useful when setting up the project on a new machine.
|
||||
Install plugins for your Quartz project. By default, this installs all plugins listed in your `quartz.lock.json` file.
|
||||
|
||||
```shell
|
||||
npx quartz plugin install
|
||||
```
|
||||
|
||||
### update
|
||||
#### Flags
|
||||
|
||||
Update specific plugins or all plugins to their latest versions.
|
||||
- `--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.
|
||||
- `--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.
|
||||
|
||||
#### Positional Arguments
|
||||
|
||||
- `[names..]`: Optional list of specific plugin names to install or update.
|
||||
|
||||
```shell
|
||||
npx quartz plugin update plugin-name
|
||||
npx quartz plugin update # updates all
|
||||
```
|
||||
# Update specific plugins to latest
|
||||
npx quartz plugin install --latest plugin-a plugin-b
|
||||
|
||||
### restore
|
||||
|
||||
Restore plugins to the exact versions specified in the lockfile. Unlike `install`, this will downgrade plugins if the lockfile specifies an older version. This is recommended for CI/CD environments.
|
||||
|
||||
```shell
|
||||
npx quartz plugin restore
|
||||
# Preview what would be installed from config
|
||||
npx quartz plugin install --from-config --dry-run
|
||||
```
|
||||
|
||||
### enable / disable
|
||||
@@ -98,18 +104,13 @@ npx quartz plugin config plugin-name
|
||||
npx quartz plugin config plugin-name --set key=value
|
||||
```
|
||||
|
||||
### check
|
||||
|
||||
Check if any of your installed plugins have updates available.
|
||||
|
||||
```shell
|
||||
npx quartz plugin 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.
|
||||
|
||||
> [!note]
|
||||
> Running `plugin install --from-config` also removes orphaned plugins as part of its synchronization. Use `prune` when you only want to clean up without installing anything new.
|
||||
|
||||
```shell
|
||||
npx quartz plugin prune
|
||||
```
|
||||
@@ -120,20 +121,6 @@ Use `--dry-run` to preview which plugins would be removed without making changes
|
||||
npx quartz plugin prune --dry-run
|
||||
```
|
||||
|
||||
### resolve
|
||||
|
||||
Install plugins that are listed in your `quartz.config.yaml` but missing from the lockfile. This is the inverse of `prune` — it ensures your installed plugins match your configuration.
|
||||
|
||||
```shell
|
||||
npx quartz plugin resolve
|
||||
```
|
||||
|
||||
Use `--dry-run` to preview which plugins would be installed without making changes:
|
||||
|
||||
```shell
|
||||
npx quartz plugin resolve --dry-run
|
||||
```
|
||||
|
||||
## Common Workflows
|
||||
|
||||
### Adding and Enabling a Plugin
|
||||
@@ -148,7 +135,30 @@ To add a new plugin and start using it:
|
||||
To keep your plugins fresh:
|
||||
|
||||
```shell
|
||||
npx quartz plugin update
|
||||
npx quartz plugin install --latest
|
||||
```
|
||||
|
||||
### Installing on low-end hardware
|
||||
|
||||
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
|
||||
# Install one plugin at a time (safest, slowest)
|
||||
npx quartz plugin install --latest -c 1
|
||||
|
||||
# Two at a time — usually a good balance on 4 GB machines
|
||||
npx quartz plugin install --latest --concurrency 2
|
||||
```
|
||||
|
||||
The same flag works on `plugin add` and the other plugin subcommands that perform parallel work:
|
||||
|
||||
```shell
|
||||
npx quartz plugin add github:quartz-community/some-plugin -c 1
|
||||
```
|
||||
|
||||
### Managing Configuration
|
||||
@@ -170,10 +180,10 @@ npx quartz plugin prune # remove orphaned plugins
|
||||
|
||||
### Setting Up from Config
|
||||
|
||||
When setting up on a new machine or in CI, resolve any plugins referenced in your config that aren't yet installed:
|
||||
When setting up on a new machine or in CI, `install --from-config` ensures your installed plugins match your config — installing missing plugins and removing any that are no longer referenced:
|
||||
|
||||
```shell
|
||||
npx quartz plugin resolve
|
||||
npx quartz plugin install --from-config
|
||||
```
|
||||
|
||||
### Testing with Branches
|
||||
@@ -189,9 +199,9 @@ npx quartz plugin remove repo
|
||||
npx quartz plugin add github:username/repo
|
||||
```
|
||||
|
||||
The branch ref is tracked in `quartz.lock.json`, so `update` and `check` will continue to follow the specified branch until the plugin is re-added without one.
|
||||
The branch ref is tracked in `quartz.lock.json`, so `install --latest` will continue to follow the specified branch until the plugin is re-added without one.
|
||||
|
||||
Both `prune` and `resolve` will fall back to `quartz.config.default.yaml` if no `quartz.config.yaml` is present.
|
||||
Both `prune` and `install --from-config` will fall back to `quartz.config.default.yaml` if no `quartz.config.yaml` is present.
|
||||
|
||||
### Local Plugin Development
|
||||
|
||||
@@ -201,7 +211,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 `update`, local plugins are rebuilt (npm install + npm run build) without any git operations. The `check` 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:
|
||||
|
||||
@@ -210,10 +225,57 @@ npx quartz plugin remove my-local-plugin
|
||||
npx quartz plugin add github:username/my-local-plugin
|
||||
```
|
||||
|
||||
## Interactive Mode
|
||||
### Subdirectory (Monorepo) Plugins
|
||||
|
||||
Running the plugin command without any subcommand will launch the [[cli/tui|TUI]], which provides a visual interface for all these operations.
|
||||
Some plugins live in a subdirectory of a larger repository rather than at the root. For these, you can specify the plugin source as an object in `quartz.config.yaml` with a `subdir` field:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source:
|
||||
repo: "https://github.com/username/monorepo.git"
|
||||
subdir: plugin
|
||||
enabled: true
|
||||
```
|
||||
|
||||
This tells Quartz to clone the full repository but install only the contents of the specified subdirectory.
|
||||
|
||||
You can combine `subdir` with `ref` to pin a branch or tag, and `name` to override the plugin directory name:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source:
|
||||
repo: "https://github.com/username/monorepo.git"
|
||||
subdir: packages/my-plugin
|
||||
ref: v2.0
|
||||
name: my-plugin
|
||||
enabled: true
|
||||
```
|
||||
|
||||
See [[configuration#Advanced Source Options|Advanced Source Options]] for the full reference on object source fields.
|
||||
|
||||
> [!note]
|
||||
> The `plugin add` CLI command works with string sources. To use the object source format with `subdir`, edit `quartz.config.yaml` directly, then run `npx quartz plugin install --from-config` to install it.
|
||||
|
||||
## Migration from Deprecated Commands
|
||||
|
||||
| Old command | New equivalent |
|
||||
| ------------------------------------- | --------------------------------------------------- |
|
||||
| `npx quartz plugin restore` | `npx quartz plugin install --clean` |
|
||||
| `npx quartz plugin update` | `npx quartz plugin install --latest` |
|
||||
| `npx quartz plugin update my-plugin` | `npx quartz plugin install --latest my-plugin` |
|
||||
| `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.
|
||||
|
||||
## Plugin Status
|
||||
|
||||
Running the plugin command without any subcommand shows a status dashboard of all installed plugins, including whether updates are available:
|
||||
|
||||
```shell
|
||||
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.
|
||||
+3
-1
@@ -2,7 +2,9 @@
|
||||
title: quartz restore
|
||||
---
|
||||
|
||||
The `restore` command is a safety mechanism that allows you to recover your content folder from a local cache.
|
||||
The `restore` command is a safety mechanism that allows you to recover your **content folder** from a local cache. This command only affects your Markdown files and does not restore plugins or configuration.
|
||||
|
||||
To restore plugins to a specific state, use [[cli/plugin|npx quartz plugin install]].
|
||||
|
||||
## When to Use
|
||||
|
||||
|
||||
+1
-1
@@ -71,4 +71,4 @@ If you have a very large number of changes, Git might occasionally fail due to b
|
||||
|
||||
Quartz uses `git pull --rebase --autostash` internally. This means if you have unstaged changes when you run `sync`, Quartz will temporarily hide them, pull the remote changes, and then bring your changes back. If a conflict occurs during this process, you will need to resolve it manually using standard Git tools.
|
||||
|
||||
For more information on initial setup, see [[getting-started/installation]].
|
||||
For more information on initial setup, see [[installation]].
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
title: quartz update
|
||||
---
|
||||
|
||||
The `update` command updates your installed plugins to their latest versions. It is a convenient shortcut for `npx quartz plugin update`.
|
||||
|
||||
## Usage
|
||||
|
||||
Update all installed plugins:
|
||||
|
||||
```shell
|
||||
npx quartz update
|
||||
```
|
||||
|
||||
Update specific plugins by name:
|
||||
|
||||
```shell
|
||||
npx quartz update my-plugin another-plugin
|
||||
```
|
||||
|
||||
## How it Works
|
||||
|
||||
For each plugin, `update` fetches the latest commit from the plugin's remote repository and rebuilds it. If a plugin was installed from a specific branch (e.g., `github:user/repo#my-branch`), updates will track that branch instead of the default branch. Local plugins (added from a file path) are rebuilt without any git operations. The lockfile (`quartz.lock.json`) is updated with the new commit hashes.
|
||||
|
||||
This is functionally identical to running:
|
||||
|
||||
```shell
|
||||
npx quartz plugin update
|
||||
```
|
||||
|
||||
## Flags
|
||||
|
||||
The `update` command supports the standard [[cli/index|common flags]] (`--directory`, `--verbose`).
|
||||
|
||||
## See Also
|
||||
|
||||
- [[cli/upgrade|quartz upgrade]] — upgrade the Quartz framework itself
|
||||
- [[cli/plugin|quartz plugin]] — full plugin management (install, remove, enable, disable, etc.)
|
||||
+7
-5
@@ -25,7 +25,9 @@ When you run `npx quartz upgrade`, Quartz performs the following steps:
|
||||
|
||||
Because Quartz allows you to customize almost every part of the code, upgrades can sometimes result in merge conflicts. This happens if you have modified a file that the Quartz team has also updated.
|
||||
|
||||
If a conflict occurs:
|
||||
Quartz automatically handles merge conflicts in `quartz.lock.json` by backing up your lockfile before pulling and restoring it afterward. This prevents the most common source of conflicts during upgrades.
|
||||
|
||||
For other files, if a conflict occurs:
|
||||
|
||||
1. Git will mark the conflicting sections in the affected files.
|
||||
2. You will need to open these files and manually choose which changes to keep.
|
||||
@@ -33,7 +35,7 @@ If a conflict occurs:
|
||||
|
||||
## Recovery
|
||||
|
||||
If an upgrade goes wrong or leaves your project in an unusable state, you can use the [[cli/restore|restore]] command to recover your content from the local cache.
|
||||
If an upgrade goes wrong or leaves your project in an unusable state, you can use the [[restore|restore]] command to recover your content from the local cache.
|
||||
|
||||
## Flags
|
||||
|
||||
@@ -41,6 +43,6 @@ The `upgrade` command supports the standard [[cli/index|common flags]] (`--direc
|
||||
|
||||
## See Also
|
||||
|
||||
- [[cli/update|quartz update]] — update installed plugins
|
||||
- [[getting-started/upgrading|Upgrading Quartz]] — detailed upgrading guide
|
||||
- [[cli/restore|quartz restore]] — recover content from cache
|
||||
- [[cli/plugin|quartz plugin install --latest]] — update installed plugins
|
||||
- [[upgrading|Upgrading Quartz]] — detailed upgrading guide
|
||||
- [[restore|quartz restore]] — recover content from cache
|
||||
+1
-1
@@ -12,7 +12,7 @@ Quartz has a vibrant community of users and contributors. This page highlights c
|
||||
Third-party plugins that extend Quartz functionality. Install them with the [[cli/plugin|plugin CLI]]:
|
||||
|
||||
```bash
|
||||
npx quartz plugin install <github-url>
|
||||
npx quartz plugin add <github-url>
|
||||
```
|
||||
|
||||
<!-- Add community plugins here as they become available -->
|
||||
|
||||
+77
-4
@@ -42,12 +42,14 @@ This part of the configuration concerns anything that can affect the whole site.
|
||||
- `{ provider: 'rybbit', siteId: 'my-rybbit-id' }` (managed) or `{ provider: 'rybbit', siteId: 'my-rybbit-id', host: 'my-rybbit-domain.com' }` (self-hosted) use [Rybbit](https://rybbit.com);
|
||||
- `locale`: used for [[i18n]] and date formatting
|
||||
- `baseUrl`: this is used for sitemaps and RSS feeds that require an absolute URL to know where the canonical 'home' of your site lives. This is normally the deployed URL of your site (e.g. `quartz.jzhao.xyz` for this site). Do not include the protocol (i.e. `https://`) or any leading or trailing slashes.
|
||||
- You will be prompted to set this during [[cli/create|`npx quartz create`]]. The CLI automatically strips any `https://` or `http://` protocol prefixes and trailing slashes for you.
|
||||
- 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.
|
||||
- `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.
|
||||
- `defaultDateType`: whether to use created, modified, or published as the default date to display on pages and page listings.
|
||||
- `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"`: downloads fonts and serves them from your site. Fully self-contained with no external requests.
|
||||
- `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)
|
||||
@@ -146,7 +148,7 @@ This adds the plugin to `quartz.config.yaml` and installs it to `.quartz/plugins
|
||||
To install all plugins referenced in your config that aren't yet installed (useful when cloning a project or setting up CI):
|
||||
|
||||
```shell
|
||||
npx quartz plugin resolve
|
||||
npx quartz plugin install --from-config
|
||||
```
|
||||
|
||||
To remove installed plugins that are no longer in your config:
|
||||
@@ -157,6 +159,55 @@ npx quartz plugin prune
|
||||
|
||||
Both commands support `--dry-run` to preview changes. See [[cli/plugin|the plugin CLI reference]] for full details.
|
||||
|
||||
### Advanced Source Options
|
||||
|
||||
The `source` field for a plugin can be either a simple string or an object with additional options. The string form is the most common:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/explorer
|
||||
enabled: true
|
||||
```
|
||||
|
||||
For plugins that live in a subdirectory of a repository (monorepo-style), or when you need to pin to a specific branch or tag, use the object form:
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source:
|
||||
repo: "https://github.com/user/repo.git"
|
||||
subdir: plugin
|
||||
ref: main
|
||||
name: my-plugin
|
||||
enabled: true
|
||||
```
|
||||
|
||||
The object form supports the following fields:
|
||||
|
||||
| Field | Required | Description |
|
||||
| -------- | :------: | --------------------------------------------------------------------------------------------------------- |
|
||||
| `repo` | ✅ | Git repository URL (e.g. `https://github.com/user/repo.git`). |
|
||||
| `subdir` | ❌ | Subdirectory within the repository that contains the plugin. Used for monorepo-style plugin repositories. |
|
||||
| `ref` | ❌ | Git ref (branch or tag) to pin to. Equivalent to the `#ref` suffix on string sources. |
|
||||
| `name` | ❌ | Override the directory name used in `.quartz/plugins/`. Defaults to the repository name. |
|
||||
|
||||
> [!example] Real-world example
|
||||
> The [quartz-themes](https://github.com/saberzero1/quartz-themes) plugin lives in the `plugin/` subdirectory of its repository. To install it:
|
||||
>
|
||||
> ```yaml title="quartz.config.yaml"
|
||||
> plugins:
|
||||
> - source:
|
||||
> name: quartz-themes
|
||||
> repo: "https://github.com/saberzero1/quartz-themes.git"
|
||||
> subdir: plugin
|
||||
> enabled: true
|
||||
> options:
|
||||
> theme: "tokyo-night"
|
||||
> mode: both
|
||||
> ```
|
||||
|
||||
> [!tip]
|
||||
> The string form `github:user/repo#branch` and the object form `{ repo, ref }` are equivalent ways to specify a branch. Use the object form when you also need `subdir` or `name`, or when you prefer a more readable configuration.
|
||||
|
||||
### Usage
|
||||
|
||||
You can customize the behaviour of Quartz by adding, removing and reordering plugins in `quartz.config.yaml`. Each plugin entry specifies its source, whether it's enabled, execution order, and any options:
|
||||
@@ -188,7 +239,25 @@ plugins:
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> For advanced options that require JavaScript (e.g. callback functions), use the TS override in `quartz.ts`. See the plugin-specific documentation for details.
|
||||
> 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({
|
||||
> mapFn: (node) => {
|
||||
> node.displayName = node.displayName.toUpperCase()
|
||||
> 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. 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]].
|
||||
|
||||
@@ -202,6 +271,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
|
||||
@@ -228,3 +298,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.
|
||||
@@ -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.
|
||||
@@ -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]
|
||||
|
||||
@@ -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",
|
||||
|
||||
+25
-14
@@ -63,10 +63,10 @@ For advanced options like custom sort, filter, and map functions, use the TS ove
|
||||
|
||||
```ts title="quartz.ts"
|
||||
import { loadQuartzConfig, loadQuartzLayout } from "./quartz/plugins/loader/config-loader"
|
||||
import { Explorer } from "@quartz-community/explorer"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Advanced: pass callback functions that can't be expressed in YAML
|
||||
Explorer({
|
||||
ExternalPlugin.Explorer({
|
||||
sortFn: (a, b) => {
|
||||
/* ... */
|
||||
},
|
||||
@@ -84,6 +84,16 @@ export default config
|
||||
export const layout = await loadQuartzLayout()
|
||||
```
|
||||
|
||||
> [!info] How overrides work
|
||||
> When you call `ExternalPlugin.Explorer({...})` in `quartz.ts`, the options are recorded and merged with the YAML configuration when the component is instantiated during the build. Options set in `quartz.ts` take precedence over those in `quartz.config.yaml`, following this order: `plugin defaults < YAML options < quartz.ts overrides`.
|
||||
>
|
||||
> If you have two plugins that export the same name (e.g. two different Explorer plugins installed via `--name`), use the `plugins` map to disambiguate:
|
||||
>
|
||||
> ```ts title="quartz.ts"
|
||||
> import * as ExternalPlugin from "./.quartz/plugins"
|
||||
> ExternalPlugin.plugins["my-explorer"].Explorer({ mapFn: ... })
|
||||
> ```
|
||||
|
||||
When passing in your own options, you can omit any or all of these fields if you'd like to keep the default value for that field.
|
||||
|
||||
Want to customize it even more?
|
||||
@@ -119,7 +129,7 @@ Every function you can pass is optional. By default, only a `sort` function will
|
||||
|
||||
```ts title="Default sort function"
|
||||
// Sort order: folders first, then files. Sort folders and files alphabetically
|
||||
Explorer({
|
||||
ExternalPlugin.Explorer({
|
||||
sortFn: (a, b) => {
|
||||
if ((!a.isFolder && !b.isFolder) || (a.isFolder && b.isFolder)) {
|
||||
return a.displayName.localeCompare(b.displayName, undefined, {
|
||||
@@ -172,7 +182,7 @@ plugins:
|
||||
Custom sort functions require the TS override:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
Explorer({
|
||||
ExternalPlugin.Explorer({
|
||||
sortFn: (a, b) => {
|
||||
return a.displayName.localeCompare(b.displayName)
|
||||
},
|
||||
@@ -184,7 +194,7 @@ Explorer({
|
||||
Using this example, the display names of all `FileNodes` (folders + files) will be converted to full upper case.
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
Explorer({
|
||||
ExternalPlugin.Explorer({
|
||||
mapFn: (node) => {
|
||||
node.displayName = node.displayName.toUpperCase()
|
||||
return node
|
||||
@@ -201,7 +211,7 @@ Using this example, you can remove elements from your explorer by providing an a
|
||||
Note that this example filters on the title but you can also do it via slug or any other field available on `FileTrieNode`.
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
Explorer({
|
||||
ExternalPlugin.Explorer({
|
||||
filterFn: (node) => {
|
||||
// set containing names of everything you want to filter out
|
||||
const omit = new Set(["authoring content", "tags", "advanced"])
|
||||
@@ -219,7 +229,7 @@ Explorer({
|
||||
You can access the tags of a file by `node.data.tags`.
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
Explorer({
|
||||
ExternalPlugin.Explorer({
|
||||
filterFn: (node) => {
|
||||
// exclude files with the tag "explorerexclude"
|
||||
return node.data?.tags?.includes("explorerexclude") !== true
|
||||
@@ -233,7 +243,7 @@ By default, the explorer will filter out the `tags` folder.
|
||||
To override the default filter function, you can set the filter function to `undefined`.
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
Explorer({
|
||||
ExternalPlugin.Explorer({
|
||||
filterFn: undefined, // apply no filter function, every file and folder will visible
|
||||
})
|
||||
```
|
||||
@@ -246,19 +256,20 @@ Explorer({
|
||||
> and passing it in.
|
||||
>
|
||||
> ```ts title="quartz.ts"
|
||||
> import { ExplorerOptions } from "@quartz-community/explorer/components"
|
||||
> import * as ExternalPlugin from "./.quartz/plugins"
|
||||
> import type { ExplorerOptions } from "./.quartz/plugins"
|
||||
>
|
||||
> export const mapFn: ExplorerOptions["mapFn"] = (node) => {
|
||||
> const mapFn: ExplorerOptions["mapFn"] = (node) => {
|
||||
> // implement your function here
|
||||
> }
|
||||
> export const filterFn: ExplorerOptions["filterFn"] = (node) => {
|
||||
> const filterFn: ExplorerOptions["filterFn"] = (node) => {
|
||||
> // implement your function here
|
||||
> }
|
||||
> export const sortFn: ExplorerOptions["sortFn"] = (a, b) => {
|
||||
> const sortFn: ExplorerOptions["sortFn"] = (a, b) => {
|
||||
> // implement your function here
|
||||
> }
|
||||
>
|
||||
> Explorer({
|
||||
> ExternalPlugin.Explorer({
|
||||
> // ... your other options
|
||||
> mapFn,
|
||||
> filterFn,
|
||||
@@ -271,7 +282,7 @@ Explorer({
|
||||
To add emoji prefixes (📁 for folders, 📄 for files), you could use a map function in `quartz.ts`:
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
Explorer({
|
||||
ExternalPlugin.Explorer({
|
||||
mapFn: (node) => {
|
||||
if (node.isFolder) {
|
||||
node.displayName = "📁 " + node.displayName
|
||||
|
||||
@@ -9,12 +9,12 @@ Quartz comes with a wide variety of features out of the box. Most features are p
|
||||
- [[Obsidian compatibility]] — Full support for Obsidian-flavored Markdown
|
||||
- [[wikilinks]] — Link between notes using `[[wikilinks]]` syntax
|
||||
- [[callouts]] — Obsidian-style callout blocks
|
||||
- [[Latex]] — LaTeX math rendering
|
||||
- [[features/Latex|Latex]] — LaTeX math rendering
|
||||
- [[Mermaid diagrams]] — Diagram support via Mermaid
|
||||
- [[syntax highlighting]] — Code block highlighting with themes
|
||||
- [[syntax highlighting|Syntax highlighting]] — Code block highlighting with themes
|
||||
- [[OxHugo compatibility]] — Support for ox-hugo Markdown
|
||||
- [[Roam Research compatibility]] — Support for Roam Research syntax
|
||||
- [[Citations]] — Academic citation support
|
||||
- [[features/Citations|Citations]] — Academic citation support
|
||||
- [[Canvas]] — Render Obsidian Canvas files as interactive pages
|
||||
- [[Bases]] — Database-like views for your notes (tables, cards, galleries, and more)
|
||||
|
||||
@@ -22,9 +22,9 @@ Quartz comes with a wide variety of features out of the box. Most features are p
|
||||
|
||||
- [[full-text search]] — Search across all your notes
|
||||
- [[graph view]] — Interactive graph visualization of note connections
|
||||
- [[backlinks]] — See which notes link to the current page
|
||||
- [[explorer]] — File tree sidebar for browsing notes
|
||||
- [[breadcrumbs]] — Breadcrumb navigation trail
|
||||
- [[features/backlinks]] — See which notes link to the current page
|
||||
- [[features/explorer]] — File tree sidebar for browsing notes
|
||||
- [[features/breadcrumbs]] — Breadcrumb navigation trail
|
||||
- [[table of contents]] — Per-page table of contents
|
||||
- [[folder and tag listings]] — Browse notes by folder or tag
|
||||
- [[recent notes]] — Display recently modified notes
|
||||
@@ -34,9 +34,9 @@ Quartz comes with a wide variety of features out of the box. Most features are p
|
||||
|
||||
## Appearance & Reading
|
||||
|
||||
- [[darkmode]] — Light and dark mode toggle
|
||||
- [[features/darkmode]] — Light and dark mode toggle
|
||||
- [[reader mode]] — Distraction-free reading experience
|
||||
- [[comments]] — Add comments via Giscus, Utterances, or other providers
|
||||
- [[features/comments|comments]] — Add comments via Giscus, Utterances, or other providers
|
||||
- [[social images]] — Auto-generated Open Graph images for social sharing
|
||||
|
||||
## Publishing & Deployment
|
||||
|
||||
@@ -15,6 +15,8 @@ Most options are configured in the `options` section of the plugin entry in `qua
|
||||
- Changing the title from "Recent notes": set `title: "Recent writing"` in options
|
||||
- Changing the number of recent notes: set `limit: 5` in options
|
||||
- Display the note's tags (defaults to true): set `showTags: false` in options
|
||||
- Hide generated tag pages from the list (defaults to false): set `hideTagPages: true` in options. This filters out any page whose slug lives under the conventional `tags/` prefix.
|
||||
- Hide generated folder index pages from the list (defaults to false): set `hideFolderPages: true` in options. This filters out any page whose slug matches Quartz's folder-path convention (trailing slash or `index` suffix).
|
||||
- Show a 'see more' link: set `linkToMore: "tags/components"` in options. This field should be a full slug to a page that exists.
|
||||
- Customize filtering: requires a TS override — pass `filter: someFilterFunction` to the plugin constructor in `quartz.ts`. The filter function should have the signature `(f: QuartzPluginData) => boolean`.
|
||||
- Customize sorting: requires a TS override — pass `sort: someSortFunction` to the plugin constructor in `quartz.ts`. By default, Quartz will sort by date and then tie break lexographically. The sort function should have the signature `(f1: QuartzPluginData, f2: QuartzPluginData) => number`.
|
||||
|
||||
@@ -8,6 +8,8 @@ Quartz supports Wikilinks by default and these links are resolved by Quartz usin
|
||||
|
||||
This is enabled as a part of [[Obsidian compatibility]] and can be configured and enabled/disabled from that plugin.
|
||||
|
||||
Wikilink matching is case-insensitive to mirror Obsidian: `[[My Note]]`, `[[my note]]`, and `[[MY NOTE]]` all resolve to the same file. The generated URL is lowercased (e.g. `my-note`).
|
||||
|
||||
## Syntax
|
||||
|
||||
- `[[Path to file]]`: produces a link to `Path to file.md` (or `Path-to-file.md`) with the text `Path to file`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -42,7 +42,7 @@ 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 [[getting-started/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
|
||||
|
||||
|
||||
@@ -2,16 +2,33 @@
|
||||
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. **[[getting-started/installation|Installation]]** — Clone Quartz, create your repository, and push your first sync
|
||||
2. **[[getting-started/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.
|
||||
|
||||
## 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
|
||||
|
||||
- **[[getting-started/upgrading|Upgrading Quartz]]** — Keep your Quartz installation up to date
|
||||
- **[[getting-started/migrating|Migrating to Quartz 5]]** — Migrate from Quartz 4 or Quartz 3
|
||||
- **[[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,46 +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
|
||||
|
||||
There are two ways to get started. Pick whichever you prefer:
|
||||
|
||||
### Option A: Use the GitHub Template (Recommended)
|
||||
|
||||
> [!tip] Why this option?
|
||||
> Using the template creates your own repository in one click — no need to reconfigure Git remotes later.
|
||||
|
||||
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
|
||||
git clone https://github.com/<your-username>/<your-repo>.git
|
||||
cd <your-repo>
|
||||
```
|
||||
|
||||
### Option B: Clone Directly
|
||||
|
||||
If you don't use GitHub or prefer a manual setup:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/jackyzha0/quartz.git
|
||||
cd quartz
|
||||
```
|
||||
|
||||
> [!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.
|
||||
|
||||
## 2. Install Dependencies
|
||||
|
||||
> [!important]
|
||||
> Quartz requires **Node.js 22** or later. Check your version with `node -v` and upgrade at [nodejs.org](https://nodejs.org/) if needed.
|
||||
|
||||
```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`) — 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
|
||||
> ```
|
||||
>
|
||||
> 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]]
|
||||
|
||||
At the top of your repository on GitHub.com's Quick Setup page, click the clipboard to copy the remote repository URL.
|
||||
Copy the repository URL from the Quick Setup page:
|
||||
|
||||
![[github-quick-setup.png]]
|
||||
|
||||
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.
|
||||
### Connect Your Local Clone
|
||||
|
||||
Point your local Quartz at your new repository:
|
||||
|
||||
```bash
|
||||
# list all the repositories that are tracked
|
||||
# Check current remotes
|
||||
git remote -v
|
||||
|
||||
# if the origin doesn't match your own repository, set your repository as the origin
|
||||
# Point origin to your repository
|
||||
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
|
||||
```
|
||||
|
||||
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.
|
||||
> [!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
|
||||
```
|
||||
|
||||
> [!warning]- `fatal: --[no-]autostash option is only valid with --rebase`
|
||||
> You may have an outdated version of `git`. Updating `git` should fix this issue.
|
||||
This commits your content and pushes everything to your repository. For subsequent updates, just run:
|
||||
|
||||
> [!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
|
||||
> ```
|
||||
|
||||
In future updates, you can simply run `npx quartz sync` every time you want to push updates to your repository.
|
||||
```bash
|
||||
npx quartz sync
|
||||
```
|
||||
|
||||
> [!hint] Flags and options
|
||||
> For full help options, you can run `npx quartz sync --help`.
|
||||
@@ -55,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
|
||||
+157
-288
@@ -5,276 +5,111 @@ aliases:
|
||||
- "migrating from Quartz 4"
|
||||
---
|
||||
|
||||
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 [[getting-started/upgrading|Upgrading Quartz]] instead.
|
||||
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.
|
||||
|
||||
## Migrating from Quartz 4
|
||||
If you're new to Quartz entirely, skip this guide and follow the [[installation|installation guide]] instead.
|
||||
|
||||
### Overview
|
||||
## Before You Start: Save Your Content
|
||||
|
||||
Quartz 5 introduces a community plugin system that fundamentally changes how plugins and components are managed. Most plugins that were built into Quartz 4 are now standalone community plugins maintained under the [quartz-community](https://github.com/quartz-community) organization. This guide walks through the changes needed to migrate your configuration.
|
||||
Before switching branches, make sure your content is safe. Switching to v5 will replace the files in your working directory with the v5 codebase, so your v4 content folder won't be visible until you restore it.
|
||||
|
||||
### What Changed
|
||||
Copy your content folder somewhere outside the repo before switching:
|
||||
|
||||
```bash
|
||||
# macOS / Linux
|
||||
cp -r content /tmp/quartz-content
|
||||
|
||||
# Windows (PowerShell)
|
||||
Copy-Item -Recurse content $env:TEMP\quartz-content
|
||||
```
|
||||
|
||||
> [!note] Your old branch is preserved
|
||||
> Switching branches does **not** delete your v4 (or v3/hugo) branch. You can always switch back with `git checkout v4` to access your old content and configuration.
|
||||
|
||||
## Getting the v5 Branch
|
||||
|
||||
Whether you're coming from Quartz 4 or Quartz 3, the first step is the same: get the v5 branch onto your machine and push it to your repository.
|
||||
|
||||
```bash
|
||||
# Add the official Quartz repository as a remote called "upstream" (skip if already set)
|
||||
git remote add upstream https://github.com/jackyzha0/quartz.git
|
||||
|
||||
# Fetch the v5 branch from the official repository
|
||||
git fetch upstream v5
|
||||
|
||||
# Create a local v5 branch from the official one
|
||||
git checkout -b v5 upstream/v5
|
||||
|
||||
# Install dependencies
|
||||
npm i
|
||||
|
||||
# Push v5 to your GitHub repository
|
||||
git push -u origin v5
|
||||
```
|
||||
|
||||
## Setting Up Your Site
|
||||
|
||||
Once you're on v5, run the interactive setup to configure your site and import your content:
|
||||
|
||||
```bash
|
||||
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 **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:
|
||||
|
||||
```bash
|
||||
# macOS / Linux
|
||||
cp -r /tmp/quartz-content/* content/
|
||||
|
||||
# Windows (PowerShell)
|
||||
Copy-Item -Recurse $env:TEMP\quartz-content\* content\
|
||||
```
|
||||
|
||||
After running `create`, install all plugins referenced in the generated config:
|
||||
|
||||
```bash
|
||||
npx quartz plugin install --from-config
|
||||
```
|
||||
|
||||
## What Changed in v5
|
||||
|
||||
Quartz 5 introduces a community plugin system that fundamentally changes how plugins and components are managed. Most plugins that were built into Quartz 4 are now standalone community plugins maintained under the [quartz-community](https://github.com/quartz-community) organization.
|
||||
|
||||
Key changes:
|
||||
|
||||
- **Configuration format**: TypeScript (`quartz.config.ts`, `quartz.layout.ts`) → YAML (`quartz.config.yaml`)
|
||||
- **Plugin system**: Plugins are now standalone Git repositories, installed via `npx quartz plugin add`
|
||||
- **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`, with `layout.groups` for flex containers (e.g. toolbar) and `layout.byPageType` for per-page-type overrides
|
||||
- **Page Types**: A new plugin category for page rendering (content, folder, tag pages)
|
||||
- **Component references**: In layout files, community components use `Plugin.X()` (from `.quartz/plugins`) instead of `Component.X()` (from `./quartz/components`)
|
||||
- **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.
|
||||
|
||||
### Step-by-Step Migration
|
||||
### URL Casing and SEO
|
||||
|
||||
#### 1. Set Up Quartz 5 with a Template
|
||||
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 easiest way to migrate is to use `npx quartz create`, which generates a complete `quartz.config.yaml` from a template with all default plugins pre-configured:
|
||||
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.
|
||||
|
||||
```shell
|
||||
npx quartz create --template default --strategy copy --source /path/to/your/content
|
||||
```
|
||||
|
||||
Available templates: `default`, `obsidian`, `ttrpg`, `blog`. Pick the one closest to your setup — `obsidian` is recommended if you use an Obsidian vault.
|
||||
|
||||
> [!tip] Choosing a template
|
||||
> Each template comes with all 30+ default plugins pre-configured. The main differences are content strategy (OFM support, link resolution) and optional plugins (comments, maps). You can customize everything in `quartz.config.yaml` afterward.
|
||||
|
||||
After running `create`, install all the plugins referenced in the generated config:
|
||||
|
||||
```shell
|
||||
npx quartz plugin resolve
|
||||
```
|
||||
|
||||
This reads your `quartz.config.yaml` and installs every plugin listed in it. No need to run 30 individual `npx quartz plugin add` commands.
|
||||
|
||||
> [!note] Custom or optional plugins
|
||||
> If you used optional plugins in v4 (comments, reader-mode, breadcrumbs, recent-notes, citations, etc.), add them after the initial setup:
|
||||
>
|
||||
> ```shell
|
||||
> npx quartz plugin add github:quartz-community/comments
|
||||
> npx quartz plugin add github:quartz-community/reader-mode
|
||||
> npx quartz plugin add github:quartz-community/breadcrumbs
|
||||
> npx quartz plugin add github:quartz-community/recent-notes
|
||||
> ```
|
||||
>
|
||||
> See [[plugins/index|Plugins]] for the full list of available community plugins.
|
||||
|
||||
> [!info] Alternative: Use `npx quartz migrate`
|
||||
> If you have an existing `quartz.config.ts` and `quartz.layout.ts` from v4, you can run `npx quartz migrate` instead. This reads your old config files and generates `quartz.config.yaml` with your existing settings. You'll still need to run `npx quartz plugin resolve` afterward to install the plugins. See [[cli/migrate|quartz migrate]] for details.
|
||||
|
||||
#### 2. Update quartz.config.yaml
|
||||
|
||||
**Before (v4):**
|
||||
|
||||
```ts title="quartz.config.ts"
|
||||
import * as Plugin from "./quartz/plugins"
|
||||
|
||||
plugins: {
|
||||
transformers: [
|
||||
Plugin.FrontMatter(),
|
||||
Plugin.CreatedModifiedDate({ priority: ["frontmatter", "git", "filesystem"] }),
|
||||
Plugin.Latex({ renderEngine: "katex" }),
|
||||
],
|
||||
filters: [Plugin.RemoveDrafts()],
|
||||
emitters: [
|
||||
Plugin.AliasRedirects(),
|
||||
Plugin.ComponentResources(),
|
||||
Plugin.ContentPage(),
|
||||
Plugin.FolderPage(),
|
||||
Plugin.TagPage(),
|
||||
Plugin.ContentIndex({ enableSiteMap: true, enableRSS: true }),
|
||||
Plugin.Assets(),
|
||||
Plugin.Static(),
|
||||
Plugin.NotFoundPage(),
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
**After (v5):**
|
||||
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/note-properties
|
||||
enabled: true
|
||||
options:
|
||||
delimiters: "---"
|
||||
language: yaml
|
||||
order: 5
|
||||
- source: github:quartz-community/created-modified-date
|
||||
enabled: true
|
||||
options:
|
||||
priority:
|
||||
- frontmatter
|
||||
- git
|
||||
- filesystem
|
||||
order: 10
|
||||
- source: github:quartz-community/latex
|
||||
enabled: true
|
||||
options:
|
||||
renderEngine: katex
|
||||
order: 80
|
||||
- source: github:quartz-community/remove-draft
|
||||
enabled: true
|
||||
- source: github:quartz-community/alias-redirects
|
||||
enabled: true
|
||||
- source: github:quartz-community/content-index
|
||||
enabled: true
|
||||
options:
|
||||
enableSiteMap: true
|
||||
enableRSS: true
|
||||
- source: github:quartz-community/favicon
|
||||
enabled: true
|
||||
- source: github:quartz-community/og-image
|
||||
enabled: true
|
||||
- source: github:quartz-community/cname
|
||||
enabled: true
|
||||
- source: github:quartz-community/content-page
|
||||
enabled: true
|
||||
- source: github:quartz-community/folder-page
|
||||
enabled: true
|
||||
- source: github:quartz-community/tag-page
|
||||
enabled: true
|
||||
# ... more plugins
|
||||
enableCaseRedirects: false
|
||||
```
|
||||
|
||||
Key changes:
|
||||
> [!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.
|
||||
|
||||
- Plugins are now referenced by their GitHub source (`github:org/repo`)
|
||||
- Plugin type (transformer, filter, emitter, pageType) is determined by the plugin's manifest, not by which array you place it in
|
||||
- Execution order is controlled by the `order` field (lower numbers run first)
|
||||
- Each plugin entry has `enabled`, `options`, `order`, and optionally `layout` fields
|
||||
- Install community plugins with `npx quartz plugin add github:quartz-community/<name>`
|
||||
|
||||
#### 3. Update layout configuration
|
||||
|
||||
**Before (v4):**
|
||||
|
||||
```ts title="quartz.layout.ts"
|
||||
import * as Component from "./quartz/components"
|
||||
|
||||
export const sharedPageComponents: SharedLayout = {
|
||||
head: Component.Head(),
|
||||
header: [],
|
||||
afterBody: [],
|
||||
footer: Component.Footer({ links: { ... } }),
|
||||
}
|
||||
|
||||
export const defaultContentPageLayout: PageLayout = {
|
||||
beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta(), Component.TagList()],
|
||||
left: [Component.PageTitle(), Component.Search(), Component.Darkmode(), Component.Explorer()],
|
||||
right: [Component.Graph(), Component.TableOfContents(), Component.Backlinks()],
|
||||
}
|
||||
```
|
||||
|
||||
**After (v5):**
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
plugins:
|
||||
- source: github:quartz-community/breadcrumbs
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 5
|
||||
- source: github:quartz-community/article-title
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 10
|
||||
- source: github:quartz-community/content-meta
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 20
|
||||
- source: github:quartz-community/tag-list
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 30
|
||||
- source: github:quartz-community/page-title
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 10
|
||||
- source: github:quartz-community/search
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 20
|
||||
- source: github:quartz-community/darkmode
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 30
|
||||
- source: github:quartz-community/explorer
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
- source: github:quartz-community/graph
|
||||
enabled: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 10
|
||||
- source: github:quartz-community/backlinks
|
||||
enabled: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 30
|
||||
- source: github:quartz-community/footer
|
||||
enabled: true
|
||||
options:
|
||||
links:
|
||||
GitHub: https://github.com/jackyzha0/quartz
|
||||
Discord Community: https://discord.gg/cRFFHYye7t
|
||||
|
||||
layout:
|
||||
byPageType:
|
||||
content: {}
|
||||
folder:
|
||||
exclude:
|
||||
- reader-mode
|
||||
positions:
|
||||
right: []
|
||||
tag:
|
||||
exclude:
|
||||
- reader-mode
|
||||
positions:
|
||||
right: []
|
||||
"404":
|
||||
positions:
|
||||
beforeBody: []
|
||||
left: []
|
||||
right: []
|
||||
```
|
||||
|
||||
Key changes:
|
||||
|
||||
- Layout position is now a property on each plugin entry (`layout.position`, `layout.priority`)
|
||||
- `sharedPageComponents` is gone — all layout is plugin-driven
|
||||
- Per-page-type overrides live in the `layout.byPageType` section
|
||||
- Empty arrays (`[]`) clear a position for that page type
|
||||
- The `exclude` field removes specific plugins from a page type
|
||||
|
||||
#### 4. Update CI/CD
|
||||
|
||||
Add `npx quartz plugin restore` to your build pipeline, before `npx quartz build`. This installs plugins from the lockfile at their pinned versions.
|
||||
|
||||
If your CI uses `quartz.config.default.yaml` (or contributors may add plugins to config without updating the lockfile), also run `npx quartz plugin resolve` to install any config-referenced plugins that are missing from the lockfile:
|
||||
|
||||
```shell
|
||||
npx quartz plugin restore # install pinned plugins from lockfile
|
||||
npx quartz plugin resolve # install any config-referenced plugins not yet in lockfile
|
||||
npx quartz build
|
||||
```
|
||||
|
||||
See [[hosting]] for detailed CI/CD examples and [[ci-cd]] for advanced configuration.
|
||||
|
||||
#### 5. Commit and Deploy
|
||||
|
||||
```shell
|
||||
git add quartz.config.yaml quartz.lock.json
|
||||
git commit -m "chore: migrate to Quartz 5 plugin system"
|
||||
```
|
||||
|
||||
> [!tip] Cleaning up leftover plugins
|
||||
> After migrating, you may have plugins installed from v4 that are no longer in your v5 config. Run `npx quartz plugin prune` to remove them. Use `--dry-run` first to preview what would be removed.
|
||||
> [!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.
|
||||
|
||||
### Plugin Reference Table
|
||||
|
||||
@@ -282,7 +117,7 @@ Mapping v4 plugin names to v5 equivalents:
|
||||
|
||||
| v4 | v5 | Type |
|
||||
| ----------------------------------- | ------------------------------------------- | --------------------- |
|
||||
| `Plugin.FrontMatter()` | `Plugin.FrontMatter()` (unchanged) | Internal |
|
||||
| `Plugin.FrontMatter()` | `ExternalPlugin.NoteProperties()` | Community |
|
||||
| `Plugin.CreatedModifiedDate()` | `ExternalPlugin.CreatedModifiedDate()` | Community |
|
||||
| `Plugin.SyntaxHighlighting()` | `ExternalPlugin.SyntaxHighlighting()` | Community |
|
||||
| `Plugin.ObsidianFlavoredMarkdown()` | `ExternalPlugin.ObsidianFlavoredMarkdown()` | Community |
|
||||
@@ -303,57 +138,91 @@ Mapping v4 plugin names to v5 equivalents:
|
||||
|
||||
Component layout mapping:
|
||||
|
||||
| v4 Layout | v5 Layout |
|
||||
| ----------------------------- | ------------------------------------------ |
|
||||
| `Component.Explorer()` | `Plugin.Explorer()` |
|
||||
| `Component.Graph()` | `Plugin.Graph()` |
|
||||
| `Component.Search()` | `Plugin.Search()` |
|
||||
| `Component.Backlinks()` | `Plugin.Backlinks()` |
|
||||
| `Component.Darkmode()` | `Plugin.Darkmode()` |
|
||||
| `Component.Footer()` | `Plugin.Footer()` |
|
||||
| `Component.TableOfContents()` | `Plugin.TableOfContents()` |
|
||||
| `Component.Head()` | `Component.Head()` (unchanged, internal) |
|
||||
| `Component.Spacer()` | `Component.Spacer()` (unchanged, internal) |
|
||||
| v4 Layout | v5 Layout |
|
||||
| ----------------------------- | ---------------------------------------- |
|
||||
| `Component.Explorer()` | `Plugin.Explorer()` |
|
||||
| `Component.Graph()` | `Plugin.Graph()` |
|
||||
| `Component.Search()` | `Plugin.Search()` |
|
||||
| `Component.Backlinks()` | `Plugin.Backlinks()` |
|
||||
| `Component.Darkmode()` | `Plugin.Darkmode()` |
|
||||
| `Component.Footer()` | `Plugin.Footer()` |
|
||||
| `Component.TableOfContents()` | `Plugin.TableOfContents()` |
|
||||
| `Component.Head()` | `Component.Head()` (unchanged, internal) |
|
||||
| `Component.Spacer()` | `Plugin.Spacer()` |
|
||||
|
||||
---
|
||||
## Updating Your CI/CD
|
||||
|
||||
## Migrating from Quartz 3
|
||||
Quartz 5 requires plugins to be installed before building. Add a plugin install step and (optionally) caching to your CI pipeline.
|
||||
|
||||
As you already have Quartz locally, you don't need to fork or clone it again. Simply just checkout the v4 branch, install the dependencies, restore plugins, and import your old vault. Then follow the [Quartz 4 migration steps above](#migrating-from-quartz-4) to get to v5.
|
||||
Here's the recommended pattern, based on the project's own GitHub Actions:
|
||||
|
||||
```bash
|
||||
git fetch
|
||||
git checkout v4
|
||||
git pull upstream v4
|
||||
npm i
|
||||
npx quartz plugin restore
|
||||
npx quartz create
|
||||
```yaml
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Cache Quartz plugins
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .quartz/plugins
|
||||
key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
|
||||
- run: npm ci
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
|
||||
- name: Build Quartz
|
||||
run: npx quartz build
|
||||
```
|
||||
|
||||
If you get an error like `fatal: 'upstream' does not appear to be a git repository`, make sure you add `upstream` as a remote origin:
|
||||
The plugin cache uses `quartz.lock.json` as the cache key, so plugins are only re-downloaded when the lockfile changes.
|
||||
|
||||
For non-GitHub CI providers (Cloudflare, Vercel, Netlify), the build command should be:
|
||||
|
||||
```shell
|
||||
git remote add upstream https://github.com/jackyzha0/quartz.git
|
||||
npx quartz plugin install && npx quartz build
|
||||
```
|
||||
|
||||
When running `npx quartz create`, you will be prompted as to how to initialize your content folder. Here, you can choose to import or link your previous content folder and Quartz should work just as you expect it to.
|
||||
See [[hosting]] for provider-specific setup details.
|
||||
|
||||
> [!note]
|
||||
> If the existing content folder you'd like to use is at the _same_ path on a different branch, clone the repo again somewhere at a _different_ path in order to use it.
|
||||
## Setting Your Default Branch to v5
|
||||
|
||||
After verifying your site builds and deploys correctly, update your repository's default branch to `v5`:
|
||||
|
||||
1. Go to your repository on GitHub
|
||||
2. Navigate to **Settings** → **General**
|
||||
3. Under **Default branch**, click the switch icon next to your current default branch
|
||||
4. Select `v5` from the dropdown and click **Update**
|
||||
5. Confirm the change
|
||||
|
||||
This ensures that new clones, pull requests, and GitHub Pages deployments all target v5 by default. Your old v4 branch remains available for reference.
|
||||
|
||||
> [!warning] Update your CI triggers
|
||||
> If your CI workflow triggers on a specific branch (e.g. `branches: [v4]`), make sure to update it to `v5`. See the [[hosting]] guide for examples.
|
||||
|
||||
## Notes for Quartz 3 Users
|
||||
|
||||
If you're coming from Quartz 3 (the Hugo-based version), follow the same steps above — get the v5 branch, run `npx quartz create`, and import your content. There is no need to go through Quartz 4 first.
|
||||
|
||||
### Key changes from Quartz 3
|
||||
|
||||
1. **Removing Hugo and `hugo-obsidian`**: Hugo worked well for earlier versions of Quartz but it also made it hard for people outside of the Golang and Hugo communities to fully understand what Quartz was doing under the hood and be able to properly customize it to their needs. Quartz now uses a Node-based static-site generation process which should lead to much more helpful error messages and an overall smoother user experience.
|
||||
2. **Full-hot reload**: The many rough edges of how `hugo-obsidian` integrated with Hugo meant that watch mode didn't re-trigger `hugo-obsidian` to update the content index. This lead to a lot of weird cases where the watch mode output wasn't accurate. Quartz now uses a cohesive parse, filter, and emit pipeline which gets run on every change so hot-reloads are always accurate.
|
||||
3. **Replacing Go template syntax with JSX**: Quartz 3 used [Go templates](https://pkg.go.dev/text/template) to create layouts for pages. However, the syntax isn't great for doing any sort of complex rendering (like [text processing](https://github.com/jackyzha0/quartz/blob/hugo/layouts/partials/textprocessing.html)) and it got very difficult to make any meaningful layout changes to Quartz 3. Quartz now uses an extension of JavaScript syntax called JSX which allows you to write layout code that looks like HTML in JavaScript which is significantly easier to understand and maintain.
|
||||
4. **A new extensible [[configuration]] and [[configuration#Plugins|plugin]] system**: Quartz 3 was hard to configure without technical knowledge of how Hugo's partials worked. Extensions were even hard to make. Quartz 5's configuration and plugin system is designed to be extended by users while making updating to new versions of Quartz easy.
|
||||
1. **Hugo is gone**: Quartz now uses a Node-based static-site generation process. No more Go templates or `hugo-obsidian`.
|
||||
2. **Full hot-reload**: The development server (`npx quartz build --serve`) re-processes all content on every change.
|
||||
3. **JSX instead of Go templates**: Layout components are written in JSX (JavaScript XML), which is significantly easier to customize.
|
||||
4. **New plugin system**: See [[configuration#Plugins|Plugins]] for details on the extensible plugin architecture.
|
||||
|
||||
### Things to update
|
||||
|
||||
- You will need to update your deploy scripts. See the [[hosting]] guide for more details.
|
||||
- Ensure that your default branch on GitHub is updated from `hugo` to `v5`.
|
||||
- [[folder and tag listings|Folder and tag listings]] have also changed.
|
||||
- Folder descriptions should go under `content/<folder-name>/index.md` where `<folder-name>` is the name of the folder.
|
||||
- Tag descriptions should go under `content/tags/<tag-name>.md` where `<tag-name>` is the name of the tag.
|
||||
- Some HTML layout may not be the same between Quartz 3 and Quartz 5. If you depended on a particular HTML hierarchy or class names, you may need to update your custom CSS to reflect these changes.
|
||||
- If you customized the layout of Quartz 3, you may need to translate these changes from Go templates back to JSX as Quartz 5 no longer uses Hugo. For components, check out the guide on [[creating components]] for more details on this.
|
||||
- Update your deploy scripts — see the [[hosting]] guide.
|
||||
- Ensure your default branch on GitHub is updated to `v5`.
|
||||
- [[folder and tag listings|Folder and tag listings]] have changed:
|
||||
- Folder descriptions go under `content/<folder-name>/index.md`
|
||||
- Tag descriptions go under `content/tags/<tag-name>.md`
|
||||
- Custom CSS may need updates if you depended on specific HTML hierarchy or class names from Quartz 3.
|
||||
@@ -5,7 +5,7 @@ aliases:
|
||||
---
|
||||
|
||||
> [!note]
|
||||
> This is specifically a guide for upgrading your Quartz to a more recent update. If you are coming from Quartz 4 or Quartz 3, check out the [[getting-started/migrating|migration guide]] for more info.
|
||||
> This is specifically a guide for upgrading your Quartz to a more recent update. If you are coming from Quartz 4 or Quartz 3, check out the [[migrating|migration guide]] for more info.
|
||||
|
||||
To fetch the latest Quartz updates, simply run
|
||||
|
||||
@@ -13,7 +13,7 @@ To fetch the latest Quartz updates, simply run
|
||||
npx quartz upgrade
|
||||
```
|
||||
|
||||
As Quartz uses [git](https://git-scm.com/) under the hood for versioning, upgrading effectively 'pulls' in the updates from the official Quartz GitHub repository. If you have local changes that might conflict with the updates, you may need to resolve these manually yourself (or, pull manually using `git pull origin upstream`).
|
||||
As Quartz uses [git](https://git-scm.com/) under the hood for versioning, upgrading effectively 'pulls' in the updates from the official Quartz GitHub repository. Merge conflicts in `quartz.lock.json` are handled automatically — Quartz backs up your lockfile before pulling and restores it afterward. For other files with local changes that conflict with the updates, you may need to resolve these manually yourself (or, pull manually using `git pull origin upstream`).
|
||||
|
||||
> [!hint]
|
||||
> Quartz will try to cache your content before upgrading to try and prevent merge conflicts. If you get a conflict mid-merge, you can stop the merge and then run `npx quartz restore` to restore your content from the cache.
|
||||
@@ -23,10 +23,46 @@ If you have the [GitHub desktop app](https://desktop.github.com/), this will aut
|
||||
To update your installed plugins separately, use:
|
||||
|
||||
```bash
|
||||
npx quartz update
|
||||
npx quartz plugin install --latest
|
||||
```
|
||||
|
||||
See the [[cli/update|CLI reference for update]] and [[cli/upgrade|CLI reference for upgrade]] for more details on available flags.
|
||||
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
|
||||
|
||||
@@ -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/crawl-links @quartz-community/description @quartz-community/latex @quartz-community/quartz-fonts @quartz-community/remove-draft @quartz-community/alias-redirects @quartz-community/content-index @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)
|
||||
|
||||
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** — rendered with expand button
|
||||
- **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.
|
||||
+76
-22
@@ -7,13 +7,13 @@ 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!
|
||||
|
||||
> [!tip] Keeping plugins in sync
|
||||
> All hosting examples below use `npx quartz plugin restore` to install plugins from the lockfile. If contributors may add plugins to `quartz.config.yaml` without updating the lockfile, add `npx quartz plugin resolve` after `restore` in your build command to install any missing plugins. See [[cli/plugin#resolve|plugin resolve]] for details.
|
||||
> All hosting examples below use `npx quartz plugin install` to install plugins from the lockfile. If contributors may add plugins to `quartz.config.yaml` without updating the lockfile, add `npx quartz plugin install --from-config` after `install` in your build command to install any missing plugins. See [[cli/plugin#install|plugin install]] for details.
|
||||
|
||||
## Cloudflare Pages
|
||||
|
||||
@@ -25,7 +25,7 @@ However, if you'd like to publish your site to the world, you need a way to host
|
||||
| ---------------------- | ----------------------------------------------- |
|
||||
| Production branch | `v5` |
|
||||
| Framework preset | `None` |
|
||||
| Build command | `npx quartz plugin restore && npx quartz build` |
|
||||
| Build command | `npx quartz plugin install && npx quartz build` |
|
||||
| Build output directory | `public` |
|
||||
|
||||
Press "Save and deploy" and Cloudflare should have a deployed version of your site in about a minute. Then, every time you sync your Quartz changes to GitHub, your site should be updated.
|
||||
@@ -33,10 +33,10 @@ Press "Save and deploy" and Cloudflare should have a deployed version of your si
|
||||
To add a custom domain, check out [Cloudflare's documentation](https://developers.cloudflare.com/pages/platform/custom-domains/).
|
||||
|
||||
> [!warning]
|
||||
> Cloudflare Pages performs a shallow clone by default, so if you rely on `git` for timestamps, it is recommended that you add `git fetch --unshallow &&` to the beginning of the build command (e.g., `git fetch --unshallow && npx quartz plugin restore && npx quartz build`).
|
||||
> Cloudflare Pages performs a shallow clone by default, so if you rely on `git` for timestamps, it is recommended that you add `git fetch --unshallow &&` to the beginning of the build command (e.g., `git fetch --unshallow && npx quartz plugin install && npx quartz build`).
|
||||
|
||||
> [!note]
|
||||
> For more detailed CI/CD configuration including caching and plugin management, see [[ci-cd]].
|
||||
> For more detailed CI/CD configuration including caching and plugin management, see [[migrating#Updating Your CI/CD|the migration guide]].
|
||||
|
||||
## GitHub Pages
|
||||
|
||||
@@ -61,18 +61,32 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for git info
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
- name: Cache Quartz plugins
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: .quartz/plugins
|
||||
key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-plugins-
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
- name: Restore Quartz plugins
|
||||
run: npx quartz plugin restore
|
||||
- name: Install Quartz plugins
|
||||
run: npx quartz plugin install
|
||||
- name: Build Quartz
|
||||
run: npx quartz build
|
||||
- name: Upload artifact
|
||||
@@ -120,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.
|
||||
|
||||
@@ -152,7 +170,7 @@ Before deploying to Vercel, a `vercel.json` file is required at the root of the
|
||||
| ----------------------------------------- | ----------------------------------------------- |
|
||||
| Framework Preset | `Other` |
|
||||
| Root Directory | `./` |
|
||||
| Build and Output Settings > Build Command | `npx quartz plugin restore && npx quartz build` |
|
||||
| Build and Output Settings > Build Command | `npx quartz plugin install && npx quartz build` |
|
||||
|
||||
5. Press Deploy. Once it's live, you'll have 2 `*.vercel.app` URLs to view the page.
|
||||
|
||||
@@ -183,7 +201,7 @@ Using `docs.example.com` is an example of a subdomain. They're a simple way of c
|
||||
|
||||
1. Log in to the [Netlify dashboard](https://app.netlify.com/) and click "Add new site".
|
||||
2. Select your Git provider and repository containing your Quartz project.
|
||||
3. Under "Build command", enter `npx quartz plugin restore && npx quartz build`.
|
||||
3. Under "Build command", enter `npx quartz plugin install && npx quartz build`.
|
||||
4. Under "Publish directory", enter `public`.
|
||||
5. Press Deploy. Once it's live, you'll have a `*.netlify.app` URL to view the page.
|
||||
6. To add a custom domain, check "Domain management" in the left sidebar, just like with Vercel.
|
||||
@@ -197,11 +215,14 @@ stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
image: node:22
|
||||
cache: # Cache modules in between jobs
|
||||
key: $CI_COMMIT_REF_SLUG
|
||||
paths:
|
||||
- .npm/
|
||||
image: node:24
|
||||
cache:
|
||||
- key: npm-$CI_COMMIT_REF_SLUG
|
||||
paths:
|
||||
- .npm/
|
||||
- key: plugins-$CI_COMMIT_REF_SLUG
|
||||
paths:
|
||||
- .quartz/plugins/
|
||||
|
||||
build:
|
||||
stage: build
|
||||
@@ -211,13 +232,11 @@ build:
|
||||
- hash -r
|
||||
- npm ci --cache .npm --prefer-offline
|
||||
script:
|
||||
- npx quartz plugin restore
|
||||
- npx quartz plugin install
|
||||
- npx quartz build
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
tags:
|
||||
- gitlab-org-docker
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
@@ -295,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>
|
||||
```
|
||||
+37
-12
@@ -6,30 +6,55 @@ Quartz is a fast, batteries-included static-site generator that transforms Markd
|
||||
|
||||
## 🪴 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.
|
||||
|
||||
Then, in your terminal of choice, enter the following commands line by line:
|
||||
> [!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.
|
||||
|
||||
```shell
|
||||
git clone -b v5 https://github.com/jackyzha0/quartz.git
|
||||
# 1. Clone the Quartz repository
|
||||
git clone https://github.com/jackyzha0/quartz.git
|
||||
cd quartz
|
||||
|
||||
# 2. Install dependencies
|
||||
npm i
|
||||
npx quartz plugin restore
|
||||
|
||||
# 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
|
||||
```
|
||||
|
||||
This will guide you through initializing your Quartz with content, including choosing a [[cli/create#templates|project template]] and configuring your site's base URL. Once you've done so, see how to:
|
||||
Your site is now running at `http://localhost:8080`. From here:
|
||||
|
||||
1. [[authoring content|Writing content]] in Quartz
|
||||
2. [[configuration|Configure]] Quartz's behaviour
|
||||
3. Change Quartz's [[layout]]
|
||||
4. [[build|Build and preview]] Quartz
|
||||
5. Sync your changes with [[setting up your GitHub repository|GitHub]]
|
||||
6. [[hosting|Host]] Quartz online
|
||||
- **[[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?
|
||||
|
||||
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]], [[backlinks]], [[features/Latex|Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], [[i18n|internationalization]], [[comments]] and [many more](./features/) right out of the box
|
||||
- [[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
|
||||
- Hot-reload on configuration edits and incremental rebuilds for content edits
|
||||
- Simple JSX layouts and [[creating components|page components]]
|
||||
- [[SPA Routing|Ridiculously fast page loads]] and tiny bundle sizes
|
||||
|
||||
+34
-3
@@ -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,29 @@ 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 |
|
||||
|
||||
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"
|
||||
@@ -178,7 +209,7 @@ Plugins can ship their own frames by declaring them in `package.json` and export
|
||||
|
||||
**2. Core frames (for project-specific frames):**
|
||||
|
||||
You can also create frames directly in `quartz/components/frames/` by implementing the `PageFrame` interface and registering the frame in `quartz/components/frames/index.ts`. See the [[advanced/architecture|architecture overview]] for the full `PageFrame` interface.
|
||||
You can also create frames directly in `quartz/components/frames/` by implementing the `PageFrame` interface and registering the frame in `quartz/components/frames/index.ts`. See the [[architecture|architecture overview]] for the full `PageFrame` interface.
|
||||
|
||||
Frames are applied as a `data-frame` attribute on the `.page` element, which you can target in CSS:
|
||||
|
||||
|
||||
@@ -1,34 +1,64 @@
|
||||
---
|
||||
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`
|
||||
|
||||
### 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,7 +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).
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Assets
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image: https://images.unsplash.com/photo-1526304640581-d334cdbbf45e
|
||||
---
|
||||
|
||||
This plugin emits all non-Markdown static assets in your content folder (like images, videos, HTML, etc). The plugin respects the `ignorePatterns` in the global [[configuration]].
|
||||
|
||||
@@ -1,7 +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.
|
||||
@@ -9,7 +14,7 @@ Shows pages that link to the current page.
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
See [[backlinks]] for detailed usage information.
|
||||
See [[plugins/Backlinks]] for detailed usage information.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
---
|
||||
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).
|
||||
@@ -23,11 +29,19 @@ This plugin provides support for [Obsidian Bases](https://obsidian.md/changelog/
|
||||
- **Property configuration**: Custom display names for properties.
|
||||
- **Link rendering**: Wikilinks and Markdown links within cell values are rendered as clickable links.
|
||||
|
||||
## Interaction with `unlisted` pages
|
||||
|
||||
`BasesPage` respects the `file.data.unlisted` convention written by [[UnlistedPages]] and [[EncryptedPages]]. Pages marked `unlisted: true` (or encrypted pages with `stealth: true`) are excluded from every rendered base view — table, list, board, cards, gallery, and any custom view — regardless of whether the base's filter expression would match them. Unlisted pages also cannot be dereferenced from formulas on visible pages via `.asFile()`.
|
||||
|
||||
> [!note]
|
||||
> Base views are **server-side rendered** HTML baked at build time. They do not update client-side after a visitor decrypts an encrypted page. Graph, explorer, and search all re-hydrate from the patched in-memory content index and show newly-unlocked pages for the rest of the browser session — base views do not, because they were materialized at build time with unlisted pages already excluded. A visitor who successfully decrypts a revealable encrypted page will see it appear in graph, explorer, and search, but **not** in any base view, until the site is rebuilt with that page listed. This is the same structural limitation that applies to backlinks, recent notes, folder listings, and tag listings.
|
||||
|
||||
## Configuration
|
||||
|
||||
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 the `markdownLinkResolution` setting of the [[CrawlLinks]] plugin. 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
|
||||
@@ -42,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,7 +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.
|
||||
@@ -9,7 +14,7 @@ Navigation breadcrumb trail.
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
See [[breadcrumbs]] for detailed usage information.
|
||||
See [[plugins/Breadcrumbs]] for detailed usage information.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -1,7 +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,7 +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,7 +1,12 @@
|
||||
---
|
||||
title: "Citations"
|
||||
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.
|
||||
@@ -15,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,7 +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.).
|
||||
@@ -9,7 +14,7 @@ Comment system (giscus, utterances, etc.).
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
See [[comments]] for detailed usage information.
|
||||
See [[plugins/Comments]] for detailed usage information.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: ComponentResources
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image:
|
||||
---
|
||||
|
||||
This plugin manages and emits the static resources required for the Quartz framework. This includes CSS stylesheets and JavaScript scripts that enhance the functionality and aesthetics of the generated site. See also the `cdnCaching` option in the `theme` section of the [[configuration]].
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: ContentIndex
|
||||
description: Generates sitemap, RSS feed, and content index.
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image:
|
||||
repository: "[quartz-community/content-index](https://github.com/quartz-community/content-index)"
|
||||
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.
|
||||
@@ -16,7 +21,7 @@ This plugin accepts the following configuration 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.
|
||||
|
||||
|
||||
@@ -1,7 +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,7 +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`.
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: CrawlLinks
|
||||
description: Parses and resolves internal links. Removing it is not recommended.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
repository: "[quartz-community/crawl-links](https://github.com/quartz-community/crawl-links)"
|
||||
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.
|
||||
@@ -19,6 +24,7 @@ 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.
|
||||
|
||||
> [!warning]
|
||||
> Removing this plugin is _not_ recommended and will likely break the page.
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: "CreatedModifiedDate"
|
||||
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.
|
||||
@@ -12,11 +17,12 @@ 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.
|
||||
|
||||
> [!warning]
|
||||
> If you rely on `git` for dates, make sure `defaultDateType` is set to `modified` in `quartz.config.yaml`.
|
||||
> If you rely on `git` for dates, make sure `defaultDateType` is set to `modified` in the plugin's options.
|
||||
>
|
||||
> Depending on how you [[hosting|host]] your Quartz, the `filesystem` dates of your local files may not match the final dates. In these cases, it may be better to use `git` or `frontmatter` to guarantee correct dates.
|
||||
|
||||
|
||||
@@ -1,7 +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.
|
||||
@@ -39,26 +44,30 @@ plugins:
|
||||
For the TS override approach (needed for custom `imageStructure`):
|
||||
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
import { defaultImage } from "./quartz/plugins/emitters/ogImage"
|
||||
|
||||
CustomOgImages({
|
||||
// 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 |
|
||||
| `imageStructure` | component | defaultImage | Custom component to use for image generation |
|
||||
|
||||
## Frontmatter Properties
|
||||
|
||||
|
||||
@@ -1,7 +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.
|
||||
@@ -9,7 +14,7 @@ Dark mode toggle.
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
See [[darkmode]] for detailed usage information.
|
||||
See [[plugins/Darkmode]] for detailed usage information.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -1,7 +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.
|
||||
@@ -13,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,24 +1,27 @@
|
||||
---
|
||||
title: Encrypted Pages Demo
|
||||
password: quartz
|
||||
unlisted: true
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
---
|
||||
|
||||
Congratulations! You've successfully decrypted this page. 🎉
|
||||
|
||||
This is a live demo of the [[EncryptedPages]] plugin. The content you're reading was encrypted at build time using AES-256-GCM and decrypted in your browser using the Web Crypto API.
|
||||
This is a live demo of the [[EncryptedPages]] plugin. The content you're reading was encrypted at build time using AES-256-GCM and decrypted in your browser using the Web Crypto API. This page is also `unlisted: true`, which means it was hidden from every discovery surface on the site until you entered the password.
|
||||
|
||||
## What just happened?
|
||||
|
||||
1. At build time, the plugin read the `password` field from this page's frontmatter and encrypted all content below the title.
|
||||
2. When you visited this page, you were shown a password prompt instead of the page content.
|
||||
3. After entering the correct password, the plugin derived an encryption key using PBKDF2 and decrypted the content client-side.
|
||||
4. A `render` event was dispatched so other components (graph, explorer, etc.) could re-initialize with the decrypted content.
|
||||
2. Because this page is `unlisted: true`, the plugin emitted its metadata (slug, title, links, tags) to a separate `static/encryptedContentIndex.json` file, encrypted with this page's own password.
|
||||
3. When you visited this page, you were shown a password prompt instead of the content. The page was absent from the sidebar graph, explorer, search, RSS, sitemap, backlinks, tag listings, and bases views.
|
||||
4. After entering the correct password, the plugin derived an encryption key using PBKDF2 and decrypted the content client-side.
|
||||
5. The plugin then used the cached password to unlock this page's entry in the shadow content index and patched the in-memory content index in place. A `content-index-updated` event was dispatched, so graph, explorer, and search re-initialized with the newly unlocked entry — if you navigate back to any other page now, you will see this page in the sidebar, the graph, and search results. Server-side rendered listings (backlinks, recent notes, tag pages, folder listings, and [[BasesPage|bases views]]) were baked into HTML at build time and will not update within this session; they will only reflect decrypted pages on a fresh build of the site.
|
||||
|
||||
## Password caching
|
||||
|
||||
Your password has been cached in session storage. If there were other encrypted pages on this site, the plugin would automatically try this password before showing the prompt — so you'd only need to enter it once per session for pages that share the same password.
|
||||
Your password has been cached in session storage. If there were other encrypted pages on this site with the same password, the plugin would automatically try this password on each one — unlocking its content as well as its entry in the shadow content index — so you'd only need to enter it once per session.
|
||||
|
||||
## Try it yourself
|
||||
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
---
|
||||
title: EncryptedPages
|
||||
description: Password-protected encrypted pages with shadow content index.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
- plugin/filter
|
||||
- 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.
|
||||
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.
|
||||
|
||||
> [!example] Live demo
|
||||
> Try it yourself: [[EncryptedPages Demo]]. The password is `quartz`.
|
||||
@@ -28,19 +34,65 @@ The page content will be encrypted at build time. Visitors must enter the correc
|
||||
|
||||
Successful passwords are cached in the browser's session storage and automatically tried on other encrypted pages for convenience.
|
||||
|
||||
### Hiding encrypted pages from discovery surfaces
|
||||
|
||||
By default, encrypted pages still appear in the graph, explorer, search, RSS, sitemap, and backlinks — visitors can see the page exists and its title, but cannot read the content without the password.
|
||||
|
||||
To hide an encrypted page entirely until a visitor successfully decrypts it, set `unlisted: true` in its frontmatter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: My Secret Page
|
||||
password: mysecretpassword
|
||||
unlisted: true
|
||||
---
|
||||
```
|
||||
|
||||
An unlisted page:
|
||||
|
||||
- Is **absent** from `contentIndex.json`, `sitemap.xml`, the RSS feed, backlinks, recent notes, folder listings, tag listings, bases views, graph, explorer, and search.
|
||||
- Is still emitted as HTML, so it remains accessible by direct URL.
|
||||
- Has its metadata (slug, title, links, tags) written to a separate `static/encryptedContentIndex.json` file, encrypted with the page's own password.
|
||||
- Is dynamically re-added to the in-memory content index when a visitor successfully decrypts it, so graph, explorer, and search reflect it for the rest of the browser session. Server-rendered listings — backlinks, recent notes, tag pages, folder listings, and [[BasesPage|bases views]] — remain statically hidden even after decryption because they are baked as HTML at build time.
|
||||
|
||||
To make this the default for every encrypted page on your site, set `unlistWhenEncrypted: true` in the plugin options. Individual pages can then opt back in with `unlisted: false`.
|
||||
|
||||
> [!note]
|
||||
> The `unlisted: true` frontmatter field above only takes effect for encrypted pages when this plugin is installed. If you also want `unlisted: true` to work on **non-encrypted** pages across your site, install [[UnlistedPages]] alongside this one. The two plugins compose cleanly — when both are enabled, `unlisted: true` hides any page, encrypted or not, from every discovery surface that respects the `file.data.unlisted` convention.
|
||||
|
||||
### Permanently hiding encrypted pages (`stealth`)
|
||||
|
||||
By default, an `unlisted: true` encrypted page is _revealed_ in graph, explorer, and search after a visitor successfully decrypts it. This is usually what you want: the user just proved they know the password, so showing them the page in the sidebar makes sense for the rest of their session.
|
||||
|
||||
If you instead want a page that stays permanently invisible — accessible only by direct URL, even to users who have successfully decrypted other pages on the same site — set `stealth: true` in its frontmatter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: Deep Secret
|
||||
password: mysecretpassword
|
||||
stealth: true
|
||||
---
|
||||
```
|
||||
|
||||
A stealth page:
|
||||
|
||||
- Is **absent** from every discovery surface, same as any `unlisted` page.
|
||||
- Has **no entry** in the shadow content index (`encryptedContentIndex.json`). The plugin deliberately skips stealth pages when building the shadow index.
|
||||
- Stays hidden even after the visitor enters the correct password. Since there is no shadow-index entry to decrypt, there is nothing to patch into the in-memory content index — graph, explorer, and search never learn the page exists. Only the decrypted HTML is visible to the user on the page itself.
|
||||
- The password is still cached in session storage, so re-visiting the same stealth page will auto-unlock it.
|
||||
|
||||
`stealth: true` implies `unlisted: true` — you do not need to set both, and if you write `stealth: true, unlisted: false` the stealth flag wins. On non-encrypted pages `stealth: true` has no effect (there is no shadow index to skip).
|
||||
|
||||
Use stealth pages for "secret door" content that should only reach users who already know the exact URL: private notes linked from an external wiki, personal pages you send to specific people, or anything you never want to show up in a site-internal search even to authenticated readers.
|
||||
|
||||
## Configuration
|
||||
|
||||
This plugin provides a transformer, a filter, and a component.
|
||||
This plugin provides a transformer, an emitter, and a component. All options are set on a single config entry and shared between the transformer and the emitter — Quartz instantiates both automatically.
|
||||
|
||||
### Transformer options
|
||||
|
||||
- `visibility`: How encrypted pages appear in graph, explorer, and backlinks. `"visible"` shows the page normally, `"icon"` adds a lock indicator, `"hidden"` hides the page completely. Defaults to `"icon"`.
|
||||
- `iterations`: PBKDF2 iteration count for key derivation. Higher values are more secure but slower to unlock. Defaults to `600000`.
|
||||
- `passwordField`: Frontmatter field name that holds the page password. Defaults to `"password"`.
|
||||
|
||||
### Filter options
|
||||
|
||||
- `visibility`: Controls whether encrypted pages appear in search, RSS, and sitemap. When set to `"hidden"`, encrypted pages are excluded from content indices entirely. Defaults to `"icon"`.
|
||||
- `passwordField`: Frontmatter field name that holds the page password. Shared by the transformer and the emitter. Defaults to `"password"`.
|
||||
- `unlistWhenEncrypted`: If `true`, every encrypted page is marked `unlisted` unless its frontmatter explicitly overrides it. Defaults to `false`.
|
||||
- `outputPath`: Output path for the shadow content index, relative to Quartz's output directory. Defaults to `"static/encryptedContentIndex.json"`.
|
||||
|
||||
### Component options
|
||||
|
||||
@@ -52,21 +104,26 @@ This plugin provides a transformer, a filter, and a component.
|
||||
- source: github:quartz-community/encrypted-pages
|
||||
enabled: true
|
||||
options:
|
||||
visibility: icon
|
||||
iterations: 600000
|
||||
passwordField: password
|
||||
unlistWhenEncrypted: false
|
||||
outputPath: static/encryptedContentIndex.json
|
||||
```
|
||||
|
||||
> [!warning]
|
||||
> The `EncryptedPages` transformer replaces the entire HAST tree of an encrypted page with an opaque ciphertext container. Any transformer that needs to read the real HTML — in particular [[CrawlLinks]], which populates the links used by backlinks and the shadow content index — must run **before** `EncryptedPages`. Use the `order` field in `quartz.config.yaml` to control this.
|
||||
|
||||
## Security
|
||||
|
||||
- Content is encrypted with AES-256-GCM using PBKDF2 SHA-256 key derivation.
|
||||
- Plaintext is stripped from search indices and RSS feeds regardless of visibility setting.
|
||||
- Plaintext is stripped from search indices, RSS feeds, and the shadow content index regardless of visibility setting.
|
||||
- The shadow content index is a flat array of opaque encrypted blobs. An attacker who downloads it learns only the number of unlisted encrypted pages and the PBKDF2 iteration count — no slugs, titles, or link relationships leak.
|
||||
- Passwords are set per-page in frontmatter. Avoid committing passwords to public repositories.
|
||||
- This is client-side encryption of a static site. It protects against casual browsing but not against determined attackers with access to the page source.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Transformer, Filter
|
||||
- Function name: `ExternalPlugin.EncryptedPages()`, `ExternalPlugin.EncryptedPageFilter()`.
|
||||
- Category: Transformer, Emitter
|
||||
- Function name: `ExternalPlugin.EncryptedPages()`, `ExternalPlugin.EncryptedContentIndex()`.
|
||||
- Source: [`quartz-community/encrypted-pages`](https://github.com/quartz-community/encrypted-pages)
|
||||
- Install: `npx quartz plugin add github:quartz-community/encrypted-pages`
|
||||
@@ -1,7 +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.
|
||||
|
||||
@@ -1,7 +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.
|
||||
@@ -9,17 +14,26 @@ File tree explorer sidebar.
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
See [[explorer]] for detailed usage information.
|
||||
See [[plugins/Explorer]] for detailed usage information.
|
||||
|
||||
## Configuration
|
||||
|
||||
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`.
|
||||
|
||||
**TS override options** (in `quartz.ts`, for callback functions that can't be expressed in YAML):
|
||||
|
||||
- `sortFn`: Custom sort function for ordering files and folders.
|
||||
- `filterFn`: Custom filter function to exclude specific nodes.
|
||||
- `mapFn`: Custom map function to transform node properties (e.g. display names).
|
||||
- `order`: Array controlling the order of operations. Defaults to `["filter", "map", "sort"]`.
|
||||
|
||||
### Default options
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
@@ -27,11 +41,27 @@ This plugin accepts the following configuration options:
|
||||
enabled: true
|
||||
options:
|
||||
title: Explorer
|
||||
folderClickBehavior: collapse
|
||||
folderClickBehavior: link
|
||||
folderDefaultState: collapsed
|
||||
useSavedState: true
|
||||
```
|
||||
|
||||
### TS override example
|
||||
|
||||
```ts title="quartz.ts"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.Explorer({
|
||||
mapFn: (node) => {
|
||||
node.displayName = node.displayName.toUpperCase()
|
||||
return node
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
See [[features/explorer#Advanced customization]] for more examples.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Component
|
||||
|
||||
@@ -1,7 +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,7 +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.
|
||||
@@ -13,7 +18,10 @@ 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,7 +1,12 @@
|
||||
---
|
||||
title: Footer
|
||||
description: Page footer with configurable links.
|
||||
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.
|
||||
|
||||
+25
-21
@@ -1,14 +1,18 @@
|
||||
---
|
||||
title: "Frontmatter"
|
||||
title: Frontmatter
|
||||
aliases:
|
||||
- note-properties
|
||||
- Note Properties
|
||||
description: "Parses frontmatter and displays note properties in a collapsible panel."
|
||||
description: Parses frontmatter and displays note properties in a collapsible panel.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
- plugin/component
|
||||
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.
|
||||
@@ -51,7 +55,7 @@ This plugin accepts the following configuration options:
|
||||
|
||||
When enabled, this plugin renders a collapsible "Properties" panel before the page body. The panel displays selected frontmatter fields in a table with automatic type rendering:
|
||||
|
||||
- **Strings** are shown as plain text. [[Wikilinks]] and [markdown links](https://example.com) within strings are rendered as clickable links.
|
||||
- **Strings** are shown as plain text. [[wikilinks]] and [markdown links](https://example.com) within strings are rendered as clickable links. Wikilink targets are slugified the same way as body-content links (e.g. `[[My Note]]` resolves to `my-note`) and matching is case-insensitive to mirror Obsidian's behavior, so `[[MyNote]]`, `[[mynote]]`, and `[[MYNOTE]]` all point to the same page.
|
||||
- **Arrays** are rendered as comma-separated lists.
|
||||
- **Booleans** are rendered as disabled checkboxes.
|
||||
- **Numbers** are rendered in a monospace font.
|
||||
@@ -80,24 +84,24 @@ quartz-properties-collapse: false
|
||||
|
||||
Quartz supports the following frontmatter fields. Where multiple keys are listed, they are aliases — the first matching key is used.
|
||||
|
||||
| Field | Keys | Description |
|
||||
| ------------------ | ------------------------------------------------- | ------------------------------------------------------------------ |
|
||||
| Title | `title` | Page title. Falls back to filename if empty. |
|
||||
| Description | `description` | Page description for metadata and search. |
|
||||
| Tags | `tags`, `tag` | Categorization tags. Automatically slugified. |
|
||||
| Aliases | `aliases`, `alias` | Alternative names for the page, used for link resolution. |
|
||||
| Permalink | `permalink` | Custom URL slug. Also added to aliases. |
|
||||
| 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. |
|
||||
| Created date | `created`, `date` | When the note was created. |
|
||||
| Modified date | `modified`, `lastmod`, `updated`, `last-modified` | When the note was last modified. Falls back to `created` if unset. |
|
||||
| Published date | `published`, `publishDate`, `date` | When the note was published. |
|
||||
| Publish | `publish` | Whether the note should be published. |
|
||||
| Draft | `draft` | Whether the note is a draft. |
|
||||
| Comments | `comments` | Whether comments are enabled for the note. |
|
||||
| Language | `lang` | Language code for the note. |
|
||||
| Enable TOC | `enableToc` | Whether to show the table of contents. |
|
||||
| Field | Keys | Description |
|
||||
| ------------------ | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Title | `title` | Page title. Falls back to filename if empty. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| Created date | `created`, `date` | When the note was created. |
|
||||
| Modified date | `modified`, `lastmod`, `updated`, `last-modified` | When the note was last modified. Falls back to `created` if unset. |
|
||||
| Published date | `published`, `publishDate`, `date` | When the note was published. |
|
||||
| Publish | `publish` | Whether the note should be published. |
|
||||
| Draft | `draft` | Whether the note is a draft. |
|
||||
| Comments | `comments` | Whether comments are enabled for the note. |
|
||||
| Language | `lang` | Language code for the note. |
|
||||
| Enable TOC | `enableToc` | Whether to show the table of contents. |
|
||||
|
||||
## API
|
||||
|
||||
|
||||
@@ -1,7 +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.
|
||||
|
||||
+16
-10
@@ -1,7 +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.
|
||||
@@ -23,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
|
||||
|
||||
@@ -52,6 +57,7 @@ Both `localGraph` and `globalGraph` accept the following options:
|
||||
opacityScale: 1
|
||||
removeTags: []
|
||||
showTags: true
|
||||
focusOnHover: false
|
||||
enableRadial: false
|
||||
globalGraph:
|
||||
drag: true
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: HardLineBreaks
|
||||
description: Treats single newlines as hard line breaks.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image: "#ff8000"
|
||||
repository: "[quartz-community/hard-line-breaks](https://github.com/quartz-community/hard-line-breaks)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin automatically converts single line breaks in Markdown text into hard line breaks in the HTML output. This plugin is not enabled by default as this doesn't follow the semantics of actual Markdown but you may enable it if you'd like parity with [[Obsidian compatibility|Obsidian]].
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: "Latex"
|
||||
title: Latex
|
||||
description: Renders LaTeX math expressions via KaTeX or Typst.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
repository: "[quartz-community/latex](https://github.com/quartz-community/latex)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin adds LaTeX support to Quartz. See [[features/Latex|Latex]] for more information.
|
||||
@@ -13,6 +18,9 @@ This plugin accepts the following configuration options:
|
||||
|
||||
- `renderEngine`: the engine to use to render LaTeX equations. Can be `"katex"` for [KaTeX](https://katex.org/), `"mathjax"` for [MathJax](https://www.mathjax.org/) [SVG rendering](https://docs.mathjax.org/en/latest/output/svg.html), or `"typst"` for [Typst](https://typst.app/) (a new way to compose LaTeX equation). Defaults to KaTeX.
|
||||
- `customMacros`: custom macros for all LaTeX blocks. It takes the form of a key-value pair where the key is a new command name and the value is the expansion of the macro. For example: `{"\\R": "\\mathbb{R}"}`
|
||||
- `katexOptions`: Additional options passed to the KaTeX renderer. See the [KaTeX docs](https://katex.org/docs/options) for available options.
|
||||
- `mathJaxOptions`: Additional options passed to the MathJax renderer. See the [MathJax docs](https://docs.mathjax.org/en/latest/options/) for available options.
|
||||
- `typstOptions`: Additional options passed to the Typst renderer.
|
||||
|
||||
## API
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: NotFoundPage
|
||||
tags:
|
||||
- plugin/pageType
|
||||
image:
|
||||
---
|
||||
|
||||
This plugin emits a 404 (Not Found) page for broken or non-existent URLs. It uses the `minimal` [[layout#Page Frames|page frame]] (no sidebars, no header or beforeBody chrome — only content and footer) to present a clean error page.
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
---
|
||||
title: NoteProperties
|
||||
description: Displays frontmatter properties in a collapsible panel.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/note-properties](https://github.com/quartz-community/note-properties)"
|
||||
enabled: true
|
||||
required: true
|
||||
---
|
||||
|
||||
The NoteProperties plugin is documented under [[Frontmatter]].
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: ObsidianFlavoredMarkdown
|
||||
description: Obsidian-specific Markdown extensions (wikilinks, callouts, highlights, tags, embeds).
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
repository: "[quartz-community/obsidian-flavored-markdown](https://github.com/quartz-community/obsidian-flavored-markdown)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin provides support for [[Obsidian compatibility]].
|
||||
@@ -24,7 +29,9 @@ This plugin accepts the following configuration options:
|
||||
- `enableVideoEmbed`: If `true` (default), enables the embedding of video files.
|
||||
- `enableCheckbox`: If `true`, adds support for interactive checkboxes in content, including custom task characters (e.g. `- [?]`, `- [!]`, `- [/]`). Defaults to `false`.
|
||||
- `enableObsidianUri`: If `true` (default), marks `obsidian://` protocol links with a CSS class and data attribute for custom styling.
|
||||
- `disableBrokenWikilinks`: If `true`, replaces links to non-existent notes with a dimmed, disabled link. Defaults to `false`.
|
||||
|
||||
> [!note]
|
||||
> The `disableBrokenWikilinks` option previously lived on this plugin. It has moved to [[CrawlLinks]], which owns link resolution and can honor the configured `markdownLinkResolution` strategy when deciding whether a link is broken. Users upgrading from earlier Quartz v5 betas should move the option from `ObsidianFlavoredMarkdown` to `CrawlLinks`.
|
||||
|
||||
> [!warning]
|
||||
> Don't remove this plugin if you're using [[Obsidian compatibility|Obsidian]] to author the content!
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: OxHugoFlavoredMarkdown
|
||||
description: Compatibility for ox-hugo exported Org-mode files.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
repository: "[quartz-community/ox-hugo](https://github.com/quartz-community/ox-hugo)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin provides support for [ox-hugo](https://github.com/kaushalmodi/ox-hugo) compatibility. See [[OxHugo compatibility]] for more information.
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: PageTitle
|
||||
description: Renders the site title as a home link.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/page-title](https://github.com/quartz-community/page-title)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin renders the site-wide page title (configured via the `pageTitle` field in [[configuration]]) as a clickable link to the home page. It typically appears in the left sidebar.
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
---
|
||||
title: ReaderMode
|
||||
description: Distraction-free reading mode toggle.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/reader-mode](https://github.com/quartz-community/reader-mode)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Distraction-free reading mode.
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: RecentNotes
|
||||
description: Displays a list of recently modified notes.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/recent-notes](https://github.com/quartz-community/recent-notes)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
Shows recently modified notes.
|
||||
@@ -16,9 +21,11 @@ See [[recent notes]] for detailed usage information.
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `title`: The title of the recent notes section. Defaults to `Recent notes`.
|
||||
- `limit`: The maximum number of recent notes to display. Defaults to `5`.
|
||||
- `limit`: The maximum number of recent notes to display. Defaults to `3`.
|
||||
- `showTags`: Whether to display the tags for each note. Defaults to `true`.
|
||||
- `linkToMore`: A slug to a page that shows more notes. Defaults to `""`.
|
||||
- `linkToMore`: A slug to a page that shows more notes. Defaults to `false`.
|
||||
- `hideTagPages`: Whether to hide tag index pages from the list. Defaults to `false`.
|
||||
- `hideFolderPages`: Whether to hide folder index pages from the list. Defaults to `false`.
|
||||
|
||||
### Default options
|
||||
|
||||
@@ -26,10 +33,10 @@ This plugin accepts the following configuration options:
|
||||
- source: github:quartz-community/recent-notes
|
||||
enabled: true
|
||||
options:
|
||||
title: Recent notes
|
||||
limit: 5
|
||||
limit: 3
|
||||
showTags: true
|
||||
linkToMore: ""
|
||||
hideTagPages: false
|
||||
hideFolderPages: false
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: RemoveDrafts
|
||||
description: Filters out pages marked as drafts.
|
||||
tags:
|
||||
- plugin/filter
|
||||
image:
|
||||
repository: "[quartz-community/remove-draft](https://github.com/quartz-community/remove-draft)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin filters out content from your vault, so that only finalized content is made available. This prevents [[private pages]] from being published. By default, it filters out all pages with `draft: true` in the frontmatter and leaves all other pages intact.
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
---
|
||||
title: RoamFlavoredMarkdown
|
||||
description: Compatibility for Roam Research export format.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
repository: "[quartz-community/roam](https://github.com/quartz-community/roam)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin provides support for [Roam Research](https://roamresearch.com) compatibility. See [[Roam Research Compatibility]] for more information.
|
||||
This plugin provides support for [Roam Research](https://roamresearch.com) compatibility. See [[Roam Research compatibility]] for more information.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page.
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
@@ -18,6 +23,8 @@ This plugin accepts the following configuration options:
|
||||
- `audioComponent`: If `true` (default), converts Roam `{{[[audio]]:URL}}` shortcodes into embeded HTML audio.
|
||||
- `pdfComponent`: If `true` (default), converts Roam `{{[[pdf]]:URL}}` shortcodes into embeded HTML PDF viewer.
|
||||
- `blockquoteComponent`: If `true` (default), converts Roam `{{[[>]]}}` shortcodes into Quartz blockquotes.
|
||||
- `tableComponent`: If `true` (default), converts Roam table syntax into HTML tables.
|
||||
- `attributeComponent`: If `true` (default), converts Roam attribute syntax into rendered attributes.
|
||||
|
||||
## API
|
||||
|
||||
|
||||
+13
-1
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: Search
|
||||
description: Full-text search with tag filtering and keyboard navigation.
|
||||
tags:
|
||||
- plugin/component
|
||||
image: https://images.unsplash.com/photo-1516382799247-87df95d790b7
|
||||
repository: "[quartz-community/search](https://github.com/quartz-community/search)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Full-text search functionality.
|
||||
@@ -15,13 +20,20 @@ See [[full-text search]] for detailed usage information.
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `enabled`: Whether to enable full-text search. Defaults to `true`.
|
||||
- `enablePreview`: Whether to show a preview of the page content in search results. Defaults to `true`.
|
||||
- `fieldPriority`: An array specifying the priority order for search fields. Defaults to `["title", "content", "tags"]`.
|
||||
|
||||
### Default options
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
- source: github:quartz-community/search
|
||||
enabled: true
|
||||
options:
|
||||
enablePreview: true
|
||||
fieldPriority:
|
||||
- title
|
||||
- content
|
||||
- tags
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
---
|
||||
title: Spacer
|
||||
description: Flexible spacer for layout groups.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/spacer](https://github.com/quartz-community/spacer)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin renders a flexible spacer element that pushes adjacent components apart within a layout group. It uses CSS `flex: 2 1 auto` to fill available space, making it useful for spacing out items in toolbars or sidebars (for example, separating the search bar from the darkmode toggle in the left sidebar toolbar).
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
---
|
||||
title: StackedPages
|
||||
description: Andy Matuschak-style stacked sliding panes.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/stacked-pages](https://github.com/quartz-community/stacked-pages)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Andy Matuschak-style stacked pages (sliding panes). Clicking internal links opens pages side by side in a horizontal stack, allowing you to trace your path through your notes. Each pane shows a full page and can be individually scrolled or closed.
|
||||
@@ -26,11 +32,9 @@ Stacked pages are disabled on mobile by default (below 800px) since horizontal p
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `paneWidth`: Width of each stacked pane in pixels. Defaults to `640`.
|
||||
- `maxPanes`: Maximum number of panes visible at once. Defaults to `5`.
|
||||
- `enableOnMobile`: Whether to enable stacked pages on mobile devices. Defaults to `false`.
|
||||
- `mobileBreakpoint`: Viewport width (in pixels) below which the mobile behavior applies. Matches the Quartz mobile breakpoint. Defaults to `800`.
|
||||
- `showSpines`: Whether to show collapsed spine headers when panes overflow. Defaults to `true`.
|
||||
- `maxTabs`: Maximum number of stacked panes visible at once. Defaults to `8`.
|
||||
- `mobileBreakpoint`: Viewport width (in pixels) below which stacked pages are disabled and links navigate normally. Defaults to `800`.
|
||||
- `showSpines`: Whether to show collapsed spine headers when panes overflow the viewport. Defaults to `true`.
|
||||
- `animateTransitions`: Whether to animate pane open/close transitions. Defaults to `true`.
|
||||
|
||||
### Default options
|
||||
@@ -43,9 +47,7 @@ This plugin accepts the following configuration options:
|
||||
priority: 50
|
||||
display: all
|
||||
options:
|
||||
paneWidth: 640
|
||||
maxPanes: 5
|
||||
enableOnMobile: false
|
||||
maxTabs: 8
|
||||
mobileBreakpoint: 800
|
||||
showSpines: true
|
||||
animateTransitions: true
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Static
|
||||
tags:
|
||||
- plugin/emitter
|
||||
image:
|
||||
---
|
||||
|
||||
This plugin emits all static resources needed by Quartz. This is used, for example, for fonts and images that need a stable position, such as banners and icons. The plugin respects the `ignorePatterns` in the global [[configuration]].
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: "SyntaxHighlighting"
|
||||
title: SyntaxHighlighting
|
||||
description: Syntax highlighting for code blocks.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image: https://images.unsplash.com/photo-1580569214296-5cf2bffc5ccd
|
||||
repository: "[quartz-community/syntax-highlighting](https://github.com/quartz-community/syntax-highlighting)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin is used to add syntax highlighting to code blocks in Quartz. See [[syntax highlighting]] for more information.
|
||||
@@ -11,8 +16,10 @@ This plugin is used to add syntax highlighting to code blocks in Quartz. See [[s
|
||||
|
||||
This plugin accepts the following configuration options:
|
||||
|
||||
- `theme`: a separate id of one of the [themes bundled with Shikiji](https://shikiji.netlify.app/themes). One for light mode and one for dark mode. Defaults to `theme: { light: "github-light", dark: "github-dark" }`.
|
||||
- `theme`: a separate id of one of the [themes bundled with Shikiji](https://shikiji.netlify.app/themes). One for light mode and one for dark mode. Defaults to `theme: { light: "github-light", dark: "github-dark" }`.
|
||||
- `keepBackground`: If set to `true`, the background of the Shikiji theme will be used. With `false` (default) the Quartz theme color for background will be used instead.
|
||||
- `clipboard`: Whether to add a copy-to-clipboard button to code blocks. Defaults to `true`.
|
||||
- `tokenClassification`: Whether to add semantic token classification CSS classes to code tokens. Defaults to `true`.
|
||||
|
||||
In addition, you can further override the colours in the `quartz/styles/syntax.scss` file.
|
||||
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
---
|
||||
title: TableOfContents
|
||||
description: Generates and renders a table of contents from headings.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
- plugin/component
|
||||
image: https://images.unsplash.com/photo-1768527338896-3765921e992d
|
||||
repository: "[quartz-community/table-of-contents](https://github.com/quartz-community/table-of-contents)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin generates a table of contents (TOC) for Markdown documents. See [[table of contents]] for more information.
|
||||
@@ -15,13 +21,14 @@ This plugin accepts the following configuration options:
|
||||
- `minEntries`: The minimum number of heading entries required for the TOC to be displayed. Default is `1`.
|
||||
- `showByDefault`: If `true` (default), the TOC should be displayed by default. Can be overridden by frontmatter settings.
|
||||
- `collapseByDefault`: If `true`, the TOC will start in a collapsed state. Default is `false`.
|
||||
- `layout`: The visual layout of the TOC component. Can be `"modern"` or `"legacy"`. Default is `"modern"`.
|
||||
|
||||
> [!warning]
|
||||
> This plugin needs the `Plugin.TableOfContents` component in `quartz.config.yaml` to determine where to display the TOC. Without it, nothing will be displayed. They should always be added or removed together.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Transformer
|
||||
- Category: Transformer, Component
|
||||
- Function name: `ExternalPlugin.TableOfContentsTransformer()`.
|
||||
- Source: [`quartz-community/table-of-contents`](https://github.com/quartz-community/table-of-contents)
|
||||
- Install: `npx quartz plugin add github:quartz-community/table-of-contents`
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: TagList
|
||||
description: Renders tags as clickable links.
|
||||
tags:
|
||||
- plugin/component
|
||||
image:
|
||||
repository: "[quartz-community/tag-list](https://github.com/quartz-community/tag-list)"
|
||||
enabled: false
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin renders the page's tags as a list of clickable links. Each tag links to its corresponding [[TagPage|tag page]], making it easy for readers to browse related content by topic.
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
---
|
||||
title: TagPage
|
||||
description: Generates listing pages for tags.
|
||||
tags:
|
||||
- plugin/pageType
|
||||
image:
|
||||
repository: "[quartz-community/tag-page](https://github.com/quartz-community/tag-page)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
This plugin is a page type plugin that emits dedicated pages for each tag used in the content. It uses the `default` [[layout#Page Frames|page frame]] (three-column layout with sidebars). See [[folder and tag listings]] for more information.
|
||||
@@ -11,7 +16,9 @@ This plugin is a page type plugin that emits dedicated pages for each tag used i
|
||||
|
||||
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.
|
||||
- `numPages`: The maximum number of pages to display per tag before showing a "see more" link. Defaults to `10`.
|
||||
- `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.
|
||||
- `prefixTags`: If `true`, generated tag page titles are prefixed with "Tag: " (e.g. "Tag: recipes"). Defaults to `false`.
|
||||
|
||||
## API
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: UnlistedPages
|
||||
description: Hides pages from navigation and indexes while still publishing them.
|
||||
tags:
|
||||
- plugin/transformer
|
||||
image:
|
||||
new-in-v5: true
|
||||
repository: "[quartz-community/unlisted-pages](https://github.com/quartz-community/unlisted-pages)"
|
||||
enabled: true
|
||||
required: false
|
||||
---
|
||||
|
||||
Zero-config transformer that makes `unlisted: true` in a page's frontmatter a first-class way to opt out of every listing surface on your site. The page is still emitted as HTML and remains accessible by direct URL, but is absent from `contentIndex.json`, RSS, sitemap, graph, explorer, search, backlinks, recent notes, folder listings, and tag listings.
|
||||
|
||||
> [!note]
|
||||
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
|
||||
|
||||
## Usage
|
||||
|
||||
Add an `unlisted` field to any page's frontmatter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: My Draft
|
||||
unlisted: true
|
||||
---
|
||||
```
|
||||
|
||||
That's it. Every Quartz v5 plugin that respects the `file.data.unlisted` convention will then hide the page.
|
||||
|
||||
## What each plugin does
|
||||
|
||||
| Plugin | Behavior when `unlisted: true` |
|
||||
| -------------- | -------------------------------------------------------------------------- |
|
||||
| `ContentIndex` | Page absent from `contentIndex.json`, `sitemap.xml`, and the RSS feed. |
|
||||
| `Search` | Page absent from search results (derived from `contentIndex.json`). |
|
||||
| `Graph` | Page absent from graph nodes and edges (derived from `contentIndex.json`). |
|
||||
| `Explorer` | Page absent from the sidebar file tree (derived from `contentIndex.json`). |
|
||||
| `Backlinks` | Page never appears as a backlink source on other pages. |
|
||||
| `RecentNotes` | Page absent from the recent notes list. |
|
||||
| `FolderPage` | Page absent from folder listings and folder discovery. |
|
||||
| `TagPage` | Page absent from tag discovery and tag listings. |
|
||||
|
||||
In every case, the page's HTML is still emitted and accessible by direct URL.
|
||||
|
||||
## Configuration
|
||||
|
||||
Zero options. Just enable it.
|
||||
|
||||
```yaml title="quartz.config.yaml"
|
||||
- source: github:quartz-community/unlisted-pages
|
||||
enabled: true
|
||||
```
|
||||
|
||||
## Interaction with [[EncryptedPages]]
|
||||
|
||||
The [[EncryptedPages]] plugin also sets `file.data.unlisted` when its `unlistWhenEncrypted: true` option is set or when a page has `unlisted: true` in frontmatter. The two plugins compose cleanly:
|
||||
|
||||
- If you install only `UnlistedPages`: any page with `unlisted: true` in frontmatter is hidden from listing surfaces. Encryption is independent.
|
||||
- If you install only `EncryptedPages`: `unlisted: true` only takes effect on pages that are also encrypted (have a password). Non-encrypted pages with `unlisted: true` are silently ignored.
|
||||
- If you install both: `unlisted: true` works for every page, encrypted or not. This is the recommended setup for sites that use encrypted pages.
|
||||
|
||||
## API
|
||||
|
||||
- Category: Transformer
|
||||
- Function name: `ExternalPlugin.UnlistedPages()`.
|
||||
- Source: [`quartz-community/unlisted-pages`](https://github.com/quartz-community/unlisted-pages)
|
||||
- Install: `npx quartz plugin add github:quartz-community/unlisted-pages`
|
||||
+121
-64
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Plugins
|
||||
image:
|
||||
---
|
||||
|
||||
Quartz's functionality is provided by a collection of first-party community plugins. Each plugin can be enabled, disabled, and configured via `quartz.config.yaml`. See [[configuration#Plugins|Configuration]] for details on how to manage plugins.
|
||||
@@ -21,69 +22,125 @@ Quartz plugins fall into several categories:
|
||||
|
||||
## First-party plugins
|
||||
|
||||
### Transformers
|
||||
```base
|
||||
filters:
|
||||
and:
|
||||
- file.ext == "md"
|
||||
- file.inFolder("plugins")
|
||||
- "!file.name.startsWith('index')"
|
||||
- "!file.name.contains('Demo')"
|
||||
- "!file.name.contains('Static')"
|
||||
- "!file.name.contains('Assets')"
|
||||
- "!file.name.contains('ComponentResources')"
|
||||
- "!file.name.contains('NotFoundPage')"
|
||||
formulas:
|
||||
category: |
|
||||
if(file.hasTag("plugin/transformer"), "Transformer",
|
||||
if(file.hasTag("plugin/filter"), "Filter",
|
||||
if(file.hasTag("plugin/pageType"), "Page Type",
|
||||
if(file.hasTag("plugin/emitter"), "Emitter",
|
||||
if(file.hasTag("plugin/component"), "Component",
|
||||
"Other")))))
|
||||
properties:
|
||||
title:
|
||||
displayName: Plugin
|
||||
repository:
|
||||
displayName: Repository
|
||||
enabled:
|
||||
displayName: Enabled
|
||||
required:
|
||||
displayName: Required
|
||||
description:
|
||||
displayName: Description
|
||||
views:
|
||||
- type: table
|
||||
name: All Plugins
|
||||
groupBy:
|
||||
property: formula.category
|
||||
direction: ASC
|
||||
order:
|
||||
- title
|
||||
- repository
|
||||
- enabled
|
||||
- required
|
||||
- description
|
||||
sort:
|
||||
- property: formula.category
|
||||
direction: ASC
|
||||
- property: title
|
||||
direction: ASC
|
||||
- type: table
|
||||
name: Transformers
|
||||
filters:
|
||||
and:
|
||||
- file.hasTag("plugin/transformer")
|
||||
order:
|
||||
- title
|
||||
- repository
|
||||
- enabled
|
||||
- required
|
||||
- description
|
||||
sort:
|
||||
- property: title
|
||||
direction: ASC
|
||||
- type: table
|
||||
name: Filters
|
||||
filters:
|
||||
and:
|
||||
- file.hasTag("plugin/filter")
|
||||
order:
|
||||
- title
|
||||
- repository
|
||||
- enabled
|
||||
- required
|
||||
- description
|
||||
sort:
|
||||
- property: title
|
||||
direction: ASC
|
||||
- type: table
|
||||
name: Page Types
|
||||
filters:
|
||||
and:
|
||||
- file.hasTag("plugin/pageType")
|
||||
order:
|
||||
- title
|
||||
- repository
|
||||
- enabled
|
||||
- required
|
||||
- description
|
||||
sort:
|
||||
- property: title
|
||||
direction: ASC
|
||||
- type: table
|
||||
name: Emitters
|
||||
filters:
|
||||
and:
|
||||
- file.hasTag("plugin/emitter")
|
||||
order:
|
||||
- title
|
||||
- repository
|
||||
- enabled
|
||||
- required
|
||||
- description
|
||||
sort:
|
||||
- property: title
|
||||
direction: ASC
|
||||
- type: table
|
||||
name: Components
|
||||
filters:
|
||||
and:
|
||||
- file.hasTag("plugin/component")
|
||||
order:
|
||||
- title
|
||||
- repository
|
||||
- enabled
|
||||
- required
|
||||
- description
|
||||
sort:
|
||||
- property: title
|
||||
direction: ASC
|
||||
|
||||
| Plugin | Repository | Enabled | Required | Description |
|
||||
| -------------------------------- | --------------------------------------------------------------------------------------------------------------- | :-----: | :------: | ---------------------------------------------------------- |
|
||||
| [[Frontmatter\|Note Properties]] | [`quartz-community/note-properties`](https://github.com/quartz-community/note-properties) | ✅ | ✅ | Parses frontmatter and displays note properties. |
|
||||
| [[CreatedModifiedDate]] | [`quartz-community/created-modified-date`](https://github.com/quartz-community/created-modified-date) | ✅ | ❌ | Determines creation and modification dates. |
|
||||
| [[SyntaxHighlighting]] | [`quartz-community/syntax-highlighting`](https://github.com/quartz-community/syntax-highlighting) | ✅ | ❌ | Syntax highlighting for code blocks. |
|
||||
| [[ObsidianFlavoredMarkdown]] | [`quartz-community/obsidian-flavored-markdown`](https://github.com/quartz-community/obsidian-flavored-markdown) | ✅ | ❌ | Obsidian-specific Markdown extensions. |
|
||||
| [[GitHubFlavoredMarkdown]] | [`quartz-community/github-flavored-markdown`](https://github.com/quartz-community/github-flavored-markdown) | ✅ | ❌ | GitHub Flavored Markdown support. |
|
||||
| [[TableOfContents]] | [`quartz-community/table-of-contents`](https://github.com/quartz-community/table-of-contents) | ✅ | ❌ | Generates table of contents data from headings. |
|
||||
| [[CrawlLinks]] | [`quartz-community/crawl-links`](https://github.com/quartz-community/crawl-links) | ✅ | ⚠️ | Parses and resolves links. Removing it is not recommended. |
|
||||
| [[Description]] | [`quartz-community/description`](https://github.com/quartz-community/description) | ✅ | ❌ | Generates page descriptions for metadata. |
|
||||
| [[Latex]] | [`quartz-community/latex`](https://github.com/quartz-community/latex) | ✅ | ❌ | Renders LaTeX math expressions. |
|
||||
| [[Citations]] | [`quartz-community/citations`](https://github.com/quartz-community/citations) | ❌ | ❌ | Academic citation support via BibTeX. |
|
||||
| [[HardLineBreaks]] | [`quartz-community/hard-line-breaks`](https://github.com/quartz-community/hard-line-breaks) | ❌ | ❌ | Treats single newlines as hard line breaks. |
|
||||
| [[OxHugoFlavoredMarkdown]] | [`quartz-community/ox-hugo`](https://github.com/quartz-community/ox-hugo) | ❌ | ❌ | ox-hugo Markdown compatibility. |
|
||||
| [[RoamFlavoredMarkdown]] | [`quartz-community/roam`](https://github.com/quartz-community/roam) | ❌ | ❌ | Roam Research Markdown compatibility. |
|
||||
```
|
||||
|
||||
### Filters
|
||||
|
||||
| Plugin | Repository | Enabled | Required | Description |
|
||||
| ------------------- | ------------------------------------------------------------------------------------------- | :-----: | :------: | --------------------------------------- |
|
||||
| [[RemoveDrafts]] | [`quartz-community/remove-draft`](https://github.com/quartz-community/remove-draft) | ✅ | ❌ | Filters out pages marked as drafts. |
|
||||
| [[ExplicitPublish]] | [`quartz-community/explicit-publish`](https://github.com/quartz-community/explicit-publish) | ❌ | ❌ | Only publishes pages explicitly marked. |
|
||||
|
||||
### Page Types
|
||||
|
||||
| Plugin | Repository | Enabled | Required | Description |
|
||||
| --------------- | ----------------------------------------------------------------------------------- | :-----: | :------: | ----------------------------------------------- |
|
||||
| [[ContentPage]] | [`quartz-community/content-page`](https://github.com/quartz-community/content-page) | ✅ | ❌ | Generates HTML pages for Markdown content. |
|
||||
| [[FolderPage]] | [`quartz-community/folder-page`](https://github.com/quartz-community/folder-page) | ✅ | ❌ | Generates folder listing pages. |
|
||||
| [[TagPage]] | [`quartz-community/tag-page`](https://github.com/quartz-community/tag-page) | ✅ | ❌ | Generates tag listing pages. |
|
||||
| [[CanvasPage]] | [`quartz-community/canvas-page`](https://github.com/quartz-community/canvas-page) | ✅ | ❌ | Renders JSON Canvas files as interactive pages. |
|
||||
| [[BasesPage]] | [`quartz-community/bases-page`](https://github.com/quartz-community/bases-page) | ✅ | ❌ | Renders Obsidian Bases files as database views. |
|
||||
|
||||
### Emitters
|
||||
|
||||
| Plugin | Repository | Enabled | Required | Description |
|
||||
| ---------------------------- | ----------------------------------------------------------------------------------------- | :-----: | :------: | ----------------------------------------------- |
|
||||
| [[AliasRedirects]] | [`quartz-community/alias-redirects`](https://github.com/quartz-community/alias-redirects) | ✅ | ❌ | Generates redirect pages for aliases. |
|
||||
| [[ContentIndex]] | [`quartz-community/content-index`](https://github.com/quartz-community/content-index) | ✅ | ❌ | Generates sitemap, RSS feed, and content index. |
|
||||
| [[Favicon]] | [`quartz-community/favicon`](https://github.com/quartz-community/favicon) | ✅ | ❌ | Emits the site favicon. |
|
||||
| [[CustomOgImages\|OG Image]] | [`quartz-community/og-image`](https://github.com/quartz-community/og-image) | ✅ | ❌ | Generates Open Graph social preview images. |
|
||||
| [[CNAME]] | [`quartz-community/cname`](https://github.com/quartz-community/cname) | ✅ | ❌ | Emits a CNAME file for custom domains. |
|
||||
|
||||
### Components
|
||||
|
||||
| Plugin | Repository | Enabled | Required | Description |
|
||||
| ------------------------------ | ----------------------------------------------------------------------------------------- | :-----: | :------: | ------------------------------------------- |
|
||||
| [[ArticleTitle]] | [`quartz-community/article-title`](https://github.com/quartz-community/article-title) | ✅ | ❌ | Renders the article title as an h1 heading. |
|
||||
| [[ContentMeta]] | [`quartz-community/content-meta`](https://github.com/quartz-community/content-meta) | ✅ | ❌ | Displays creation date and reading time. |
|
||||
| [[TagList]] | [`quartz-community/tag-list`](https://github.com/quartz-community/tag-list) | ❌ | ❌ | Renders tags as clickable links. |
|
||||
| [[PageTitle]] | [`quartz-community/page-title`](https://github.com/quartz-community/page-title) | ✅ | ❌ | Renders the site title as a home link. |
|
||||
| [[darkmode\|Darkmode]] | [`quartz-community/darkmode`](https://github.com/quartz-community/darkmode) | ✅ | ❌ | Toggle between light and dark themes. |
|
||||
| [[reader mode\|Reader Mode]] | [`quartz-community/reader-mode`](https://github.com/quartz-community/reader-mode) | ✅ | ❌ | Distraction-free reading mode toggle. |
|
||||
| [[explorer\|Explorer]] | [`quartz-community/explorer`](https://github.com/quartz-community/explorer) | ✅ | ❌ | File tree explorer sidebar. |
|
||||
| [[graph view\|Graph View]] | [`quartz-community/graph`](https://github.com/quartz-community/graph) | ✅ | ❌ | Interactive link graph visualization. |
|
||||
| [[full-text search\|Search]] | [`quartz-community/search`](https://github.com/quartz-community/search) | ✅ | ❌ | Full-text search functionality. |
|
||||
| [[backlinks\|Backlinks]] | [`quartz-community/backlinks`](https://github.com/quartz-community/backlinks) | ✅ | ❌ | Shows pages that link to the current page. |
|
||||
| [[breadcrumbs\|Breadcrumbs]] | [`quartz-community/breadcrumbs`](https://github.com/quartz-community/breadcrumbs) | ✅ | ❌ | Breadcrumb navigation trail. |
|
||||
| [[comments\|Comments]] | [`quartz-community/comments`](https://github.com/quartz-community/comments) | ❌ | ❌ | Comment system integration (Giscus, etc.). |
|
||||
| [[Footer]] | [`quartz-community/footer`](https://github.com/quartz-community/footer) | ✅ | ❌ | Page footer with configurable links. |
|
||||
| [[recent notes\|Recent Notes]] | [`quartz-community/recent-notes`](https://github.com/quartz-community/recent-notes) | ❌ | ❌ | Displays a list of recently modified notes. |
|
||||
| [[Spacer]] | [`quartz-community/spacer`](https://github.com/quartz-community/spacer) | ✅ | ❌ | Flexible spacer for layout groups. |
|
||||
| [[EncryptedPages]] | [`quartz-community/encrypted-pages`](https://github.com/quartz-community/encrypted-pages) | ✅ | ❌ | Password-protected encrypted pages. |
|
||||
| [[StackedPages]] | [`quartz-community/stacked-pages`](https://github.com/quartz-community/stacked-pages) | ✅ | ❌ | Andy Matuschak-style stacked sliding panes. |
|
||||
> [!note] Multi-category plugins
|
||||
> Some plugins span multiple categories. **TableOfContents** is both a transformer and a component. **EncryptedPages** is a transformer, emitter, and component. They appear in each relevant category above.
|
||||
+46
-2
@@ -11,7 +11,7 @@ Common issues and solutions when working with Quartz.
|
||||
This usually means a plugin is not installed. Run:
|
||||
|
||||
```bash
|
||||
npx quartz plugin restore
|
||||
npx quartz plugin install
|
||||
```
|
||||
|
||||
This restores all plugins from your `quartz.lock.json` to `.quartz/plugins/`.
|
||||
@@ -26,6 +26,8 @@ Try increasing concurrency:
|
||||
|
||||
```bash
|
||||
npx quartz build --concurrency 8
|
||||
# or the shorthand:
|
||||
npx quartz build -c 8
|
||||
```
|
||||
|
||||
The default uses all available CPU cores. If you're on a memory-constrained environment (CI), reducing concurrency may actually help.
|
||||
@@ -37,7 +39,7 @@ The default uses all available CPU cores. If you're on a memory-constrained envi
|
||||
1. Verify the plugin appears in `quartz.config.yaml` under `plugins:`
|
||||
2. Check that `enabled: true` is set
|
||||
3. Run `npx quartz plugin list` to confirm it's installed
|
||||
4. Run `npx quartz plugin check` to verify plugin health
|
||||
4. Run `npx quartz plugin install --latest --dry-run` to verify plugin health
|
||||
|
||||
### Plugin options not taking effect
|
||||
|
||||
@@ -60,6 +62,48 @@ This means the plugin is referenced in `quartz.ts` but not installed. Either:
|
||||
- Install it: `npx quartz plugin add github:quartz-community/plugin-name`
|
||||
- Or remove the reference from `quartz.ts`
|
||||
|
||||
### Plugins fail to build on a fresh clone
|
||||
|
||||
> [!important]
|
||||
> Most community plugins now ship with a pre-built `dist/` directory and skip the build step entirely. The build failure scenario described below mainly applies to plugins in development or older plugins that haven't adopted pre-built distribution.
|
||||
|
||||
On a brand-new clone, `npx quartz plugin install` (or the plugin step run automatically by `npx quartz create`) may report a handful of plugins failing to build — typically around 10–15 of them. The git clone and checkout still succeed, but `npm run build` inside the plugin errors out.
|
||||
|
||||
This happens because `quartz.lock.json` pins each plugin to a specific commit, and those older plugin commits may have been authored against earlier versions of `@quartz-community/types` / `@quartz-community/utils` whose published artifacts are no longer shipped in the dependency's git repo. The plugin's `tsup`/`tsc` build then cannot resolve the expected type declarations.
|
||||
|
||||
Fix it by refreshing all plugins to the latest commit on their default branch:
|
||||
|
||||
```bash
|
||||
npx quartz plugin install --latest
|
||||
```
|
||||
|
||||
This rewrites `quartz.lock.json` with the newest commits (which in turn pin newer `@quartz-community/*` versions whose built output is available), and rebuilds every plugin from scratch. After this step, subsequent `npx quartz plugin install` calls will restore cleanly from the refreshed lockfile.
|
||||
|
||||
### `plugin install` hangs, OOMs, or fails on low-end hardware
|
||||
|
||||
> [!note]
|
||||
> Pre-built plugins are much faster and lighter on resources because they skip the `npm install` and `npm run build` steps.
|
||||
|
||||
By default, `npx quartz plugin install` clones, fetches, and builds plugins in parallel across all your CPU cores. Each parallel worker may run its own `npm install` and `npm run build`, which is memory-intensive. On low-end laptops, Raspberry Pi, small VPS instances, or restrictive CI runners this can exhaust RAM, trigger the OOM killer, or make the system appear to hang.
|
||||
|
||||
Lower the parallelism with `--concurrency` / `-c`:
|
||||
|
||||
```bash
|
||||
# Install one plugin at a time (safest, slowest)
|
||||
npx quartz plugin install --latest -c 1
|
||||
|
||||
# Two at a time — usually works on 4 GB machines
|
||||
npx quartz plugin install --latest --concurrency 2
|
||||
```
|
||||
|
||||
The same flag works for `plugin add` and the deprecated aliases (`plugin update`, `plugin restore`, `plugin check`, `plugin resolve`):
|
||||
|
||||
```bash
|
||||
npx quartz plugin add github:quartz-community/some-plugin -c 1
|
||||
```
|
||||
|
||||
If `plugin install` consistently fails near the same plugin with `-c 1`, the issue is likely with that specific plugin's build, not with concurrency — try running `--verbose` to get detailed error output, and check the plugin's own repository for known issues.
|
||||
|
||||
## Content Issues
|
||||
|
||||
### Notes not showing up
|
||||
|
||||
Generated
+3154
-3855
File diff suppressed because it is too large.
Load diff
+48
-27
@@ -41,52 +41,74 @@
|
||||
"@floating-ui/dom": "^1.7.4",
|
||||
"@myriaddreamin/rehype-typst": "^0.6.0",
|
||||
"@napi-rs/simple-git": "0.1.22",
|
||||
"@quartz-community/alias-redirects": "^0.1.0",
|
||||
"@quartz-community/article-title": "^0.1.0",
|
||||
"@quartz-community/backlinks": "^0.1.0",
|
||||
"@quartz-community/bases-page": "^0.2.0",
|
||||
"@quartz-community/breadcrumbs": "^0.1.0",
|
||||
"@quartz-community/canvas-page": "^0.1.0",
|
||||
"@quartz-community/citations": "^0.1.0",
|
||||
"@quartz-community/cname": "^0.1.0",
|
||||
"@quartz-community/comments": "^0.1.0",
|
||||
"@quartz-community/content-index": "^0.1.0",
|
||||
"@quartz-community/content-meta": "^0.1.0",
|
||||
"@quartz-community/content-page": "^0.1.0",
|
||||
"@quartz-community/crawl-links": "^0.1.0",
|
||||
"@quartz-themes/core": "^1.0.0",
|
||||
"@quartz-community/created-modified-date": "^0.1.0",
|
||||
"@quartz-community/darkmode": "^0.1.0",
|
||||
"@quartz-community/description": "^0.1.0",
|
||||
"@quartz-community/encrypted-pages": "^0.1.0",
|
||||
"@quartz-community/explicit-publish": "^0.1.0",
|
||||
"@quartz-community/explorer": "^0.1.0",
|
||||
"@quartz-community/favicon": "^0.1.1",
|
||||
"@quartz-community/folder-page": "^0.1.0",
|
||||
"@quartz-community/footer": "^0.1.0",
|
||||
"@quartz-community/github-flavored-markdown": "^0.1.0",
|
||||
"@quartz-community/graph": "^0.1.0",
|
||||
"@quartz-community/hard-line-breaks": "^0.1.0",
|
||||
"@quartz-community/latex": "^0.1.0",
|
||||
"@quartz-community/note-properties": "^0.1.0",
|
||||
"@quartz-community/obsidian-flavored-markdown": "^0.1.1",
|
||||
"@quartz-community/og-image": "^0.1.1",
|
||||
"@quartz-community/ox-hugo": "^0.1.0",
|
||||
"@quartz-community/page-title": "^0.1.0",
|
||||
"@quartz-community/quartz-fonts": "^0.1.1",
|
||||
"@quartz-community/reader-mode": "^0.1.0",
|
||||
"@quartz-community/recent-notes": "^0.1.0",
|
||||
"@quartz-community/remove-draft": "^0.1.0",
|
||||
"@quartz-community/roam": "^0.1.0",
|
||||
"@quartz-community/search": "^0.1.0",
|
||||
"@quartz-community/spacer": "^0.1.0",
|
||||
"@quartz-community/stacked-pages": "^0.1.0",
|
||||
"@quartz-community/syntax-highlighting": "^0.1.0",
|
||||
"@quartz-community/table-of-contents": "^0.1.0",
|
||||
"@quartz-community/tag-list": "^0.1.0",
|
||||
"@quartz-community/tag-page": "^0.1.0",
|
||||
"@quartz-community/unlisted-pages": "^0.1.0",
|
||||
"ansi-truncate": "^1.4.0",
|
||||
"async-mutex": "^0.5.0",
|
||||
"chokidar": "^5.0.0",
|
||||
"esbuild-sass-plugin": "^3.6.0",
|
||||
"flexsearch": "^0.8.205",
|
||||
"github-slugger": "^2.0.0",
|
||||
"globby": "^16.1.0",
|
||||
"gray-matter": "^4.0.3",
|
||||
"hast-util-to-html": "^9.0.5",
|
||||
"hast-util-from-html": "^2.0.0",
|
||||
"hast-util-to-jsx-runtime": "^2.3.6",
|
||||
"hast-util-to-string": "^3.0.1",
|
||||
"is-absolute-url": "^5.0.0",
|
||||
"isomorphic-git": "^1.36.3",
|
||||
"js-yaml": "^4.1.1",
|
||||
"lightningcss": "^1.31.1",
|
||||
"mdast-util-find-and-replace": "^3.0.2",
|
||||
"mdast-util-to-hast": "^13.2.1",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
"micromorph": "^0.4.5",
|
||||
"minimatch": "^10.1.1",
|
||||
"preact": "^10.28.2",
|
||||
"preact-render-to-string": "^6.6.5",
|
||||
"pretty-bytes": "^7.1.0",
|
||||
"pretty-time": "^1.1.0",
|
||||
"reading-time": "^1.5.0",
|
||||
"rehype-autolink-headings": "^7.1.0",
|
||||
"rehype-citation": "^2.3.1",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-mathjax": "^7.1.0",
|
||||
"rehype-pretty-code": "^0.14.1",
|
||||
"rehype-raw": "^7.0.0",
|
||||
"rehype-slug": "^6.0.0",
|
||||
"remark-breaks": "^4.0.0",
|
||||
"remark-frontmatter": "^5.0.0",
|
||||
"remark-gfm": "^4.0.1",
|
||||
"remark-math": "^6.0.0",
|
||||
"remark-parse": "^11.0.0",
|
||||
"remark-rehype": "^11.1.2",
|
||||
"remark-smartypants": "^3.0.2",
|
||||
"rfdc": "^1.4.1",
|
||||
"satori": "^0.19.1",
|
||||
"serve-handler": "^6.1.6",
|
||||
"sharp": "^0.34.5",
|
||||
"source-map-support": "^0.5.21",
|
||||
"to-vfile": "^8.0.0",
|
||||
"toml": "^3.0.0",
|
||||
"unified": "^11.0.5",
|
||||
"unist-util-visit": "^5.1.0",
|
||||
"vfile": "^6.0.3",
|
||||
@@ -96,10 +118,9 @@
|
||||
"yargs": "^18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@quartz-community/types": "github:quartz-community/types",
|
||||
"@quartz-community/utils": "github:quartz-community/utils",
|
||||
"@quartz-community/types": "^0.3.0",
|
||||
"@quartz-community/utils": "^0.1.0",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^25.0.10",
|
||||
"@types/pretty-time": "^1.1.5",
|
||||
"@types/source-map-support": "^0.5.10",
|
||||
|
||||
+64
-50
@@ -12,7 +12,6 @@ configuration:
|
||||
- private
|
||||
- templates
|
||||
- .obsidian
|
||||
defaultDateType: modified
|
||||
theme:
|
||||
fontOrigin: googleFonts
|
||||
cdnCaching: true
|
||||
@@ -42,15 +41,16 @@ configuration:
|
||||
highlight: rgba(143, 159, 169, 0.15)
|
||||
textHighlight: "#b3aa0288"
|
||||
plugins:
|
||||
- source: github:quartz-community/created-modified-date
|
||||
- source: "@quartz-community/created-modified-date"
|
||||
enabled: true
|
||||
options:
|
||||
defaultDateType: modified
|
||||
priority:
|
||||
- frontmatter
|
||||
- git
|
||||
- filesystem
|
||||
order: 10
|
||||
- source: github:quartz-community/syntax-highlighting
|
||||
- source: "@quartz-community/syntax-highlighting"
|
||||
enabled: true
|
||||
options:
|
||||
theme:
|
||||
@@ -58,79 +58,89 @@ plugins:
|
||||
dark: github-dark
|
||||
keepBackground: false
|
||||
order: 20
|
||||
- source: github:quartz-community/obsidian-flavored-markdown
|
||||
- source: "@quartz-community/obsidian-flavored-markdown"
|
||||
enabled: true
|
||||
options:
|
||||
enableInHtmlEmbed: false
|
||||
enableCheckbox: true
|
||||
order: 30
|
||||
- source: github:quartz-community/github-flavored-markdown
|
||||
- source: "@quartz-community/github-flavored-markdown"
|
||||
enabled: true
|
||||
order: 40
|
||||
- source: github:quartz-community/table-of-contents
|
||||
- source: "@quartz-community/table-of-contents"
|
||||
enabled: true
|
||||
order: 50
|
||||
- source: github:quartz-community/crawl-links
|
||||
layout:
|
||||
position: right
|
||||
priority: 30
|
||||
- source: "@quartz-community/crawl-links"
|
||||
enabled: true
|
||||
options:
|
||||
markdownLinkResolution: shortest
|
||||
order: 60
|
||||
- source: github:quartz-community/description
|
||||
- source: "@quartz-community/description"
|
||||
enabled: true
|
||||
order: 70
|
||||
- source: github:quartz-community/latex
|
||||
- source: "@quartz-community/latex"
|
||||
enabled: true
|
||||
options:
|
||||
renderEngine: katex
|
||||
order: 80
|
||||
- source: github:quartz-community/citations
|
||||
- source: "@quartz-community/citations"
|
||||
enabled: false
|
||||
order: 85
|
||||
- source: github:quartz-community/hard-line-breaks
|
||||
- source: "@quartz-community/hard-line-breaks"
|
||||
enabled: false
|
||||
order: 90
|
||||
- source: github:quartz-community/ox-hugo
|
||||
- source: "@quartz-community/ox-hugo"
|
||||
enabled: false
|
||||
order: 91
|
||||
- source: github:quartz-community/roam
|
||||
- source: "@quartz-community/roam"
|
||||
enabled: false
|
||||
order: 92
|
||||
- source: github:quartz-community/remove-draft
|
||||
- source: "@quartz-community/quartz-fonts"
|
||||
enabled: true
|
||||
- source: github:quartz-community/explicit-publish
|
||||
- source: "@quartz-themes/core"
|
||||
enabled: false
|
||||
- source: github:quartz-community/alias-redirects
|
||||
options:
|
||||
theme: tokyo-night
|
||||
mode: both
|
||||
- source: "@quartz-community/remove-draft"
|
||||
enabled: true
|
||||
- source: github:quartz-community/content-index
|
||||
- source: "@quartz-community/explicit-publish"
|
||||
enabled: false
|
||||
- source: "@quartz-community/alias-redirects"
|
||||
enabled: true
|
||||
- source: "@quartz-community/content-index"
|
||||
enabled: true
|
||||
options:
|
||||
enableSiteMap: true
|
||||
enableRSS: true
|
||||
- source: github:quartz-community/favicon
|
||||
- source: "@quartz-community/favicon"
|
||||
enabled: true
|
||||
- source: github:quartz-community/og-image
|
||||
- source: "@quartz-community/og-image"
|
||||
enabled: true
|
||||
- source: github:quartz-community/cname
|
||||
- source: "@quartz-community/cname"
|
||||
enabled: true
|
||||
- source: github:quartz-community/canvas-page
|
||||
- source: "@quartz-community/canvas-page"
|
||||
enabled: true
|
||||
- source: github:quartz-community/content-page
|
||||
- source: "@quartz-community/content-page"
|
||||
enabled: true
|
||||
- source: github:quartz-community/folder-page
|
||||
- source: "@quartz-community/folder-page"
|
||||
enabled: true
|
||||
- source: github:quartz-community/tag-page
|
||||
- source: "@quartz-community/tag-page"
|
||||
enabled: true
|
||||
- source: github:quartz-community/explorer
|
||||
- source: "@quartz-community/explorer"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 50
|
||||
- source: github:quartz-community/graph
|
||||
- source: "@quartz-community/graph"
|
||||
enabled: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 10
|
||||
- source: github:quartz-community/search
|
||||
- source: "@quartz-community/search"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
@@ -138,50 +148,50 @@ plugins:
|
||||
group: toolbar
|
||||
groupOptions:
|
||||
grow: true
|
||||
- source: github:quartz-community/backlinks
|
||||
- source: "@quartz-community/backlinks"
|
||||
enabled: true
|
||||
layout:
|
||||
position: right
|
||||
priority: 30
|
||||
- source: github:quartz-community/article-title
|
||||
priority: 50
|
||||
- source: "@quartz-community/article-title"
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 10
|
||||
- source: github:quartz-community/content-meta
|
||||
- source: "@quartz-community/content-meta"
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 20
|
||||
- source: github:quartz-community/tag-list
|
||||
- source: "@quartz-community/tag-list"
|
||||
enabled: false
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 30
|
||||
- source: github:quartz-community/page-title
|
||||
- source: "@quartz-community/page-title"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 10
|
||||
- source: github:quartz-community/darkmode
|
||||
- source: "@quartz-community/darkmode"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 30
|
||||
group: toolbar
|
||||
- source: github:quartz-community/reader-mode
|
||||
- source: "@quartz-community/reader-mode"
|
||||
enabled: true
|
||||
layout:
|
||||
position: left
|
||||
priority: 35
|
||||
group: toolbar
|
||||
- source: github:quartz-community/breadcrumbs
|
||||
- source: "@quartz-community/breadcrumbs"
|
||||
enabled: true
|
||||
layout:
|
||||
position: beforeBody
|
||||
priority: 5
|
||||
condition: not-index
|
||||
- source: github:quartz-community/comments
|
||||
- source: "@quartz-community/comments"
|
||||
enabled: false
|
||||
options:
|
||||
provider: giscus
|
||||
@@ -189,15 +199,18 @@ plugins:
|
||||
layout:
|
||||
position: afterBody
|
||||
priority: 10
|
||||
- source: github:quartz-community/footer
|
||||
- source: "@quartz-community/footer"
|
||||
enabled: true
|
||||
options:
|
||||
links:
|
||||
GitHub: https://github.com/jackyzha0/quartz
|
||||
Discord Community: https://discord.gg/cRFFHYye7t
|
||||
- source: github:quartz-community/recent-notes
|
||||
layout:
|
||||
position: footer
|
||||
priority: 50
|
||||
- source: "@quartz-community/recent-notes"
|
||||
enabled: false
|
||||
- source: github:quartz-community/spacer
|
||||
- source: "@quartz-community/spacer"
|
||||
enabled: true
|
||||
options: {}
|
||||
order: 25
|
||||
@@ -205,11 +218,11 @@ plugins:
|
||||
position: left
|
||||
priority: 25
|
||||
display: mobile-only
|
||||
- source: github:quartz-community/bases-page
|
||||
- source: "@quartz-community/bases-page"
|
||||
enabled: true
|
||||
options: {}
|
||||
order: 50
|
||||
- source: github:quartz-community/note-properties
|
||||
- source: "@quartz-community/note-properties"
|
||||
enabled: true
|
||||
options:
|
||||
includeAll: false
|
||||
@@ -226,19 +239,20 @@ plugins:
|
||||
position: beforeBody
|
||||
priority: 15
|
||||
display: all
|
||||
- source: github:quartz-community/encrypted-pages
|
||||
- source: "@quartz-community/unlisted-pages"
|
||||
enabled: true
|
||||
options: {}
|
||||
order: 45
|
||||
- source: "@quartz-community/encrypted-pages"
|
||||
enabled: true
|
||||
options:
|
||||
visibility: icon
|
||||
iterations: 600000
|
||||
passwordField: password
|
||||
unlistWhenEncrypted: false
|
||||
outputPath: static/encryptedContentIndex.json
|
||||
order: 900
|
||||
layout:
|
||||
position: body
|
||||
priority: 100
|
||||
display: all
|
||||
- source: github:quartz-community/stacked-pages
|
||||
enabled: true
|
||||
- source: "@quartz-community/stacked-pages"
|
||||
enabled: false
|
||||
layout:
|
||||
position: afterBody
|
||||
priority: 50
|
||||
|
||||
@@ -1,257 +0,0 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"plugins": {
|
||||
"alias-redirects": {
|
||||
"source": "github:quartz-community/alias-redirects",
|
||||
"resolved": "https://github.com/quartz-community/alias-redirects.git",
|
||||
"commit": "2913031a4989824754c0e550682a8d9c117ad569",
|
||||
"installedAt": "2026-03-11T18:22:42.120Z"
|
||||
},
|
||||
"article-title": {
|
||||
"source": "github:quartz-community/article-title",
|
||||
"resolved": "https://github.com/quartz-community/article-title.git",
|
||||
"commit": "6b57785696ab3fd187ba91b218e5fde67b8533ee",
|
||||
"installedAt": "2026-03-11T18:23:01.116Z"
|
||||
},
|
||||
"backlinks": {
|
||||
"source": "github:quartz-community/backlinks",
|
||||
"resolved": "https://github.com/quartz-community/backlinks.git",
|
||||
"commit": "c5f07804c9a050c4bf1d996454b1770a211d992b",
|
||||
"installedAt": "2026-03-11T18:22:59.813Z"
|
||||
},
|
||||
"bases-page": {
|
||||
"source": "github:quartz-community/bases-page",
|
||||
"resolved": "https://github.com/quartz-community/bases-page.git",
|
||||
"commit": "d6d81c5442d89c68bf4c1cffb9d84614f378c671",
|
||||
"installedAt": "2026-03-12T19:33:22.237Z"
|
||||
},
|
||||
"breadcrumbs": {
|
||||
"source": "github:quartz-community/breadcrumbs",
|
||||
"resolved": "https://github.com/quartz-community/breadcrumbs.git",
|
||||
"commit": "5687dccb6969be381407d8b8585846fe1f8f8913",
|
||||
"installedAt": "2026-03-11T18:23:09.079Z"
|
||||
},
|
||||
"canvas-page": {
|
||||
"source": "github:quartz-community/canvas-page",
|
||||
"resolved": "https://github.com/quartz-community/canvas-page.git",
|
||||
"commit": "227b4c0c9f6d2ed63d56cbab6174008c314bf5c7",
|
||||
"installedAt": "2026-03-12T19:33:23.417Z"
|
||||
},
|
||||
"citations": {
|
||||
"source": "github:quartz-community/citations",
|
||||
"resolved": "https://github.com/quartz-community/citations.git",
|
||||
"commit": "35f4c795f6a3a5763a7e5f283a13ed69a75cc8b1",
|
||||
"installedAt": "2026-03-11T18:22:34.478Z"
|
||||
},
|
||||
"cname": {
|
||||
"source": "github:quartz-community/cname",
|
||||
"resolved": "https://github.com/quartz-community/cname.git",
|
||||
"commit": "251249077b372809b78fb679135f81ca9d81d3a8",
|
||||
"installedAt": "2026-03-11T18:22:47.432Z"
|
||||
},
|
||||
"comments": {
|
||||
"source": "github:quartz-community/comments",
|
||||
"resolved": "https://github.com/quartz-community/comments.git",
|
||||
"commit": "8a76dfafc0742c1903212c4fc8e15f6fb5f9e99f",
|
||||
"installedAt": "2026-03-12T19:33:25.149Z"
|
||||
},
|
||||
"content-index": {
|
||||
"source": "github:quartz-community/content-index",
|
||||
"resolved": "https://github.com/quartz-community/content-index.git",
|
||||
"commit": "2a207bb2db52c57a89b673182e9f74280dd81ee3",
|
||||
"installedAt": "2026-03-11T18:22:43.468Z"
|
||||
},
|
||||
"content-meta": {
|
||||
"source": "github:quartz-community/content-meta",
|
||||
"resolved": "https://github.com/quartz-community/content-meta.git",
|
||||
"commit": "6381a7c2f7881640f845b13da7920e9c6524f219",
|
||||
"installedAt": "2026-03-11T18:23:02.385Z"
|
||||
},
|
||||
"content-page": {
|
||||
"source": "github:quartz-community/content-page",
|
||||
"resolved": "https://github.com/quartz-community/content-page.git",
|
||||
"commit": "b8a3f3bb6a126256b12f55879d144ba2ac104b73",
|
||||
"installedAt": "2026-03-11T18:22:51.572Z"
|
||||
},
|
||||
"crawl-links": {
|
||||
"source": "github:quartz-community/crawl-links",
|
||||
"resolved": "https://github.com/quartz-community/crawl-links.git",
|
||||
"commit": "5ccbcb5f3ac7b1c24fbcb34aa2454df06fe7031c",
|
||||
"installedAt": "2026-03-11T18:22:30.563Z"
|
||||
},
|
||||
"created-modified-date": {
|
||||
"source": "github:quartz-community/created-modified-date",
|
||||
"resolved": "https://github.com/quartz-community/created-modified-date.git",
|
||||
"commit": "330621e98824efc34bcc061365076a0e30607235",
|
||||
"installedAt": "2026-03-11T18:22:23.768Z"
|
||||
},
|
||||
"darkmode": {
|
||||
"source": "github:quartz-community/darkmode",
|
||||
"resolved": "https://github.com/quartz-community/darkmode.git",
|
||||
"commit": "672ad8da9899dadb5ec0e237864279541cde9d58",
|
||||
"installedAt": "2026-03-12T19:33:28.700Z"
|
||||
},
|
||||
"description": {
|
||||
"source": "github:quartz-community/description",
|
||||
"resolved": "https://github.com/quartz-community/description.git",
|
||||
"commit": "76f05fb1ddcc412660ff247bb7ed532e2730c641",
|
||||
"installedAt": "2026-03-11T18:22:31.873Z"
|
||||
},
|
||||
"encrypted-pages": {
|
||||
"source": "github:quartz-community/encrypted-pages",
|
||||
"resolved": "https://github.com/quartz-community/encrypted-pages.git",
|
||||
"commit": "4e26afa5b918f4399bea3028d5c250b987b44288",
|
||||
"installedAt": "2026-03-12T19:33:29.813Z"
|
||||
},
|
||||
"explicit-publish": {
|
||||
"source": "github:quartz-community/explicit-publish",
|
||||
"resolved": "https://github.com/quartz-community/explicit-publish.git",
|
||||
"commit": "e6d37f711a44a8a30ff76796b1670ca852aa3157",
|
||||
"installedAt": "2026-03-11T18:22:40.759Z"
|
||||
},
|
||||
"explorer": {
|
||||
"source": "github:quartz-community/explorer",
|
||||
"resolved": "https://github.com/quartz-community/explorer.git",
|
||||
"commit": "def459f31b02fdebdc22579cbeec2907829ff20f",
|
||||
"installedAt": "2026-03-12T19:33:30.998Z"
|
||||
},
|
||||
"favicon": {
|
||||
"source": "github:quartz-community/favicon",
|
||||
"resolved": "https://github.com/quartz-community/favicon.git",
|
||||
"commit": "c389697fee691553920d44bab16ee06e79d2e080",
|
||||
"installedAt": "2026-03-11T18:22:44.822Z"
|
||||
},
|
||||
"folder-page": {
|
||||
"source": "github:quartz-community/folder-page",
|
||||
"resolved": "https://github.com/quartz-community/folder-page.git",
|
||||
"commit": "0bb653d651626dece1e56fd7a08d3f2fb3a3cd8a",
|
||||
"installedAt": "2026-03-11T18:22:52.983Z"
|
||||
},
|
||||
"footer": {
|
||||
"source": "github:quartz-community/footer",
|
||||
"resolved": "https://github.com/quartz-community/footer.git",
|
||||
"commit": "f0fe3d6ca24624d955a4f4e62e5aafabe053f29e",
|
||||
"installedAt": "2026-03-11T18:23:11.638Z"
|
||||
},
|
||||
"github-flavored-markdown": {
|
||||
"source": "github:quartz-community/github-flavored-markdown",
|
||||
"resolved": "https://github.com/quartz-community/github-flavored-markdown.git",
|
||||
"commit": "628366ec62c1122da1eaef7c988d53bdaae3d19a",
|
||||
"installedAt": "2026-03-11T18:22:27.866Z"
|
||||
},
|
||||
"graph": {
|
||||
"source": "github:quartz-community/graph",
|
||||
"resolved": "https://github.com/quartz-community/graph.git",
|
||||
"commit": "701bda442cf08f521e88ec326b12a7559320eef4",
|
||||
"installedAt": "2026-03-12T19:33:34.250Z"
|
||||
},
|
||||
"hard-line-breaks": {
|
||||
"source": "github:quartz-community/hard-line-breaks",
|
||||
"resolved": "https://github.com/quartz-community/hard-line-breaks.git",
|
||||
"commit": "f8417e909a3c31d13463a6655c7ed903af3b34c5",
|
||||
"installedAt": "2026-03-11T18:22:35.740Z"
|
||||
},
|
||||
"latex": {
|
||||
"source": "github:quartz-community/latex",
|
||||
"resolved": "https://github.com/quartz-community/latex.git",
|
||||
"commit": "2544fd13fa132493647480d8ce75f4432a6f1750",
|
||||
"installedAt": "2026-03-11T18:22:33.240Z"
|
||||
},
|
||||
"note-properties": {
|
||||
"source": "github:quartz-community/note-properties",
|
||||
"resolved": "https://github.com/quartz-community/note-properties.git",
|
||||
"commit": "353531585033528eef9faa7eb2f27e377db7fa14",
|
||||
"installedAt": "2026-03-12T19:33:36.033Z"
|
||||
},
|
||||
"obsidian-flavored-markdown": {
|
||||
"source": "github:quartz-community/obsidian-flavored-markdown",
|
||||
"resolved": "https://github.com/quartz-community/obsidian-flavored-markdown.git",
|
||||
"commit": "eda74e79eac746445b7d6941f90133bf97483cd7",
|
||||
"installedAt": "2026-03-12T19:33:36.619Z"
|
||||
},
|
||||
"og-image": {
|
||||
"source": "github:quartz-community/og-image",
|
||||
"resolved": "https://github.com/quartz-community/og-image.git",
|
||||
"commit": "ab1f8e5ddcd3d9e9c55ea9f8f4163ae34cabe6ce",
|
||||
"installedAt": "2026-03-11T18:22:46.168Z"
|
||||
},
|
||||
"ox-hugo": {
|
||||
"source": "github:quartz-community/ox-hugo",
|
||||
"resolved": "https://github.com/quartz-community/ox-hugo.git",
|
||||
"commit": "5e7399d6bcdd8a4824aad764952eeb8177e45591",
|
||||
"installedAt": "2026-03-11T18:22:37.014Z"
|
||||
},
|
||||
"page-title": {
|
||||
"source": "github:quartz-community/page-title",
|
||||
"resolved": "https://github.com/quartz-community/page-title.git",
|
||||
"commit": "ad0e06a2fe2e2280217a445f167ee105edb8bde5",
|
||||
"installedAt": "2026-03-11T18:23:05.089Z"
|
||||
},
|
||||
"reader-mode": {
|
||||
"source": "github:quartz-community/reader-mode",
|
||||
"resolved": "https://github.com/quartz-community/reader-mode.git",
|
||||
"commit": "1da1254ac74fd71cd950ff77ac6421db89469e06",
|
||||
"installedAt": "2026-03-12T19:33:38.972Z"
|
||||
},
|
||||
"recent-notes": {
|
||||
"source": "github:quartz-community/recent-notes",
|
||||
"resolved": "https://github.com/quartz-community/recent-notes.git",
|
||||
"commit": "1220b39bec5a8d6178e4021cf87e42eeda2b5e39",
|
||||
"installedAt": "2026-03-11T18:23:12.941Z"
|
||||
},
|
||||
"remove-draft": {
|
||||
"source": "github:quartz-community/remove-draft",
|
||||
"resolved": "https://github.com/quartz-community/remove-draft.git",
|
||||
"commit": "c44b2a1314cfe8ac4d4450a566ec9a122daba5f2",
|
||||
"installedAt": "2026-03-11T18:22:39.521Z"
|
||||
},
|
||||
"roam": {
|
||||
"source": "github:quartz-community/roam",
|
||||
"resolved": "https://github.com/quartz-community/roam.git",
|
||||
"commit": "187f5d116ff13892a0012d608b8522eb3fecd028",
|
||||
"installedAt": "2026-03-11T18:22:38.332Z"
|
||||
},
|
||||
"search": {
|
||||
"source": "github:quartz-community/search",
|
||||
"resolved": "https://github.com/quartz-community/search.git",
|
||||
"commit": "e9c10e521b95a14a512739b62a4159ab5afd5edf",
|
||||
"installedAt": "2026-03-12T19:33:41.367Z"
|
||||
},
|
||||
"spacer": {
|
||||
"source": "github:quartz-community/spacer",
|
||||
"resolved": "https://github.com/quartz-community/spacer.git",
|
||||
"commit": "90e2f22e238ccccd5d2c38e6a236ccd2adbd9636",
|
||||
"installedAt": "2026-03-11T18:23:14.251Z"
|
||||
},
|
||||
"stacked-pages": {
|
||||
"source": "github:quartz-community/stacked-pages",
|
||||
"resolved": "https://github.com/quartz-community/stacked-pages.git",
|
||||
"commit": "2d853d361d84211adda38e2c86973e706f265f9b",
|
||||
"installedAt": "2026-03-13T23:15:30.401Z"
|
||||
},
|
||||
"syntax-highlighting": {
|
||||
"source": "github:quartz-community/syntax-highlighting",
|
||||
"resolved": "https://github.com/quartz-community/syntax-highlighting.git",
|
||||
"commit": "4593694be62ed55486d89b36f40a027a7b48233c",
|
||||
"installedAt": "2026-03-12T19:33:42.554Z"
|
||||
},
|
||||
"table-of-contents": {
|
||||
"source": "github:quartz-community/table-of-contents",
|
||||
"resolved": "https://github.com/quartz-community/table-of-contents.git",
|
||||
"commit": "70b12d85cb873ce42d95111ffb4d8092644c1763",
|
||||
"installedAt": "2026-03-12T19:33:43.169Z"
|
||||
},
|
||||
"tag-list": {
|
||||
"source": "github:quartz-community/tag-list",
|
||||
"resolved": "https://github.com/quartz-community/tag-list.git",
|
||||
"commit": "6014e0c4f688ece03a51674c98774fd9c021c3a1",
|
||||
"installedAt": "2026-03-11T18:23:03.753Z"
|
||||
},
|
||||
"tag-page": {
|
||||
"source": "github:quartz-community/tag-page",
|
||||
"resolved": "https://github.com/quartz-community/tag-page.git",
|
||||
"commit": "dd0cd223c433722b3eb3ff7c93eec8eec49f76b5",
|
||||
"installedAt": "2026-03-11T18:22:54.300Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
+179
-118
@@ -1,38 +1,34 @@
|
||||
#!/usr/bin/env -S node --no-deprecation
|
||||
const [major] = process.versions.node.split(".").map(Number)
|
||||
if (major < 22) {
|
||||
console.error(
|
||||
`\nQuartz requires Node.js >= 22, but you are running Node.js ${process.version}.\n` +
|
||||
`Please upgrade: https://nodejs.org/\n`,
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
import yargs from "yargs"
|
||||
import { hideBin } from "yargs/helpers"
|
||||
import {
|
||||
handleBuild,
|
||||
handleCreate,
|
||||
handleUpdate,
|
||||
handleUpgrade,
|
||||
handleRestore,
|
||||
handleSync,
|
||||
} from "./cli/handlers.js"
|
||||
import { handleMigrate } from "./cli/migrate-handler.js"
|
||||
|
||||
import {
|
||||
handlePluginInstall as handleGitPluginInstall,
|
||||
handlePluginInstallUnified,
|
||||
handlePluginAdd,
|
||||
handlePluginRemove,
|
||||
handlePluginUpdate,
|
||||
handlePluginRestore,
|
||||
handlePluginList,
|
||||
handlePluginStatus,
|
||||
handlePluginEnable,
|
||||
handlePluginDisable,
|
||||
handlePluginConfig,
|
||||
handlePluginCheck,
|
||||
handlePluginPrune,
|
||||
handlePluginResolve,
|
||||
} from "./cli/plugin-git-handlers.js"
|
||||
import {
|
||||
CommonArgv,
|
||||
BuildArgv,
|
||||
CreateArgv,
|
||||
SyncArgv,
|
||||
PluginInstallArgv,
|
||||
PluginUninstallArgv,
|
||||
PluginSearchArgv,
|
||||
} from "./cli/args.js"
|
||||
import { CommonArgv, BuildArgv, CreateArgv, SyncArgv } from "./cli/args.js"
|
||||
import { version } from "./cli/constants.js"
|
||||
|
||||
async function launchTui() {
|
||||
@@ -44,7 +40,7 @@ async function launchTui() {
|
||||
if (!existsSync(tuiPath)) {
|
||||
console.error(
|
||||
"TUI plugin not installed. Install with:\n" +
|
||||
" npx quartz plugin add github:quartz-community/tui\n",
|
||||
" npx quartz plugin add @quartz-community/tui\n",
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
@@ -84,16 +80,13 @@ yargs(hideBin(process.argv))
|
||||
await handleCreate(argv)
|
||||
})
|
||||
.command(
|
||||
"update [names..]",
|
||||
"Update installed plugins to latest version",
|
||||
["upgrade", "update"],
|
||||
"Upgrade Quartz to the latest version",
|
||||
CommonArgv,
|
||||
async (argv) => {
|
||||
await handleUpdate(argv)
|
||||
await handleUpgrade(argv)
|
||||
},
|
||||
)
|
||||
.command("upgrade", "Upgrade Quartz to the latest version", CommonArgv, async (argv) => {
|
||||
await handleUpgrade(argv)
|
||||
})
|
||||
.command(
|
||||
"restore",
|
||||
"Try to restore your content folder from the cache",
|
||||
@@ -108,9 +101,6 @@ yargs(hideBin(process.argv))
|
||||
.command("build", "Build Quartz into a bundle of static HTML files", BuildArgv, async (argv) => {
|
||||
await handleBuild(argv)
|
||||
})
|
||||
.command("migrate", "Migrate old config to quartz.config.yaml", CommonArgv, async () => {
|
||||
await handleMigrate()
|
||||
})
|
||||
.command("tui", "Launch interactive plugin manager", CommonArgv, async () => {
|
||||
await launchTui()
|
||||
})
|
||||
@@ -118,106 +108,177 @@ yargs(hideBin(process.argv))
|
||||
"plugin [subcommand]",
|
||||
"Manage Quartz plugins",
|
||||
(yargs) => {
|
||||
return yargs
|
||||
.command("install", "Install plugins from quartz.lock.json", CommonArgv, async () => {
|
||||
await handleGitPluginInstall()
|
||||
})
|
||||
.command("add <repos..>", "Add plugins from Git repositories", CommonArgv, async (argv) => {
|
||||
await handlePluginAdd(argv.repos)
|
||||
})
|
||||
.command("remove <names..>", "Remove installed plugins", CommonArgv, async (argv) => {
|
||||
await handlePluginRemove(argv.names)
|
||||
})
|
||||
.command(
|
||||
"update [names..]",
|
||||
"Update installed plugins to latest version",
|
||||
CommonArgv,
|
||||
async (argv) => {
|
||||
await handlePluginUpdate(argv.names)
|
||||
},
|
||||
)
|
||||
.command("list", "List all installed plugins", CommonArgv, async () => {
|
||||
await handlePluginList()
|
||||
})
|
||||
.command(
|
||||
"restore",
|
||||
"Restore plugins from lockfile (exact versions)",
|
||||
CommonArgv,
|
||||
async () => {
|
||||
await handlePluginRestore()
|
||||
},
|
||||
)
|
||||
.command(
|
||||
"enable <names..>",
|
||||
"Enable plugins in quartz.config.yaml",
|
||||
CommonArgv,
|
||||
async (argv) => {
|
||||
await handlePluginEnable(argv.names)
|
||||
},
|
||||
)
|
||||
.command(
|
||||
"disable <names..>",
|
||||
"Disable plugins in quartz.config.yaml",
|
||||
CommonArgv,
|
||||
async (argv) => {
|
||||
await handlePluginDisable(argv.names)
|
||||
},
|
||||
)
|
||||
.command(
|
||||
"config <name>",
|
||||
"View or set plugin configuration",
|
||||
{
|
||||
...CommonArgv,
|
||||
set: {
|
||||
string: true,
|
||||
describe: "Set a config value (key=value)",
|
||||
return (
|
||||
yargs
|
||||
.command(
|
||||
"install [names..]",
|
||||
"Install plugins from lockfile or config",
|
||||
{
|
||||
...CommonArgv,
|
||||
"from-config": {
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: "install plugins referenced in quartz.config.yaml instead of lockfile",
|
||||
},
|
||||
latest: {
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: "fetch latest version from remote instead of pinned lockfile commit",
|
||||
},
|
||||
clean: {
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: "skip plugins whose directory already exists",
|
||||
},
|
||||
"dry-run": {
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: "show what would happen without making changes",
|
||||
},
|
||||
},
|
||||
},
|
||||
async (argv) => {
|
||||
await handlePluginConfig(argv.name, { set: argv.set })
|
||||
},
|
||||
)
|
||||
.command("check", "Check for plugin updates", CommonArgv, async () => {
|
||||
await handlePluginCheck()
|
||||
})
|
||||
.command(
|
||||
"prune",
|
||||
"Remove installed plugins no longer referenced in config",
|
||||
{
|
||||
...CommonArgv,
|
||||
"dry-run": {
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: "show what would be pruned without making changes",
|
||||
async (argv) => {
|
||||
await handlePluginInstallUnified({
|
||||
names: argv.names?.length ? argv.names : undefined,
|
||||
fromConfig: argv.fromConfig,
|
||||
latest: argv.latest,
|
||||
clean: argv.clean,
|
||||
dryRun: argv.dryRun,
|
||||
concurrency: argv.concurrency,
|
||||
})
|
||||
},
|
||||
},
|
||||
async (argv) => {
|
||||
await handlePluginPrune({ dryRun: argv.dryRun })
|
||||
},
|
||||
)
|
||||
.command(
|
||||
"resolve",
|
||||
"Install plugins from config that are not yet in the lockfile",
|
||||
{
|
||||
...CommonArgv,
|
||||
"dry-run": {
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: "show what would be resolved without making changes",
|
||||
)
|
||||
.command(
|
||||
"add <repos..>",
|
||||
"Add plugins from Git repositories",
|
||||
{
|
||||
...CommonArgv,
|
||||
name: {
|
||||
string: true,
|
||||
alias: ["as"],
|
||||
describe: "Override the plugin name (for resolving conflicts with duplicate names)",
|
||||
},
|
||||
subdir: {
|
||||
string: true,
|
||||
describe: "Subdirectory within the repository containing the plugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
async (argv) => {
|
||||
await handlePluginResolve({ dryRun: argv.dryRun })
|
||||
},
|
||||
)
|
||||
.demandCommand(0, "")
|
||||
async (argv) => {
|
||||
await handlePluginAdd(argv.repos, {
|
||||
name: argv.name,
|
||||
subdir: argv.subdir,
|
||||
concurrency: argv.concurrency,
|
||||
})
|
||||
},
|
||||
)
|
||||
.command("remove <names..>", "Remove installed plugins", CommonArgv, async (argv) => {
|
||||
await handlePluginRemove(argv.names)
|
||||
})
|
||||
.command("list", "List all installed plugins", CommonArgv, async () => {
|
||||
await handlePluginList()
|
||||
})
|
||||
.command(
|
||||
"enable <names..>",
|
||||
"Enable plugins in quartz.config.yaml",
|
||||
CommonArgv,
|
||||
async (argv) => {
|
||||
await handlePluginEnable(argv.names)
|
||||
},
|
||||
)
|
||||
.command(
|
||||
"disable <names..>",
|
||||
"Disable plugins in quartz.config.yaml",
|
||||
CommonArgv,
|
||||
async (argv) => {
|
||||
await handlePluginDisable(argv.names)
|
||||
},
|
||||
)
|
||||
.command(
|
||||
"config <name>",
|
||||
"View or set plugin configuration",
|
||||
{
|
||||
...CommonArgv,
|
||||
set: {
|
||||
string: true,
|
||||
describe: "Set a config value (key=value)",
|
||||
},
|
||||
},
|
||||
async (argv) => {
|
||||
await handlePluginConfig(argv.name, { set: argv.set })
|
||||
},
|
||||
)
|
||||
.command(
|
||||
"prune",
|
||||
"Remove installed plugins no longer referenced in config",
|
||||
{
|
||||
...CommonArgv,
|
||||
"dry-run": {
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: "show what would be pruned without making changes",
|
||||
},
|
||||
},
|
||||
async (argv) => {
|
||||
await handlePluginPrune({ dryRun: argv.dryRun })
|
||||
},
|
||||
)
|
||||
// Hidden deprecated aliases
|
||||
.command("restore", false, CommonArgv, async (argv) => {
|
||||
console.log(
|
||||
"\x1b[33m⚠ 'plugin restore' is deprecated. Use 'plugin install --clean' instead.\x1b[0m",
|
||||
)
|
||||
await handlePluginInstallUnified({ clean: true, concurrency: argv.concurrency })
|
||||
})
|
||||
.command("update [names..]", false, CommonArgv, async (argv) => {
|
||||
console.log(
|
||||
"\x1b[33m⚠ 'plugin update' is deprecated. Use 'plugin install --latest' instead.\x1b[0m",
|
||||
)
|
||||
await handlePluginInstallUnified({
|
||||
names: argv.names?.length ? argv.names : undefined,
|
||||
latest: true,
|
||||
concurrency: argv.concurrency,
|
||||
})
|
||||
})
|
||||
.command("check", false, CommonArgv, async (argv) => {
|
||||
console.log(
|
||||
"\x1b[33m⚠ 'plugin check' is deprecated. Use 'plugin install --latest --dry-run' instead.\x1b[0m",
|
||||
)
|
||||
await handlePluginInstallUnified({
|
||||
latest: true,
|
||||
dryRun: true,
|
||||
concurrency: argv.concurrency,
|
||||
})
|
||||
})
|
||||
.command(
|
||||
"resolve",
|
||||
false,
|
||||
{
|
||||
...CommonArgv,
|
||||
"dry-run": {
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: "show what would be resolved without making changes",
|
||||
},
|
||||
},
|
||||
async (argv) => {
|
||||
console.log(
|
||||
"\x1b[33m⚠ 'plugin resolve' is deprecated. Use 'plugin install --from-config' instead.\x1b[0m",
|
||||
)
|
||||
await handlePluginInstallUnified({
|
||||
fromConfig: true,
|
||||
dryRun: argv.dryRun,
|
||||
concurrency: argv.concurrency,
|
||||
})
|
||||
},
|
||||
)
|
||||
.demandCommand(0, "")
|
||||
)
|
||||
},
|
||||
async (argv) => {
|
||||
if (!argv._.includes("plugin") || argv._.length > 1) return
|
||||
await launchTui()
|
||||
await handlePluginStatus()
|
||||
},
|
||||
)
|
||||
.showHelpOnFail(false)
|
||||
.showHelpOnFail(true)
|
||||
.help()
|
||||
.strict()
|
||||
.demandCommand().argv
|
||||
+149
-164
@@ -9,7 +9,8 @@ import { parseMarkdown } from "./processors/parse"
|
||||
import { filterContent } from "./processors/filter"
|
||||
import { emitContent } from "./processors/emit"
|
||||
import cfg from "../quartz"
|
||||
import { FilePath, FullSlug, joinSegments, slugifyFilePath } from "./util/path"
|
||||
import { FilePath, joinSegments, slugifyFilePath } from "./util/path"
|
||||
import { detectSlugCollisions, formatCollisionWarning } from "./util/slugCollisions"
|
||||
import chokidar from "chokidar"
|
||||
import { ProcessedContent } from "./plugins/vfile"
|
||||
import { Argv, BuildCtx } from "./util/ctx"
|
||||
@@ -19,38 +20,13 @@ import { options } from "./util/sourcemap"
|
||||
import { Mutex } from "async-mutex"
|
||||
import { getStaticResourcesFromPlugins } from "./plugins"
|
||||
import { randomIdNonSecure } from "./util/random"
|
||||
import { ChangeEvent, QuartzPageTypePluginInstance } from "./plugins/types"
|
||||
import { ChangeEvent } from "./plugins/types"
|
||||
import { minimatch } from "minimatch"
|
||||
|
||||
function getPageTypeExtensions(ctx: BuildCtx): Set<string> {
|
||||
const extensions = new Set<string>()
|
||||
const pageTypes = (ctx.cfg.plugins.pageTypes ?? []) as unknown as QuartzPageTypePluginInstance[]
|
||||
for (const pt of pageTypes) {
|
||||
if (pt.fileExtensions) {
|
||||
for (const ext of pt.fileExtensions) {
|
||||
extensions.add(ext)
|
||||
}
|
||||
}
|
||||
}
|
||||
return extensions
|
||||
}
|
||||
|
||||
// For files whose extensions are handled by PageType plugins (e.g. .canvas, .base),
|
||||
// add extension-stripped slug aliases so that wikilink resolution (CrawlLinks) maps
|
||||
// `![[file.canvas]]` to the virtual-page slug `file` instead of the raw `file.canvas`.
|
||||
function addVirtualPageSlugAliases(allSlugs: FullSlug[], extensions: Set<string>): FullSlug[] {
|
||||
const extra: FullSlug[] = []
|
||||
for (const slug of allSlugs) {
|
||||
for (const ext of extensions) {
|
||||
if (slug.endsWith(ext)) {
|
||||
const stripped = slug.slice(0, -ext.length) as FullSlug
|
||||
if (!allSlugs.includes(stripped) && !extra.includes(stripped)) {
|
||||
extra.push(stripped)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return extra
|
||||
function reportSlugCollisions(content: ProcessedContent[]): void {
|
||||
const collisions = detectSlugCollisions(content)
|
||||
if (collisions.length === 0) return
|
||||
console.warn(styleText("yellow", formatCollisionWarning(collisions)))
|
||||
}
|
||||
|
||||
type ContentMap = Map<
|
||||
@@ -114,15 +90,8 @@ async function buildQuartz(argv: Argv, mut: Mutex, clientRefresh: () => void) {
|
||||
ctx.allFiles = allFiles
|
||||
ctx.allSlugs = allFiles.map((fp) => slugifyFilePath(fp as FilePath))
|
||||
|
||||
// Add extension-stripped slug aliases for PageType-registered extensions
|
||||
// so that wikilinks like ![[file.canvas]] resolve to virtual page slugs
|
||||
const ptExtensions = getPageTypeExtensions(ctx)
|
||||
if (ptExtensions.size > 0) {
|
||||
const aliases = addVirtualPageSlugAliases(ctx.allSlugs, ptExtensions)
|
||||
ctx.allSlugs.push(...aliases)
|
||||
}
|
||||
|
||||
const parsedFiles = await parseMarkdown(ctx, filePaths)
|
||||
reportSlugCollisions(parsedFiles)
|
||||
const filteredContent = filterContent(ctx, parsedFiles)
|
||||
|
||||
await emitContent(ctx, filteredContent)
|
||||
@@ -155,7 +124,12 @@ async function startWatching(
|
||||
|
||||
for (const content of initialContent) {
|
||||
const [_tree, vfile] = content
|
||||
contentMap.set(vfile.data.relativePath!, {
|
||||
const relPath = vfile.data.relativePath
|
||||
if (!relPath) {
|
||||
console.warn(`Skipping file with no relativePath: ${vfile.path}`)
|
||||
continue
|
||||
}
|
||||
contentMap.set(relPath, {
|
||||
type: "markdown",
|
||||
content,
|
||||
})
|
||||
@@ -191,24 +165,34 @@ async function startWatching(
|
||||
})
|
||||
|
||||
const changes: ChangeEvent[] = []
|
||||
let rebuildTimeout: ReturnType<typeof setTimeout> | null = null
|
||||
const scheduleRebuild = () => {
|
||||
if (rebuildTimeout) clearTimeout(rebuildTimeout)
|
||||
rebuildTimeout = setTimeout(() => {
|
||||
rebuildTimeout = null
|
||||
rebuild(changes, clientRefresh, buildData).catch((err) => {
|
||||
console.error(styleText("red", "Rebuild failed:"), err.message ?? err)
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
watcher
|
||||
.on("add", (fp) => {
|
||||
fp = toPosixPath(fp)
|
||||
if (buildData.ignored(fp)) return
|
||||
changes.push({ path: fp as FilePath, type: "add" })
|
||||
void rebuild(changes, clientRefresh, buildData)
|
||||
scheduleRebuild()
|
||||
})
|
||||
.on("change", (fp) => {
|
||||
fp = toPosixPath(fp)
|
||||
if (buildData.ignored(fp)) return
|
||||
changes.push({ path: fp as FilePath, type: "change" })
|
||||
void rebuild(changes, clientRefresh, buildData)
|
||||
scheduleRebuild()
|
||||
})
|
||||
.on("unlink", (fp) => {
|
||||
fp = toPosixPath(fp)
|
||||
if (buildData.ignored(fp)) return
|
||||
changes.push({ path: fp as FilePath, type: "delete" })
|
||||
void rebuild(changes, clientRefresh, buildData)
|
||||
scheduleRebuild()
|
||||
})
|
||||
|
||||
return async () => {
|
||||
@@ -225,154 +209,155 @@ async function rebuild(changes: ChangeEvent[], clientRefresh: () => void, buildD
|
||||
buildData.lastBuildMs = new Date().getTime()
|
||||
const numChangesInBuild = changes.length
|
||||
const release = await mut.acquire()
|
||||
|
||||
// if there's another build after us, release and let them do it
|
||||
if (ctx.buildId !== buildId) {
|
||||
release()
|
||||
return
|
||||
}
|
||||
|
||||
const perf = new PerfTimer()
|
||||
perf.addEvent("rebuild")
|
||||
console.log(styleText("yellow", "Detected change, rebuilding..."))
|
||||
|
||||
// update changesSinceLastBuild
|
||||
for (const change of changes) {
|
||||
changesSinceLastBuild[change.path] = change.type
|
||||
}
|
||||
|
||||
const staticResources = getStaticResourcesFromPlugins(ctx)
|
||||
const pathsToParse: FilePath[] = []
|
||||
for (const [fp, type] of Object.entries(changesSinceLastBuild)) {
|
||||
if (type === "delete" || path.extname(fp) !== ".md") continue
|
||||
const fullPath = joinSegments(argv.directory, toPosixPath(fp)) as FilePath
|
||||
pathsToParse.push(fullPath)
|
||||
}
|
||||
|
||||
const parsed = await parseMarkdown(ctx, pathsToParse)
|
||||
for (const content of parsed) {
|
||||
contentMap.set(content[1].data.relativePath!, {
|
||||
type: "markdown",
|
||||
content,
|
||||
})
|
||||
}
|
||||
|
||||
// update state using changesSinceLastBuild
|
||||
// we do this weird play of add => compute change events => remove
|
||||
// so that partialEmitters can do appropriate cleanup based on the content of deleted files
|
||||
for (const [file, change] of Object.entries(changesSinceLastBuild)) {
|
||||
if (change === "delete") {
|
||||
// universal delete case
|
||||
contentMap.delete(file as FilePath)
|
||||
try {
|
||||
// if there's another build after us, release and let them do it
|
||||
if (ctx.buildId !== buildId) {
|
||||
return
|
||||
}
|
||||
|
||||
// manually track non-markdown files as processed files only
|
||||
// contains markdown files
|
||||
if (change === "add" && path.extname(file) !== ".md") {
|
||||
contentMap.set(file as FilePath, {
|
||||
type: "other",
|
||||
const perf = new PerfTimer()
|
||||
perf.addEvent("rebuild")
|
||||
console.log(styleText("yellow", "Detected change, rebuilding..."))
|
||||
|
||||
// update changesSinceLastBuild
|
||||
for (const change of changes) {
|
||||
changesSinceLastBuild[change.path] = change.type
|
||||
}
|
||||
|
||||
const staticResources = getStaticResourcesFromPlugins(ctx)
|
||||
const pathsToParse: FilePath[] = []
|
||||
for (const [fp, type] of Object.entries(changesSinceLastBuild)) {
|
||||
if (type === "delete" || path.extname(fp) !== ".md") continue
|
||||
const fullPath = joinSegments(argv.directory, toPosixPath(fp)) as FilePath
|
||||
pathsToParse.push(fullPath)
|
||||
}
|
||||
|
||||
const parsed = await parseMarkdown(ctx, pathsToParse)
|
||||
for (const content of parsed) {
|
||||
const relPath = content[1].data.relativePath
|
||||
if (!relPath) {
|
||||
console.warn(`Skipping file with no relativePath: ${content[1].path}`)
|
||||
continue
|
||||
}
|
||||
contentMap.set(relPath, {
|
||||
type: "markdown",
|
||||
content,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const changeEvents: ChangeEvent[] = Object.entries(changesSinceLastBuild).map(([fp, type]) => {
|
||||
const path = fp as FilePath
|
||||
const processedContent = contentMap.get(path)
|
||||
if (processedContent?.type === "markdown") {
|
||||
const [_tree, file] = processedContent.content
|
||||
// update state using changesSinceLastBuild
|
||||
// we do this weird play of add => compute change events => remove
|
||||
// so that partialEmitters can do appropriate cleanup based on the content of deleted files
|
||||
for (const [file, change] of Object.entries(changesSinceLastBuild)) {
|
||||
if (change === "delete") {
|
||||
// universal delete case
|
||||
contentMap.delete(file as FilePath)
|
||||
}
|
||||
|
||||
// manually track non-markdown files as processed files only
|
||||
// contains markdown files
|
||||
if (change === "add" && path.extname(file) !== ".md") {
|
||||
contentMap.set(file as FilePath, {
|
||||
type: "other",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const changeEvents: ChangeEvent[] = Object.entries(changesSinceLastBuild).map(([fp, type]) => {
|
||||
const path = fp as FilePath
|
||||
const processedContent = contentMap.get(path)
|
||||
if (processedContent?.type === "markdown") {
|
||||
const [_tree, file] = processedContent.content
|
||||
return {
|
||||
type,
|
||||
path,
|
||||
file,
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
type,
|
||||
path,
|
||||
file,
|
||||
}
|
||||
})
|
||||
|
||||
// update allFiles and then allSlugs with the consistent view of content map
|
||||
ctx.allFiles = Array.from(contentMap.keys())
|
||||
ctx.allSlugs = ctx.allFiles.map((fp) => slugifyFilePath(fp as FilePath))
|
||||
|
||||
const markdownContent = Array.from(contentMap.values())
|
||||
.filter((file) => file.type === "markdown")
|
||||
.map((file) => file.content)
|
||||
reportSlugCollisions(markdownContent)
|
||||
let processedFiles = filterContent(ctx, markdownContent)
|
||||
|
||||
let emittedFiles = 0
|
||||
|
||||
// Phase 1: Run PageTypeDispatcher first so it populates ctx.virtualPages
|
||||
const dispatcher = cfg.plugins.emitters.find((e) => e.name === "PageTypeDispatcher")
|
||||
if (dispatcher) {
|
||||
ctx.virtualPages = []
|
||||
const emitFn = dispatcher.partialEmit ?? dispatcher.emit
|
||||
const emitted = await emitFn(ctx, processedFiles, staticResources, changeEvents)
|
||||
if (emitted !== null) {
|
||||
if (Symbol.asyncIterator in emitted) {
|
||||
for await (const file of emitted) {
|
||||
emittedFiles++
|
||||
if (ctx.argv.verbose) {
|
||||
console.log(`[emit:${dispatcher.name}] ${file}`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
emittedFiles += emitted.length
|
||||
if (ctx.argv.verbose) {
|
||||
for (const file of emitted) {
|
||||
console.log(`[emit:${dispatcher.name}] ${file}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
type,
|
||||
path,
|
||||
}
|
||||
})
|
||||
// Phase 2: Run all other emitters with content extended by virtual pages
|
||||
const contentWithVirtual =
|
||||
ctx.virtualPages.length > 0 ? [...processedFiles, ...ctx.virtualPages] : processedFiles
|
||||
for (const emitter of cfg.plugins.emitters) {
|
||||
if (emitter.name === "PageTypeDispatcher") continue
|
||||
// Try to use partialEmit if available, otherwise assume the output is static
|
||||
const emitFn = emitter.partialEmit ?? emitter.emit
|
||||
const emitted = await emitFn(ctx, contentWithVirtual, staticResources, changeEvents)
|
||||
if (emitted === null) {
|
||||
continue
|
||||
}
|
||||
|
||||
// update allFiles and then allSlugs with the consistent view of content map
|
||||
ctx.allFiles = Array.from(contentMap.keys())
|
||||
ctx.allSlugs = ctx.allFiles.map((fp) => slugifyFilePath(fp as FilePath))
|
||||
|
||||
// Add extension-stripped slug aliases for PageType-registered extensions
|
||||
const ptExtensions = getPageTypeExtensions(ctx)
|
||||
if (ptExtensions.size > 0) {
|
||||
const aliases = addVirtualPageSlugAliases(ctx.allSlugs, ptExtensions)
|
||||
ctx.allSlugs.push(...aliases)
|
||||
}
|
||||
let processedFiles = filterContent(
|
||||
ctx,
|
||||
Array.from(contentMap.values())
|
||||
.filter((file) => file.type === "markdown")
|
||||
.map((file) => file.content),
|
||||
)
|
||||
|
||||
let emittedFiles = 0
|
||||
|
||||
// Phase 1: Run PageTypeDispatcher first so it populates ctx.virtualPages
|
||||
const dispatcher = cfg.plugins.emitters.find((e) => e.name === "PageTypeDispatcher")
|
||||
if (dispatcher) {
|
||||
ctx.virtualPages = []
|
||||
const emitFn = dispatcher.partialEmit ?? dispatcher.emit
|
||||
const emitted = await emitFn(ctx, processedFiles, staticResources, changeEvents)
|
||||
if (emitted !== null) {
|
||||
if (Symbol.asyncIterator in emitted) {
|
||||
// Async generator case
|
||||
for await (const file of emitted) {
|
||||
emittedFiles++
|
||||
if (ctx.argv.verbose) {
|
||||
console.log(`[emit:${dispatcher.name}] ${file}`)
|
||||
console.log(`[emit:${emitter.name}] ${file}`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Array case
|
||||
emittedFiles += emitted.length
|
||||
if (ctx.argv.verbose) {
|
||||
for (const file of emitted) {
|
||||
console.log(`[emit:${dispatcher.name}] ${file}`)
|
||||
console.log(`[emit:${emitter.name}] ${file}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(
|
||||
`Emitted ${emittedFiles} files to \`${argv.output}\` in ${perf.timeSince("rebuild")}`,
|
||||
)
|
||||
console.log(styleText("green", `Done rebuilding in ${perf.timeSince()}`))
|
||||
changes.splice(0, numChangesInBuild)
|
||||
clientRefresh()
|
||||
} finally {
|
||||
release()
|
||||
}
|
||||
|
||||
// Phase 2: Run all other emitters with content extended by virtual pages
|
||||
const contentWithVirtual =
|
||||
ctx.virtualPages.length > 0 ? [...processedFiles, ...ctx.virtualPages] : processedFiles
|
||||
for (const emitter of cfg.plugins.emitters) {
|
||||
if (emitter.name === "PageTypeDispatcher") continue
|
||||
// Try to use partialEmit if available, otherwise assume the output is static
|
||||
const emitFn = emitter.partialEmit ?? emitter.emit
|
||||
const emitted = await emitFn(ctx, contentWithVirtual, staticResources, changeEvents)
|
||||
if (emitted === null) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (Symbol.asyncIterator in emitted) {
|
||||
// Async generator case
|
||||
for await (const file of emitted) {
|
||||
emittedFiles++
|
||||
if (ctx.argv.verbose) {
|
||||
console.log(`[emit:${emitter.name}] ${file}`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Array case
|
||||
emittedFiles += emitted.length
|
||||
if (ctx.argv.verbose) {
|
||||
for (const file of emitted) {
|
||||
console.log(`[emit:${emitter.name}] ${file}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Emitted ${emittedFiles} files to \`${argv.output}\` in ${perf.timeSince("rebuild")}`)
|
||||
console.log(styleText("green", `Done rebuilding in ${perf.timeSince()}`))
|
||||
changes.splice(0, numChangesInBuild)
|
||||
clientRefresh()
|
||||
release()
|
||||
}
|
||||
|
||||
export default async (argv: Argv, mut: Mutex, clientRefresh: () => void) => {
|
||||
|
||||
+1
-4
@@ -1,4 +1,3 @@
|
||||
import { ValidDateType } from "./components/Date"
|
||||
import { QuartzComponent } from "./components/types"
|
||||
import { ValidLocale } from "./i18n"
|
||||
import { PluginSpecifier } from "./plugins/loader/types"
|
||||
@@ -68,8 +67,6 @@ export interface GlobalConfiguration {
|
||||
analytics: Analytics
|
||||
/** Glob patterns to not search */
|
||||
ignorePatterns: string[]
|
||||
/** Whether to use created, modified, or published as the default type of date */
|
||||
defaultDateType: ValidDateType
|
||||
/** Base URL to use for CNAME files, sitemaps, and RSS feeds that require an absolute URL.
|
||||
* Quartz will avoid using this as much as possible and use relative URLs most of the time
|
||||
*/
|
||||
@@ -100,7 +97,7 @@ export interface FullPageLayout {
|
||||
afterBody: QuartzComponent[]
|
||||
left: QuartzComponent[]
|
||||
right: QuartzComponent[]
|
||||
footer: QuartzComponent
|
||||
footer: QuartzComponent[]
|
||||
/** Page frame name (e.g. "default", "full-width", "minimal"). Defaults to "default". */
|
||||
frame?: string
|
||||
}
|
||||
|
||||
+5
-31
@@ -11,6 +11,11 @@ export const CommonArgv = {
|
||||
default: false,
|
||||
describe: "print out extra logging information",
|
||||
},
|
||||
concurrency: {
|
||||
number: true,
|
||||
alias: ["c"],
|
||||
describe: "max parallel operations (default: number of CPU cores)",
|
||||
},
|
||||
}
|
||||
|
||||
export const CreateArgv = {
|
||||
@@ -112,35 +117,4 @@ export const BuildArgv = {
|
||||
default: false,
|
||||
describe: "show detailed bundle information",
|
||||
},
|
||||
concurrency: {
|
||||
number: true,
|
||||
describe: "how many threads to use to parse notes",
|
||||
},
|
||||
}
|
||||
|
||||
export const PluginInstallArgv = {
|
||||
...CommonArgv,
|
||||
_: {
|
||||
type: "string",
|
||||
demandOption: true,
|
||||
describe: "package names to install",
|
||||
},
|
||||
}
|
||||
|
||||
export const PluginUninstallArgv = {
|
||||
...CommonArgv,
|
||||
_: {
|
||||
type: "string",
|
||||
demandOption: true,
|
||||
describe: "package names to uninstall",
|
||||
},
|
||||
}
|
||||
|
||||
export const PluginSearchArgv = {
|
||||
...CommonArgv,
|
||||
query: {
|
||||
string: true,
|
||||
alias: ["q"],
|
||||
describe: "search query for plugins",
|
||||
},
|
||||
}
|
||||
Loaded 100 of 155 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user