Compare commits

...
Author SHA1 Message Date
saberzero1 16bc33e9fb chore: regenerate package-lock.json 2026-11-26 00:33:20 +01:00
saberzero1 33acb1c716 Merge remote-tracking branch 'origin/v5' into deps/changesets-cli-3 2026-11-26 00:33:11 +01:00
Emile Bangma 6f689dcdb9 Merge pull request #2677 from jackyzha0/deps/chokidar-6
chore(deps): chokidar 6 (Quartz requires Node.js 22.22)
2026-11-26 00:33:09 +01:00
saberzero1 4679f825fd Merge remote-tracking branch 'origin/v5' into deps/chokidar-6 2026-11-26 00:30:54 +01:00
Emile Bangma 05b5082388 Merge pull request #2676 from jackyzha0/deps/is-absolute-url-5
chore(deps): is-absolute-url 5
2026-11-26 00:30:51 +01:00
saberzero1 c4d02241d5 Merge remote-tracking branch 'origin/v5' into deps/is-absolute-url-5 2026-11-26 00:28:28 +01:00
Emile Bangma 8ce7599280 Merge pull request #2675 from jackyzha0/deps/js-yaml-5
chore(deps): js-yaml 5
2026-11-26 00:28:09 +01:00
saberzero1 edd97cc665 docs: Node.js 22.22 in the prerequisites and on the home page 2026-11-26 00:25:58 +01:00
saberzero1 fd1e5eb8bf ci(release): changesets/action 2 (needs @changesets/cli 3; renamed inputs and outputs, token as input) 2026-11-26 00:23:05 +01:00
saberzero1 ea2b3485bf chore(deps-dev): @changesets/cli 3 2026-11-26 00:17:45 +01:00
saberzero1 857de3b2bc chore(deps): chokidar 6 (requires Node.js 22.22) 2026-11-26 00:16:56 +01:00
saberzero1 df13ac29e5 chore(deps): is-absolute-url 5 (Quartz already passes httpOnly: false; its types now include the option) 2026-11-26 00:11:56 +01:00
saberzero1 3b78d1658d chore(deps): js-yaml 5 (frontmatter reads YAML 1.2's core schema; comment-only frontmatter has no properties) 2026-11-26 00:10:30 +01:00
13 changed files with 425 additions and 867 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": minor
---
Quartz now requires Node.js 22.22 or later (was 22), for chokidar 6, which watches content in `--serve` mode. chokidar 6 confirms each change against the file system before rebuilding and fixes missed and duplicate change events.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
Frontmatter is read with js-yaml 5, using YAML 1.2's core schema (the values Quartz read before are unchanged). Frontmatter with only comments now has no properties, as in Obsidian, instead of being reported as invalid frontmatter.
+6 -7
View File
@@ -34,16 +34,15 @@ jobs:
- name: Create or update the release PR
id: changesets
uses: changesets/action@v1
uses: changesets/action@v2
with:
version: npm run version-packages
title: "chore: release Quartz"
commit: "chore: release Quartz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
version-script: npm run version-packages
pr-title: "chore: release Quartz"
commit-message: "chore: release Quartz"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Tag and publish the GitHub release
if: steps.changesets.outputs.hasChangesets == 'false'
if: steps.changesets.outputs.has-changesets == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
+1 -1
View File
@@ -1 +1 @@
v22.16.0
v22.22.0
+2 -2
View File
@@ -8,13 +8,13 @@ This guide walks you through setting up Quartz from scratch. If you already ran
You need these tools installed before continuing:
- **[Node.js](https://nodejs.org/) v22 or later** (run `node -v` to check)
- **[Node.js](https://nodejs.org/) v22.22 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.
> - **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.22 or later.
> - **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.
+1 -1
View File
@@ -39,7 +39,7 @@ cd quartz
## 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.
> Quartz requires **Node.js 22.22** or later. Check your version with `node -v` and upgrade at [nodejs.org](https://nodejs.org/) if needed.
```bash
npm i
+1 -1
View File
@@ -6,7 +6,7 @@ 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 these installed on your machine before continuing. See the [[getting-started/index#Prerequisites|prerequisites]] for help installing them.
Quartz requires **at least [Node](https://nodejs.org/) v22.22** 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.
> [!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.
+364 -842
View File
File diff suppressed because it is too large. Load diff
+5 -6
View File
@@ -25,7 +25,7 @@
},
"engines": {
"npm": ">=10.9.2",
"node": ">=22"
"node": ">=22.22"
},
"keywords": [
"site generator",
@@ -86,16 +86,16 @@
"@quartz-themes/core": "^3.1.0",
"ansi-truncate": "^1.4.0",
"async-mutex": "^0.5.0",
"chokidar": "^5.0.0",
"chokidar": "^6.0.0",
"esbuild-sass-plugin": "^3.6.0",
"globby": "^16.1.0",
"gray-matter": "^4.0.3",
"hast-util-from-html": "^2.0.0",
"hast-util-to-html": "^9.0.5",
"hast-util-to-jsx-runtime": "^2.3.6",
"is-absolute-url": "^4.0.1",
"is-absolute-url": "^5.0.0",
"isomorphic-git": "^1.36.3",
"js-yaml": "^4.1.0",
"js-yaml": "^5.5.0",
"lightningcss": "^1.31.1",
"micromorph": "^0.4.5",
"minimatch": "^11.0.5",
@@ -122,11 +122,10 @@
"yargs": "^18.0.0"
},
"devDependencies": {
"@changesets/cli": "^2.29.2",
"@changesets/cli": "^3.0.3",
"@quartz-community/types": "^1.3.1",
"@quartz-community/utils": "^1.2.0",
"@types/hast": "^3.0.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "^26.5.1",
"@types/pretty-time": "^1.1.5",
"@types/semver": "^7.7.1",
+3 -3
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env -S node --no-deprecation
const [major] = process.versions.node.split(".").map(Number)
if (major < 22) {
const [major, minor] = process.versions.node.split(".").map(Number)
if (major < 22 || (major === 22 && minor < 22)) {
console.error(
`\nQuartz requires Node.js >= 22, but you are running Node.js ${process.version}.\n` +
`\nQuartz requires Node.js >= 22.22, but you are running Node.js ${process.version}.\n` +
`Please upgrade: https://nodejs.org/\n`,
)
process.exit(1)
+17
View File
@@ -223,6 +223,23 @@ describe("frontmatter built-in", () => {
)
})
test("reads YAML frontmatter with YAML 1.2's core schema, as Obsidian does", () => {
const data = readFrontmatterData(
"---\ntitle: Hello world\ndate: 2024-01-02\ndraft: True\nn: 012\nnone: ~\nratio: .5\nalias: yes\n---\n",
)
assert.deepStrictEqual(data, {
title: "Hello world",
date: "2024-01-02",
draft: true,
n: 12,
none: null,
ratio: 0.5,
alias: "yes",
})
// a block without a document holds no properties
assert.deepStrictEqual(readFrontmatterData("---\n# only a comment\n---\nbody\n"), {})
})
test("refuses JavaScript frontmatter instead of executing it", async () => {
const g = globalThis as { __quartzFrontmatterRan?: boolean }
delete g.__quartzFrontmatterRan
+13 -2
View File
@@ -1,6 +1,6 @@
import matter from "gray-matter"
import remarkFrontmatter from "remark-frontmatter"
import yaml from "js-yaml"
import { CORE_SCHEMA, loadAll } from "js-yaml"
import toml from "toml"
import { QuartzTransformerPlugin } from "../types"
import { QuartzPluginData } from "../vfile"
@@ -141,6 +141,17 @@ const refuseJavaScript = (): never => {
)
}
/**
* YAML frontmatter as properties. YAML 1.2's core schema, as Obsidian reads properties: `true`,
* `null`, `~` and numbers resolve, dates stay strings. A block without a document (empty, or only
* comments) holds no properties.
*/
function loadYaml(source: string): object {
const docs = loadAll(source, { schema: CORE_SCHEMA })
if (docs.length > 1)
throw new Error("expected a single document in the frontmatter, but found more")
return (docs[0] ?? {}) as object
}
/** Parse a file's frontmatter with the configured delimiters and language (`{}` when it has none). */
export function readFrontmatterData(
source: Buffer | string,
@@ -158,7 +169,7 @@ export function readFrontmatterData(
delimiters: options.delimiters ?? frontmatterDefaults.delimiters,
language,
engines: {
yaml: (s) => yaml.load(s, { schema: yaml.JSON_SCHEMA }) as object,
yaml: loadYaml,
toml: (s) => toml.parse(s) as object,
javascript: refuseJavaScript,
js: refuseJavaScript,
+2 -2
View File
@@ -46,10 +46,10 @@ export const legacyCrawlLinksDefaults: Partial<LinksConfig> = {
markdownLinkResolution: "absolute",
}
const isAbsolute = isAbsoluteUrl as (url: string, options?: { httpOnly?: boolean }) => boolean
// As in Obsidian: a URL with a scheme (`x:y`, but not `../x:y`), or a link whose path is not valid
// percent-encoding (`%zz`, `a%E2.md`), which names no file
const isExternalUrl = (url: string) => isAbsolute(url, { httpOnly: false }) || !linkPathDecodes(url)
const isExternalUrl = (url: string) =>
isAbsoluteUrl(url, { httpOnly: false }) || !linkPathDecodes(url)
// An href percent-decoded, to compare with link text; left as it is when it does not decode
const decodedHref = (href: string) => {
try {