Compare commits

..
Author SHA1 Message Date
saberzero1 c68a4945ab docs: changes you may notice in 5.3.1 2026-11-27 23:23:44 +01:00
5 changed files with 31 additions and 86 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
Some fixes in this release change how existing pages look, mostly to match Obsidian: Bases sorting (natural text order, empty values last, mixed types), Bases `not:` filters and `== null`, Bases group headings, canvas edges, and folders with an unlisted `index.md`. See [Upgrading from 5.3.0 to 5.3.1](https://quartz.jzhao.xyz/getting-started/upgrading#upgrading-from-530-to-531).
-5
View File
@@ -1,5 +0,0 @@
---
"@jackyzha0/quartz": patch
---
`npx quartz plugin install --latest` (and `plugin update`) no longer fails because a disabled plugin can't be updated, for example an old `quartz-themes` entry whose repository moved its plugin. The build doesn't load disabled plugins, so this is now a warning that says how to remove the entry. A failing enabled plugin still fails the command.
+26
View File
@@ -28,6 +28,32 @@ npx quartz plugin install --latest
See the [[upgrade|CLI reference for upgrade]] for more details on available flags.
## Upgrading from 5.3.0 to 5.3.1
5.3.1 is a patch release: fixes from a test audit of Quartz and its plugins, many checked against Obsidian. Upgrade as usual:
```bash
npx quartz upgrade
npx quartz plugin install --latest
```
### Changes you may notice
Most of these make a page look the way Obsidian shows it, so an existing site can look different after the upgrade.
- **[[Bases]] sorting**: text sorts naturally ("Chapter 2" before "Chapter 10") and ignores case, also for the default order by file name. Empty values come last in both directions, including descending sorts. A column that mixes types sorts numbers, dates and durations by value and everything else as text. Group order follows the same rules.
- **[[Bases]] filters and formulas**, as in Obsidian:
- `not:` leaves out a note that matches _any_ of its conditions (it left out only notes matching all of them).
- `status == null` matches notes without `status`, and `status != null` no longer keeps them.
- `"5" == 5` and `1 == true` are true, two strings compare as text (`"10" > "9"` is false), and an empty list counts as false.
- A formula can use a formula defined after it. `x / 0` shows ∞. `sum()`, `mean()`, `min()` and `max()` skip text and booleans, and are empty without numbers. `number("abc")` is an error.
- **[[Bases]] group headings** show their value as a cell does: dates in the local format (not an ISO timestamp, sometimes of the previous day), durations as "4 days", links as the note's name, booleans as a checkbox.
- **[[CanvasPage|Canvas]] edges** leave and enter each card through the side they name, with Obsidian's curve, and the arrow points into that side. An edge without sides joins the sides that face each other (it joined the cards' centres).
- **Folder pages**: a folder whose own `index.md` is unlisted shows that note, with the folder listing below it. A generated folder page used to replace it.
- **Tag links under a base path**: inline `#tag` links from notes two or more folders deep stay on the site. On a site served under a sub-path, such as a GitHub Pages project site, they went to `/tags/…` and returned 404.
- **Locales without a translation** (such as `sv-SE`) no longer crash the build: Quartz uses a translation of the same language, else English, and prints a warning. Dates still use your locale.
- **`npx quartz plugin install --latest`** no longer fails because a _disabled_ plugin can't be updated (for example an old `quartz-themes` entry). It prints a warning with the command to remove the entry.
## Upgrading from 5.2 to 5.3
Quartz 5.3 needs **Node.js 22.22 or later**. Then upgrade as usual:
-17
View File
@@ -1160,13 +1160,6 @@ export async function handlePluginInstallUnified({
const pluginsToUpdate = nameFilter ? Array.from(nameFilter) : Object.keys(lockfile.plugins)
const updatedPlugins = []
let lockfileChanged = false
// Disabled in the config: the build never loads them, so failing to update one is a warning,
// not a failed update (an old entry whose repository changed layout failed every update).
const disabledNames = new Set(
(pluginsJson?.plugins ?? [])
.filter((entry) => entry.enabled === false)
.map((entry) => extractPluginName(entry.source)),
)
// Phase 1: Validate and categorize plugins (fast, sequential)
const validPlugins = []
@@ -1251,16 +1244,6 @@ export async function handlePluginInstallUnified({
}
}
} catch (error) {
if (disabledNames.has(name)) {
console.log(
styleText(
"yellow",
`⚠ Could not update ${name} (disabled, so the build does not load it): ${describeCommandError(error)}\n` +
` Remove it with \`npx quartz plugin remove ${name}\` or fix its source.`,
),
)
return
}
console.log(
styleText("red", `✗ Failed to update ${name}: ${describeCommandError(error)}`),
)
-64
View File
@@ -294,67 +294,3 @@ describe("plugin commands with an extending config", () => {
assert.doesNotMatch(read(dir), /comments/)
})
})
describe("plugin install --latest with a plugin that can't be updated", () => {
const cli = path.resolve(import.meta.dirname, "..", "bootstrap-cli.mjs")
// A Git plugin whose repository no longer has the configured subdirectory (an old
// quartz-themes entry: the repository moved its plugin out of `plugin/`).
const site = (enabled) => {
const repo = path.join(root, "repo")
fs.mkdirSync(repo, { recursive: true })
fs.writeFileSync(path.join(repo, "README.md"), "no plugin/ here\n")
const git = (args) => execSync(`git ${args}`, { cwd: repo, stdio: "ignore", timeout: 30_000 })
git("init -q -b main")
git("-c user.name=t -c user.email=t@t add .")
git("-c user.name=t -c user.email=t@t commit -q -m init")
const url = pathToFileURL(repo).href
const dir = path.join(root, "site")
fs.mkdirSync(path.join(dir, ".quartz", "plugins", "old-theme"), { recursive: true })
fs.writeFileSync(path.join(dir, "package.json"), `{ "name": "site", "version": "5.3.1" }`)
fs.writeFileSync(
path.join(dir, "quartz.config.yaml"),
YAML.stringify({
configuration: { pageTitle: "t" },
plugins: [{ source: { name: "old-theme", repo: url, subdir: "plugin" }, enabled }],
}),
)
fs.writeFileSync(
path.join(dir, "quartz.lock.json"),
JSON.stringify({
version: "1.0.0",
plugins: {
"old-theme": {
source: url,
resolved: url,
subdir: "plugin",
commit: "0000000000000000000000000000000000000000",
installedAt: "2026-01-01T00:00:00.000Z",
},
},
}),
)
return dir
}
const run = (dir) => {
const result = spawnSync(process.execPath, [cli, "plugin", "install", "--latest"], {
cwd: dir,
encoding: "utf-8",
timeout: 60_000,
env: { ...process.env, QUARTZ_CONFIG_PATH: "" },
})
return { output: result.stdout + result.stderr, status: result.status }
}
test("a disabled plugin only warns: the build doesn't load it", () => {
const { output, status } = run(site(false))
assert.match(output, /Could not update old-theme \(disabled/)
assert.match(output, /npx quartz plugin remove old-theme/)
assert.strictEqual(status, 0)
})
test("an enabled plugin fails the update", () => {
const { output, status } = run(site(true))
assert.match(output, /Failed to update old-theme/)
assert.strictEqual(status, 1)
})
})