From 6b90d03ca66e9b4b7096dd04ff74b1503a9bb7ca Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Mon, 26 Feb 2024 12:53:45 -0500 Subject: [PATCH 1/5] chore(type): export attribute for theme key (#933) Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- quartz/util/theme.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/quartz/util/theme.ts b/quartz/util/theme.ts index bd0da5f..49cc9cc 100644 --- a/quartz/util/theme.ts +++ b/quartz/util/theme.ts @@ -9,6 +9,11 @@ export interface ColorScheme { highlight: string } +interface Colors { + lightMode: ColorScheme + darkMode: ColorScheme +} + export interface Theme { typography: { header: string @@ -16,12 +21,11 @@ export interface Theme { code: string } cdnCaching: boolean - colors: { - lightMode: ColorScheme - darkMode: ColorScheme - } + colors: Colors } +export type ThemeKey = keyof Colors + const DEFAULT_SANS_SERIF = '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif' const DEFAULT_MONO = "ui-monospace, SFMono-Regular, SF Mono, Menlo, monospace" From 4957eaa2d02c3987d825487f46e5a74bfbba7601 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 16:17:42 -0500 Subject: [PATCH 2/5] chore(deps): bump preact from 10.19.5 to 10.19.6 (#935) Bumps [preact](https://github.com/preactjs/preact) from 10.19.5 to 10.19.6. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.19.5...10.19.6) --- updated-dependencies: - dependency-name: preact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 50ab837..9ee42ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "mdast-util-to-hast": "^13.1.0", "mdast-util-to-string": "^4.0.0", "micromorph": "^0.4.5", - "preact": "^10.19.5", + "preact": "^10.19.6", "preact-render-to-string": "^6.3.1", "pretty-bytes": "^6.1.1", "pretty-time": "^1.1.0", @@ -4459,9 +4459,9 @@ } }, "node_modules/preact": { - "version": "10.19.5", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.19.5.tgz", - "integrity": "sha512-OPELkDmSVbKjbFqF9tgvOowiiQ9TmsJljIzXRyNE8nGiis94pwv1siF78rQkAP1Q1738Ce6pellRg/Ns/CtHqQ==", + "version": "10.19.6", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.19.6.tgz", + "integrity": "sha512-gympg+T2Z1fG1unB8NH29yHJwnEaCH37Z32diPDku316OTnRPeMbiRV9kTrfZpocXjdfnWuFUl/Mj4BHaf6gnw==", "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" diff --git a/package.json b/package.json index 787c37d..492377b 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "mdast-util-to-hast": "^13.1.0", "mdast-util-to-string": "^4.0.0", "micromorph": "^0.4.5", - "preact": "^10.19.5", + "preact": "^10.19.6", "preact-render-to-string": "^6.3.1", "pretty-bytes": "^6.1.1", "pretty-time": "^1.1.0", From 66a5855fad8ece898cf64460a74e0f7ef6f3b23f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:54:15 -0800 Subject: [PATCH 3/5] chore(deps): bump chokidar from 3.5.3 to 3.6.0 (#937) Bumps [chokidar](https://github.com/paulmillr/chokidar) from 3.5.3 to 3.6.0. - [Release notes](https://github.com/paulmillr/chokidar/releases) - [Commits](https://github.com/paulmillr/chokidar/compare/3.5.3...3.6.0) --- updated-dependencies: - dependency-name: chokidar dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 17 +++++++---------- package.json | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ee42ff..7e71a1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@napi-rs/simple-git": "0.1.16", "async-mutex": "^0.4.1", "chalk": "^5.3.0", - "chokidar": "^3.5.3", + "chokidar": "^3.6.0", "cli-spinner": "^0.2.10", "d3": "^7.8.5", "esbuild-sass-plugin": "^2.16.1", @@ -1344,15 +1344,9 @@ } }, "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -1365,6 +1359,9 @@ "engines": { "node": ">= 8.10.0" }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, "optionalDependencies": { "fsevents": "~2.3.2" } diff --git a/package.json b/package.json index 492377b..ef623a0 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@napi-rs/simple-git": "0.1.16", "async-mutex": "^0.4.1", "chalk": "^5.3.0", - "chokidar": "^3.5.3", + "chokidar": "^3.6.0", "cli-spinner": "^0.2.10", "d3": "^7.8.5", "esbuild-sass-plugin": "^2.16.1", From b9dee0775cda4bb29da1a5fb5b000ddcd4dc1f6e Mon Sep 17 00:00:00 2001 From: kon-foo <25391223+kon-foo@users.noreply.github.com> Date: Mon, 26 Feb 2024 22:55:47 +0100 Subject: [PATCH 4/5] docs: Clarifications in the Explorer Docs (#938) add example to filter by tags. --- docs/features/explorer.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/features/explorer.md b/docs/features/explorer.md index a2acb86..95878f7 100644 --- a/docs/features/explorer.md +++ b/docs/features/explorer.md @@ -61,7 +61,7 @@ export class FileNode { children: FileNode[] // children of current node name: string // last part of slug displayName: string // what actually should be displayed in the explorer - file: QuartzPluginData | null // set if node is a file, see `QuartzPluginData` for more detail + file: QuartzPluginData | null // if node is a file, this is the file's metadata. See `QuartzPluginData` for more detail depth: number // depth of current node ... // rest of implementation @@ -167,6 +167,19 @@ Component.Explorer({ You can customize this by changing the entries of the `omit` set. Simply add all folder or file names you want to remove. +### Remove files by tag + +You can access the frontmatter of a file by `node.file?.frontmatter?`. This allows you to filter out files based on their frontmatter, for example by their tags. + +```ts title="quartz.layout.ts" +Component.Explorer({ + filterFn: (node) => { + // exclude files with the tag "explorerexclude" + return node.file?.frontmatter?.tags?.includes("explorerexclude") !== true + }, +}) +``` + ### Show every element in explorer To override the default filter function that removes the `tags` folder from the explorer, you can set the filter function to `undefined`. From f200a0be22405f1a5b03ddbc173d6174bff3a0ba Mon Sep 17 00:00:00 2001 From: kon-foo <25391223+kon-foo@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:05:28 +0100 Subject: [PATCH 5/5] fix: correct umami host for self-hosted (#939) * fixed umami script path for self-hosted version * Update quartz/plugins/emitters/componentResources.ts Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com> --------- Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com> --- quartz/plugins/emitters/componentResources.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartz/plugins/emitters/componentResources.ts b/quartz/plugins/emitters/componentResources.ts index 0468416..1b6e13a 100644 --- a/quartz/plugins/emitters/componentResources.ts +++ b/quartz/plugins/emitters/componentResources.ts @@ -120,7 +120,7 @@ function addGlobalPageResources( } else if (cfg.analytics?.provider === "umami") { componentResources.afterDOMLoaded.push(` const umamiScript = document.createElement("script") - umamiScript.src = "${cfg.analytics.host}" ?? "https://analytics.umami.is/script.js" + umamiScript.src = "${cfg.analytics.host ?? "https://analytics.umami.is"}/script.js" umamiScript.setAttribute("data-website-id", "${cfg.analytics.websiteId}") umamiScript.async = true