Compare commits

..
10 changed files with 89 additions and 27 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
Option checks know the FolderPage `prefixFolders`, TagPage `prefixTags` and Latex `customMacros` options (folder-page 1.0.4, tag-page 1.0.5, latex 1.0.2 declare them in their manifests).
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
Sites created with `npx quartz create` from a template (default, blog, docs, obsidian, ttrpg) run GitHubFlavoredMarkdown before ObsidianFlavoredMarkdown (orders 30 and 40), as the default config does and 5.1 requires. The templates still had the old orders (40 and 30). The obsidian and ttrpg templates no longer set `parseArrows`, which ObsidianFlavoredMarkdown doesn't have.
+12 -12
View File
@@ -31,12 +31,12 @@
"@quartz-community/explicit-publish": "^1.1.0",
"@quartz-community/explorer": "^1.0.3",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.0.3",
"@quartz-community/folder-page": "^1.0.4",
"@quartz-community/footer": "^1.1.1",
"@quartz-community/github-flavored-markdown": "^2.1.1",
"@quartz-community/graph": "^1.0.3",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.0.1",
"@quartz-community/latex": "^1.0.2",
"@quartz-community/note-properties": "^1.1.4",
"@quartz-community/obsidian-flavored-markdown": "^2.1.3",
"@quartz-community/og-image": "^1.1.1",
@@ -52,7 +52,7 @@
"@quartz-community/syntax-highlighting": "^1.0.3",
"@quartz-community/table-of-contents": "^1.0.3",
"@quartz-community/tag-list": "^1.0.3",
"@quartz-community/tag-page": "^1.0.4",
"@quartz-community/tag-page": "^1.0.5",
"@quartz-community/unlisted-pages": "^1.1.0",
"@quartz-themes/core": "^2.0.1",
"ansi-truncate": "^1.4.0",
@@ -2753,9 +2753,9 @@
}
},
"node_modules/@quartz-community/folder-page": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.0.3.tgz",
"integrity": "sha512-d2XN0NOSNXL9cwJqsllWXN7ugCAyCgx7AQl9ByJa3Qe/xvhqsyO84WPiS/BQOFBFlbRcozPHBN6tFZhiWrR5SQ==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.0.4.tgz",
"integrity": "sha512-aOxpf3v5uIAaPRUDMaltw4S3LXu+/x2Xb35alpjv/v3oDT8vAPmeELX8VJs+ZVfRspNiCJaFkOR7HverG407vA==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2866,9 +2866,9 @@
}
},
"node_modules/@quartz-community/latex": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@quartz-community/latex/-/latex-1.0.1.tgz",
"integrity": "sha512-u1bgG335fkp7fCVmJ4bdCzz6CIZFrxSEzP6SRkDV9fiEux8aErPNE+lCR+Kb7eQNniHLpIZcjYejz5Z/0LHD8A==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@quartz-community/latex/-/latex-1.0.2.tgz",
"integrity": "sha512-DbWcGH9PZu7UP7VpxB3kMVReY1bK1/6SsILB+mK3pTqqt7kH+xTOUtiDRgHwRtdUskOAiDb+ZFcQixCKUxTVBg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0"
@@ -3269,9 +3269,9 @@
}
},
"node_modules/@quartz-community/tag-page": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.4.tgz",
"integrity": "sha512-57SBbZGfdckzVtwGtnoFSzxIJbeFEtgATMCMrnfql+5o+kZENnCRP9m2BCl/W3i1u3ygpLQ9DPxSQn97rsqzaw==",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.5.tgz",
"integrity": "sha512-HfRkwQs+iAIb2FKd6+ZgaHwIfdEk+LAZ8mwreD9iB8xUhmmRVjvjxKPUl8stDSI9gSD1Gaa0Pxgwh/sU0/rYgQ==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
+3 -3
View File
@@ -61,12 +61,12 @@
"@quartz-community/explicit-publish": "^1.1.0",
"@quartz-community/explorer": "^1.0.3",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.0.3",
"@quartz-community/folder-page": "^1.0.4",
"@quartz-community/footer": "^1.1.1",
"@quartz-community/github-flavored-markdown": "^2.1.1",
"@quartz-community/graph": "^1.0.3",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.0.1",
"@quartz-community/latex": "^1.0.2",
"@quartz-community/note-properties": "^1.1.4",
"@quartz-community/obsidian-flavored-markdown": "^2.1.3",
"@quartz-community/og-image": "^1.1.1",
@@ -82,7 +82,7 @@
"@quartz-community/syntax-highlighting": "^1.0.3",
"@quartz-community/table-of-contents": "^1.0.3",
"@quartz-community/tag-list": "^1.0.3",
"@quartz-community/tag-page": "^1.0.4",
"@quartz-community/tag-page": "^1.0.5",
"@quartz-community/unlisted-pages": "^1.1.0",
"@quartz-themes/core": "^2.0.1",
"ansi-truncate": "^1.4.0",
+54
View File
@@ -0,0 +1,54 @@
import test, { describe } from "node:test"
import assert from "node:assert"
import fs from "node:fs"
import path from "node:path"
import { createRequire } from "node:module"
import YAML from "yaml"
import { validatePluginOptions } from "./plugin-validation.js"
const root = path.resolve(import.meta.dirname, "..", "..")
const templatesDir = path.join(import.meta.dirname, "templates")
const configs = [
path.join(root, "quartz.config.default.yaml"),
...fs
.readdirSync(templatesDir)
.filter((f) => f.endsWith(".yaml"))
.map((f) => path.join(templatesDir, f)),
]
const require = createRequire(path.join(root, "package.json"))
function manifestOf(source) {
try {
return JSON.parse(fs.readFileSync(require.resolve(`${source}/package.json`), "utf8")).quartz
} catch {
return undefined
}
}
for (const file of configs) {
const name = path.relative(root, file)
const plugins = YAML.parse(fs.readFileSync(file, "utf8")).plugins ?? []
const bySource = new Map(plugins.map((entry) => [entry.source, entry]))
describe(name, () => {
test("runs GitHubFlavoredMarkdown before ObsidianFlavoredMarkdown", () => {
const gfm = bySource.get("@quartz-community/github-flavored-markdown")
const ofm = bySource.get("@quartz-community/obsidian-flavored-markdown")
if (!gfm || !ofm) return
assert.ok(gfm.order < ofm.order, `GFM order ${gfm.order} must be below OFM ${ofm.order}`)
})
test("sets only options the plugins have", () => {
const problems = []
for (const entry of plugins) {
if (typeof entry.source !== "string" || !entry.options) continue
const manifest = manifestOf(entry.source)
if (!manifest) continue
for (const issue of validatePluginOptions(entry.options, manifest)) {
problems.push(`${entry.source}: ${issue.message}`)
}
}
assert.deepStrictEqual(problems, [])
})
})
}
+2 -2
View File
@@ -70,10 +70,10 @@ plugins:
options:
enableInHtmlEmbed: false
enableCheckbox: true
order: 30
order: 40
- source: "@quartz-community/github-flavored-markdown"
enabled: true
order: 40
order: 30
- source: "@quartz-community/table-of-contents"
enabled: true
order: 50
+2 -2
View File
@@ -70,10 +70,10 @@ plugins:
options:
enableInHtmlEmbed: false
enableCheckbox: true
order: 30
order: 40
- source: "@quartz-community/github-flavored-markdown"
enabled: true
order: 40
order: 30
- source: "@quartz-community/table-of-contents"
enabled: true
order: 50
+2 -2
View File
@@ -71,10 +71,10 @@ plugins:
options:
enableInHtmlEmbed: false
enableCheckbox: true
order: 30
order: 40
- source: "@quartz-community/github-flavored-markdown"
enabled: true
order: 40
order: 30
- source: "@quartz-community/table-of-contents"
enabled: true
order: 50
+2 -3
View File
@@ -75,16 +75,15 @@ plugins:
callouts: true
mermaid: true
parseTags: true
parseArrows: true
parseBlockReferences: true
enableInHtmlEmbed: false
enableYouTubeEmbed: true
enableVideoEmbed: true
enableCheckbox: true
order: 30
order: 40
- source: "@quartz-community/github-flavored-markdown"
enabled: true
order: 40
order: 30
- source: "@quartz-community/table-of-contents"
enabled: true
order: 50
+2 -3
View File
@@ -75,16 +75,15 @@ plugins:
callouts: true
mermaid: true
parseTags: true
parseArrows: true
parseBlockReferences: true
enableInHtmlEmbed: false
enableYouTubeEmbed: true
enableVideoEmbed: true
enableCheckbox: true
order: 30
order: 40
- source: "@quartz-community/github-flavored-markdown"
enabled: true
order: 40
order: 30
- source: "@quartz-community/table-of-contents"
enabled: true
order: 50