From 52e6c037309a752741f79264afb3e83cd75feabc Mon Sep 17 00:00:00 2001 From: ikorihn <16367098+ikorihn@users.noreply.github.com> Date: Sun, 14 Jan 2024 02:08:21 +0900 Subject: [PATCH 01/98] fix: broken RSS item's link, which were set to `https:/${base}`. (#687) --- quartz/plugins/emitters/contentIndex.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/quartz/plugins/emitters/contentIndex.ts b/quartz/plugins/emitters/contentIndex.ts index bc4c6c325..47a84270a 100644 --- a/quartz/plugins/emitters/contentIndex.ts +++ b/quartz/plugins/emitters/contentIndex.ts @@ -48,12 +48,11 @@ function generateSiteMap(cfg: GlobalConfiguration, idx: ContentIndex): string { function generateRSSFeed(cfg: GlobalConfiguration, idx: ContentIndex, limit?: number): string { const base = cfg.baseUrl ?? "" - const root = `https://${base}` const createURLEntry = (slug: SimpleSlug, content: ContentDetails): string => ` ${escapeHTML(content.title)} - ${joinSegments(root, encodeURI(slug))} - ${joinSegments(root, encodeURI(slug))} + https://${joinSegments(base, encodeURI(slug))} + https://${joinSegments(base, encodeURI(slug))} ${content.richContent ?? content.description} ${content.date?.toUTCString()} ` @@ -78,7 +77,7 @@ function generateRSSFeed(cfg: GlobalConfiguration, idx: ContentIndex, limit?: nu ${escapeHTML(cfg.pageTitle)} - ${root} + https://${base} ${!!limit ? `Last ${limit} notes` : "Recent notes"} on ${escapeHTML( cfg.pageTitle, )} From 0a8c38dc21eeb9aba16154f09e523b2ce762dab2 Mon Sep 17 00:00:00 2001 From: ikorihn <16367098+ikorihn@users.noreply.github.com> Date: Sun, 14 Jan 2024 02:09:41 +0900 Subject: [PATCH 02/98] fix: small typos (#686) --- docs/authoring content.md | 2 +- docs/features/breadcrumbs.md | 2 +- docs/features/explorer.md | 2 +- docs/hosting.md | 2 +- quartz/cli/handlers.js | 4 ++-- quartz/components/Breadcrumbs.tsx | 6 +++--- quartz/components/scripts/search.inline.ts | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/authoring content.md b/docs/authoring content.md index fa6eea258..248214037 100644 --- a/docs/authoring content.md +++ b/docs/authoring content.md @@ -2,7 +2,7 @@ title: 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 initailized. 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 [[index#🪴 Get Started|setup Quartz]] already, 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. diff --git a/docs/features/breadcrumbs.md b/docs/features/breadcrumbs.md index a241aac41..a70185836 100644 --- a/docs/features/breadcrumbs.md +++ b/docs/features/breadcrumbs.md @@ -20,7 +20,7 @@ Component.Breadcrumbs({ rootName: "Home", // name of first/root element resolveFrontmatterTitle: true, // whether to resolve folder names through frontmatter titles hideOnRoot: true, // whether to hide breadcrumbs on root `index.md` page - showCurrentPage: true, // wether to display the current page in the breadcrumbs + showCurrentPage: true, // whether to display the current page in the breadcrumbs }) ``` diff --git a/docs/features/explorer.md b/docs/features/explorer.md index f4d54faaf..b5fd379a7 100644 --- a/docs/features/explorer.md +++ b/docs/features/explorer.md @@ -26,7 +26,7 @@ Component.Explorer({ title: "Explorer", // title of the explorer component folderClickBehavior: "collapse", // what happens when you click a folder ("link" to navigate to folder page on click or "collapse" to collapse folder on click) folderDefaultState: "collapsed", // default state of folders ("collapsed" or "open") - useSavedState: true, // wether to use local storage to save "state" (which folders are opened) of explorer + useSavedState: true, // whether to use local storage to save "state" (which folders are opened) of explorer // Sort order: folders first, then files. Sort folders and files alphabetically sortFn: (a, b) => { ... // default implementation shown later diff --git a/docs/hosting.md b/docs/hosting.md index 9761e5b45..e6340d293 100644 --- a/docs/hosting.md +++ b/docs/hosting.md @@ -225,6 +225,6 @@ pages: - public ``` -When `.gitlab-ci.yaml` is commited, GitLab will build and deploy the website as a GitLab Page. You can find the url under `Deploy > Pages` in the sidebar. +When `.gitlab-ci.yaml` is committed, GitLab will build and deploy the website as a GitLab Page. You can find the url under `Deploy > Pages` in the sidebar. By default, the page is private and only visible when logged in to a GitLab account with access to the repository but can be opened in the settings under `Deploy` -> `Pages`. diff --git a/quartz/cli/handlers.js b/quartz/cli/handlers.js index 37762a4fb..6f8aad1ab 100644 --- a/quartz/cli/handlers.js +++ b/quartz/cli/handlers.js @@ -450,7 +450,7 @@ export async function handleUpdate(argv) { try { gitPull(UPSTREAM_NAME, QUARTZ_SOURCE_BRANCH) } catch { - console.log(chalk.red("An error occured above while pulling updates.")) + console.log(chalk.red("An error occurred above while pulling updates.")) await popContentFolder(contentFolder) return } @@ -522,7 +522,7 @@ export async function handleSync(argv) { try { gitPull(ORIGIN_NAME, QUARTZ_SOURCE_BRANCH) } catch { - console.log(chalk.red("An error occured above while pulling updates.")) + console.log(chalk.red("An error occurred above while pulling updates.")) await popContentFolder(contentFolder) return } diff --git a/quartz/components/Breadcrumbs.tsx b/quartz/components/Breadcrumbs.tsx index 175f6f39d..0497b6458 100644 --- a/quartz/components/Breadcrumbs.tsx +++ b/quartz/components/Breadcrumbs.tsx @@ -18,15 +18,15 @@ interface BreadcrumbOptions { */ rootName: string /** - * wether to look up frontmatter title for folders (could cause performance problems with big vaults) + * Whether to look up frontmatter title for folders (could cause performance problems with big vaults) */ resolveFrontmatterTitle: boolean /** - * Wether to display breadcrumbs on root `index.md` + * Whether to display breadcrumbs on root `index.md` */ hideOnRoot: boolean /** - * Wether to display the current page in the breadcrumbs. + * Whether to display the current page in the breadcrumbs. */ showCurrentPage: boolean } diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts index eff4eb1b9..2858e0fd1 100644 --- a/quartz/components/scripts/search.inline.ts +++ b/quartz/components/scripts/search.inline.ts @@ -35,12 +35,12 @@ function highlight(searchTerm: string, text: string, trim?: boolean) { if (trim) { const includesCheck = (tok: string) => tokenizedTerms.some((term) => tok.toLowerCase().startsWith(term.toLowerCase())) - const occurencesIndices = tokenizedText.map(includesCheck) + const occurrencesIndices = tokenizedText.map(includesCheck) let bestSum = 0 let bestIndex = 0 for (let i = 0; i < Math.max(tokenizedText.length - contextWindowWords, 0); i++) { - const window = occurencesIndices.slice(i, i + contextWindowWords) + const window = occurrencesIndices.slice(i, i + contextWindowWords) const windowSum = window.reduce((total, cur) => total + (cur ? 1 : 0), 0) if (windowSum >= bestSum) { bestSum = windowSum @@ -196,7 +196,7 @@ document.addEventListener("nav", async (e: unknown) => { const termLower = term.toLowerCase() let matching = tags.filter((str) => str.includes(termLower)) - // Substract matching from original tags, then push difference + // Subtract matching from original tags, then push difference if (matching.length > 0) { let difference = tags.filter((x) => !matching.includes(x)) From 6babb788edbdeaf532d406d6daa4d046e5223c7b Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 13 Jan 2024 09:22:27 -0800 Subject: [PATCH 03/98] fix: sluggify pound (closes #681) --- quartz/util/path.test.ts | 2 ++ quartz/util/path.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/quartz/util/path.test.ts b/quartz/util/path.test.ts index 18edc9407..16e0311db 100644 --- a/quartz/util/path.test.ts +++ b/quartz/util/path.test.ts @@ -105,6 +105,8 @@ describe("transforms", () => { ["index.md", "index"], ["test.mp4", "test.mp4"], ["note with spaces.md", "note-with-spaces"], + ["test/special chars?.md", "test/special-chars-q"], + ["test/special chars #3.md", "test/special-chars-3"], ], path.slugifyFilePath, path.isFilePath, diff --git a/quartz/util/path.ts b/quartz/util/path.ts index 6cedffdb6..95acf119d 100644 --- a/quartz/util/path.ts +++ b/quartz/util/path.ts @@ -50,7 +50,9 @@ export function getFullSlug(window: Window): FullSlug { function sluggify(s: string): string { return s .split("/") - .map((segment) => segment.replace(/\s/g, "-").replace(/%/g, "-percent").replace(/\?/g, "-q")) // slugify all segments + .map((segment) => + segment.replace(/\s/g, "-").replace(/%/g, "-percent").replace(/\?/g, "-q").replace(/#/g, ""), + ) // slugify all segments .join("/") // always use / as sep .replace(/\/$/, "") } From 4014c4d6d60f64d64798ce860423513536bb0d98 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 13 Jan 2024 09:27:00 -0800 Subject: [PATCH 04/98] fix: add another test for notes with dots --- quartz/util/path.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/quartz/util/path.test.ts b/quartz/util/path.test.ts index 16e0311db..6a8aa3d1d 100644 --- a/quartz/util/path.test.ts +++ b/quartz/util/path.test.ts @@ -105,6 +105,7 @@ describe("transforms", () => { ["index.md", "index"], ["test.mp4", "test.mp4"], ["note with spaces.md", "note-with-spaces"], + ["notes.with.dots.md", "notes.with.dots"], ["test/special chars?.md", "test/special-chars-q"], ["test/special chars #3.md", "test/special-chars-3"], ], From 783b9b219c90fcf929513171867c1054b3ccb1f4 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 13 Jan 2024 09:29:43 -0800 Subject: [PATCH 05/98] fix: dont hijack handlers when search is not focused (closes #680) --- quartz/components/scripts/search.inline.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts index 2858e0fd1..de3de2be3 100644 --- a/quartz/components/scripts/search.inline.ts +++ b/quartz/components/scripts/search.inline.ts @@ -110,6 +110,7 @@ document.addEventListener("nav", async (e: unknown) => { } function shortcutHandler(e: HTMLElementEventMap["keydown"]) { + if (!container?.classList.contains("active")) return if (e.key === "k" && (e.ctrlKey || e.metaKey) && !e.shiftKey) { e.preventDefault() const searchBarOpen = container?.classList.contains("active") From 4e82b0d8ce805ca832e08bafcfe5144e352c2d05 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 13 Jan 2024 09:37:24 -0800 Subject: [PATCH 06/98] docs: add sidneys artist handbook to showcase --- docs/showcase.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/showcase.md b/docs/showcase.md index ca5737b78..16235e46a 100644 --- a/docs/showcase.md +++ b/docs/showcase.md @@ -23,5 +23,6 @@ Want to see what Quartz can do? Here are some cool community gardens: - [Caicai's Novels](https://imoko.cc/blog/caicai/) - [🌊 Collapsed Wave](https://collapsedwave.com/) - [Aaron Pham's Garden](https://aarnphm.xyz/) +- [Sideny's 3D Artist's Handbook](https://sidney-eliot.github.io/3d-artists-handbook/) If you want to see your own on here, submit a [Pull Request adding yourself to this file](https://github.com/jackyzha0/quartz/blob/v4/docs/showcase.md)! From e70312320f77e8ee362fd12c5dc5597cfb3cb1ae Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 13 Jan 2024 09:47:56 -0800 Subject: [PATCH 07/98] feat: improve default layout --- quartz.layout.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quartz.layout.ts b/quartz.layout.ts index 4e8a85ff4..b5a1639eb 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -37,12 +37,13 @@ export const defaultContentPageLayout: PageLayout = { // components for pages that display lists of pages (e.g. tags or folders) export const defaultListPageLayout: PageLayout = { - beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle()], + beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()], left: [ Component.PageTitle(), Component.MobileOnly(Component.Spacer()), Component.Search(), Component.Darkmode(), + Component.DesktopOnly(Component.Explorer()), ], right: [], } From a40dbd55a43bfdb24a959bf5be64460438f220d5 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 13 Jan 2024 13:56:03 -0800 Subject: [PATCH 08/98] fix: unbork search shortcut --- quartz/components/scripts/search.inline.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts index de3de2be3..11e1c0da8 100644 --- a/quartz/components/scripts/search.inline.ts +++ b/quartz/components/scripts/search.inline.ts @@ -110,7 +110,6 @@ document.addEventListener("nav", async (e: unknown) => { } function shortcutHandler(e: HTMLElementEventMap["keydown"]) { - if (!container?.classList.contains("active")) return if (e.key === "k" && (e.ctrlKey || e.metaKey) && !e.shiftKey) { e.preventDefault() const searchBarOpen = container?.classList.contains("active") @@ -123,7 +122,10 @@ document.addEventListener("nav", async (e: unknown) => { // add "#" prefix for tag search if (searchBar) searchBar.value = "#" - } else if (e.key === "Enter") { + } + + if (!container?.classList.contains("active")) return + else if (e.key === "Enter") { // If result has focus, navigate to that one, otherwise pick first result if (results?.contains(document.activeElement)) { const active = document.activeElement as HTMLInputElement From f36376503a20f8b0697d72cf1e41dcf402020891 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 13 Jan 2024 14:47:39 -0800 Subject: [PATCH 09/98] fix: allow transcludes of notes with dots (closes #682) --- quartz/plugins/transformers/ofm.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index be3344aa4..35257cc06 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -150,7 +150,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin src = src.toString() } - src = src.replaceAll(calloutLineRegex, (value) => { + src = src.replace(calloutLineRegex, (value) => { // force newline after title of callout return value + "\n> " }) @@ -162,7 +162,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin src = src.toString() } - src = src.replaceAll(wikilinkRegex, (value, ...capture) => { + src = src.replace(wikilinkRegex, (value, ...capture) => { const [rawFp, rawHeader, rawAlias]: (string | undefined)[] = capture const fp = rawFp ?? "" @@ -236,7 +236,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin type: "html", value: ``, } - } else if (ext === "") { + } else { const block = anchor return { type: "html", @@ -330,7 +330,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin if (typeof replace === "string") { node.value = node.value.replace(regex, replace) } else { - node.value = node.value.replaceAll(regex, (substring: string, ...args) => { + node.value = node.value.replace(regex, (substring: string, ...args) => { const replaceValue = replace(substring, ...args) if (typeof replaceValue === "string") { return replaceValue From 8eec47c340d48d9b45970a88da0aaff4e216a7e2 Mon Sep 17 00:00:00 2001 From: kabirgh <15871468+kabirgh@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:39:16 +0000 Subject: [PATCH 10/98] fix: rebuild errors on windows (#692) --- quartz/build.ts | 6 +++--- quartz/cli/handlers.js | 4 ++-- quartz/cli/helpers.js | 9 +++++++++ quartz/util/fs.ts | 13 +++++++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 quartz/util/fs.ts diff --git a/quartz/build.ts b/quartz/build.ts index 24f049882..6bb3b50ad 100644 --- a/quartz/build.ts +++ b/quartz/build.ts @@ -2,7 +2,6 @@ import sourceMapSupport from "source-map-support" sourceMapSupport.install(options) import path from "path" import { PerfTimer } from "./util/perf" -import { rimraf } from "rimraf" import { isGitIgnored } from "globby" import chalk from "chalk" import { parseMarkdown } from "./processors/parse" @@ -13,6 +12,7 @@ import { FilePath, joinSegments, slugifyFilePath } from "./util/path" import chokidar from "chokidar" import { ProcessedContent } from "./plugins/vfile" import { Argv, BuildCtx } from "./util/ctx" +import { rmrf } from "./util/fs" import { glob, toPosixPath } from "./util/glob" import { trace } from "./util/trace" import { options } from "./util/sourcemap" @@ -40,7 +40,7 @@ async function buildQuartz(argv: Argv, mut: Mutex, clientRefresh: () => void) { const release = await mut.acquire() perf.addEvent("clean") - await rimraf(output) + await rmrf(output) console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`) perf.addEvent("glob") @@ -145,7 +145,7 @@ async function startServing( // TODO: we can probably traverse the link graph to figure out what's safe to delete here // instead of just deleting everything - await rimraf(argv.output) + await rmrf(argv.output) await emitContent(ctx, filteredContent) console.log(chalk.green(`Done rebuilding in ${perf.timeSince()}`)) } catch (err) { diff --git a/quartz/cli/handlers.js b/quartz/cli/handlers.js index 6f8aad1ab..8460dad39 100644 --- a/quartz/cli/handlers.js +++ b/quartz/cli/handlers.js @@ -5,7 +5,6 @@ import chalk from "chalk" import { sassPlugin } from "esbuild-sass-plugin" import fs from "fs" import { intro, outro, select, text } from "@clack/prompts" -import { rimraf } from "rimraf" import chokidar from "chokidar" import prettyBytes from "pretty-bytes" import { execSync, spawnSync } from "child_process" @@ -21,6 +20,7 @@ import { gitPull, popContentFolder, stashContentFolder, + rmrf, } from "./helpers.js" import { UPSTREAM_NAME, @@ -109,7 +109,7 @@ export async function handleCreate(argv) { if (contentStat.isSymbolicLink()) { await fs.promises.unlink(contentFolder) } else { - await rimraf(contentFolder) + await rmrf(contentFolder) } } diff --git a/quartz/cli/helpers.js b/quartz/cli/helpers.js index 702a1b71d..1bb9b23d7 100644 --- a/quartz/cli/helpers.js +++ b/quartz/cli/helpers.js @@ -3,6 +3,7 @@ import chalk from "chalk" import { contentCacheFolder } from "./constants.js" import { spawnSync } from "child_process" import fs from "fs" +import { rimraf } from "rimraf" export function escapePath(fp) { return fp @@ -52,3 +53,11 @@ export async function popContentFolder(contentFolder) { }) await fs.promises.rm(contentCacheFolder, { force: true, recursive: true }) } + +export async function rmrf(path) { + if (os.platform() == "win32") { + return rimraf.windows(path) + } else { + return rimraf(path) + } +} diff --git a/quartz/util/fs.ts b/quartz/util/fs.ts new file mode 100644 index 000000000..ef15fc055 --- /dev/null +++ b/quartz/util/fs.ts @@ -0,0 +1,13 @@ +import os from "os" +import { rimraf, RimrafAsyncOptions } from "rimraf" + +export async function rmrf( + path: string | string[], + opt?: RimrafAsyncOptions | undefined, +): Promise { + if (os.platform() == "win32") { + return rimraf.windows(path, opt) + } else { + return rimraf(path, opt) + } +} From 30640e3441f9273dfdb9f8cf6ea0a29f0bec04a0 Mon Sep 17 00:00:00 2001 From: kabirgh <15871468+kabirgh@users.noreply.github.com> Date: Mon, 15 Jan 2024 19:51:46 +0000 Subject: [PATCH 11/98] Revert "fix: rebuild errors on windows (#692)" (#695) This reverts commit 8eec47c340d48d9b45970a88da0aaff4e216a7e2. --- quartz/build.ts | 6 +++--- quartz/cli/handlers.js | 4 ++-- quartz/cli/helpers.js | 9 --------- quartz/util/fs.ts | 13 ------------- 4 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 quartz/util/fs.ts diff --git a/quartz/build.ts b/quartz/build.ts index 6bb3b50ad..24f049882 100644 --- a/quartz/build.ts +++ b/quartz/build.ts @@ -2,6 +2,7 @@ import sourceMapSupport from "source-map-support" sourceMapSupport.install(options) import path from "path" import { PerfTimer } from "./util/perf" +import { rimraf } from "rimraf" import { isGitIgnored } from "globby" import chalk from "chalk" import { parseMarkdown } from "./processors/parse" @@ -12,7 +13,6 @@ import { FilePath, joinSegments, slugifyFilePath } from "./util/path" import chokidar from "chokidar" import { ProcessedContent } from "./plugins/vfile" import { Argv, BuildCtx } from "./util/ctx" -import { rmrf } from "./util/fs" import { glob, toPosixPath } from "./util/glob" import { trace } from "./util/trace" import { options } from "./util/sourcemap" @@ -40,7 +40,7 @@ async function buildQuartz(argv: Argv, mut: Mutex, clientRefresh: () => void) { const release = await mut.acquire() perf.addEvent("clean") - await rmrf(output) + await rimraf(output) console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`) perf.addEvent("glob") @@ -145,7 +145,7 @@ async function startServing( // TODO: we can probably traverse the link graph to figure out what's safe to delete here // instead of just deleting everything - await rmrf(argv.output) + await rimraf(argv.output) await emitContent(ctx, filteredContent) console.log(chalk.green(`Done rebuilding in ${perf.timeSince()}`)) } catch (err) { diff --git a/quartz/cli/handlers.js b/quartz/cli/handlers.js index 8460dad39..6f8aad1ab 100644 --- a/quartz/cli/handlers.js +++ b/quartz/cli/handlers.js @@ -5,6 +5,7 @@ import chalk from "chalk" import { sassPlugin } from "esbuild-sass-plugin" import fs from "fs" import { intro, outro, select, text } from "@clack/prompts" +import { rimraf } from "rimraf" import chokidar from "chokidar" import prettyBytes from "pretty-bytes" import { execSync, spawnSync } from "child_process" @@ -20,7 +21,6 @@ import { gitPull, popContentFolder, stashContentFolder, - rmrf, } from "./helpers.js" import { UPSTREAM_NAME, @@ -109,7 +109,7 @@ export async function handleCreate(argv) { if (contentStat.isSymbolicLink()) { await fs.promises.unlink(contentFolder) } else { - await rmrf(contentFolder) + await rimraf(contentFolder) } } diff --git a/quartz/cli/helpers.js b/quartz/cli/helpers.js index 1bb9b23d7..702a1b71d 100644 --- a/quartz/cli/helpers.js +++ b/quartz/cli/helpers.js @@ -3,7 +3,6 @@ import chalk from "chalk" import { contentCacheFolder } from "./constants.js" import { spawnSync } from "child_process" import fs from "fs" -import { rimraf } from "rimraf" export function escapePath(fp) { return fp @@ -53,11 +52,3 @@ export async function popContentFolder(contentFolder) { }) await fs.promises.rm(contentCacheFolder, { force: true, recursive: true }) } - -export async function rmrf(path) { - if (os.platform() == "win32") { - return rimraf.windows(path) - } else { - return rimraf(path) - } -} diff --git a/quartz/util/fs.ts b/quartz/util/fs.ts deleted file mode 100644 index ef15fc055..000000000 --- a/quartz/util/fs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import os from "os" -import { rimraf, RimrafAsyncOptions } from "rimraf" - -export async function rmrf( - path: string | string[], - opt?: RimrafAsyncOptions | undefined, -): Promise { - if (os.platform() == "win32") { - return rimraf.windows(path, opt) - } else { - return rimraf(path, opt) - } -} From f31cabbbf9b0d438710618a3edd2a4eaaae09d7d Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 15 Jan 2024 12:37:50 -0800 Subject: [PATCH 12/98] fix: dont use default callout title if theres additional title children left (closes #693) --- quartz/plugins/transformers/ofm.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 35257cc06..6688059dd 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -366,7 +366,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin } const text = firstChild.children[0].value - const restChildren = firstChild.children.slice(1) + const restOfTitle = firstChild.children.slice(1) const [firstLine, ...remainingLines] = text.split("\n") const remainingText = remainingLines.join("\n") @@ -382,7 +382,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin match.input.slice(calloutDirective.length).trim() || capitalize(calloutType) const titleNode: Paragraph = { type: "paragraph", - children: [{ type: "text", value: titleContent + " " }, ...restChildren], + children: + restOfTitle.length === 0 + ? [{ type: "text", value: titleContent + " " }] + : restOfTitle, } const title = mdastToHtml(titleNode) From fa7d139ce5a0216ca3f6e63c78f818e9c028a3ab Mon Sep 17 00:00:00 2001 From: sean <146651411+tuta-amb@users.noreply.github.com> Date: Tue, 16 Jan 2024 02:55:32 -0500 Subject: [PATCH 13/98] feat: External link icons (#697) --- quartz/plugins/transformers/links.ts | 26 +++++++++++++++++++++++++- quartz/styles/base.scss | 11 +++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/quartz/plugins/transformers/links.ts b/quartz/plugins/transformers/links.ts index 50d2d1a0a..1ba0c8e58 100644 --- a/quartz/plugins/transformers/links.ts +++ b/quartz/plugins/transformers/links.ts @@ -21,6 +21,7 @@ interface Options { prettyLinks: boolean openLinksInNewTab: boolean lazyLoad: boolean + externalLinkIcon: boolean } const defaultOptions: Options = { @@ -28,6 +29,7 @@ const defaultOptions: Options = { prettyLinks: true, openLinksInNewTab: false, lazyLoad: false, + externalLinkIcon: true, } export const CrawlLinks: QuartzTransformerPlugin | undefined> = (userOpts) => { @@ -55,7 +57,29 @@ export const CrawlLinks: QuartzTransformerPlugin | undefined> = ) { let dest = node.properties.href as RelativeURL const classes = (node.properties.className ?? []) as string[] - classes.push(isAbsoluteUrl(dest) ? "external" : "internal") + const isExternal = isAbsoluteUrl(dest) + classes.push(isExternal ? "external" : "internal") + + if (isExternal && opts.externalLinkIcon) { + node.children.push({ + type: "element", + tagName: "svg", + properties: { + class: "external-icon", + viewBox: "0 0 512 512", + }, + children: [ + { + type: "element", + tagName: "path", + properties: { + d: "M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z", + }, + children: [], + }, + ], + }) + } // Check if the link has alias text if ( diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 607749aa1..16a96122e 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -59,6 +59,7 @@ a { text-decoration: none; transition: color 0.2s ease; color: var(--secondary); + display: inline-block; &:hover { color: var(--tertiary) !important; @@ -76,6 +77,16 @@ a { padding: 0; } } + + &.external .external-icon { + vertical-align: bottom; + height: 1ex; + margin: 0 0.15em; + + > path { + fill: var(--dark); + } + } } .desktop-only { From 107d9b8dff59de34a2ebef4b7be942b12f435e3a Mon Sep 17 00:00:00 2001 From: sean <146651411+tuta-amb@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:18:55 -0500 Subject: [PATCH 14/98] fix: external link icon shouldn't be vertical aligned (#699) --- quartz/styles/base.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 16a96122e..68ee11136 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -79,7 +79,6 @@ a { } &.external .external-icon { - vertical-align: bottom; height: 1ex; margin: 0 0.15em; From e17ff202449635af29ef0056886e472a2615708b Mon Sep 17 00:00:00 2001 From: kabirgh <15871468+kabirgh@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:24:01 +0000 Subject: [PATCH 15/98] fix: use joinSegments for `contentIndex.json` file path (#702) --- quartz/plugins/emitters/contentIndex.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartz/plugins/emitters/contentIndex.ts b/quartz/plugins/emitters/contentIndex.ts index 47a84270a..fa8c2c9d4 100644 --- a/quartz/plugins/emitters/contentIndex.ts +++ b/quartz/plugins/emitters/contentIndex.ts @@ -133,7 +133,7 @@ export const ContentIndex: QuartzEmitterPlugin> = (opts) => { ) } - const fp = path.join("static", "contentIndex") as FullSlug + const fp = joinSegments("static", "contentIndex") as FullSlug const simplifiedIndex = Object.fromEntries( Array.from(linkIndex).map(([slug, content]) => { // remove description and from content index as nothing downstream From f6299da1823b51917792905ca71257e55f706ed6 Mon Sep 17 00:00:00 2001 From: Matthew Bailin Date: Thu, 18 Jan 2024 00:32:02 +0700 Subject: [PATCH 16/98] feat: add ofm option to transform `` tags with video exts into `` (closes #463) (#664) * enableVideoEmbed plugin * enableVideoEmbed plugin * enableVideoEmbed plugin * enableVideoEmbed plugin * enableVideoEmbed plugin * cleaned up index validation, regex, conditional, no autoplay * Update quartz/plugins/transformers/ofm.ts Co-authored-by: Jacky Zhao * Update quartz/plugins/transformers/ofm.ts Co-authored-by: Jacky Zhao * Update quartz/plugins/transformers/ofm.ts Co-authored-by: Jacky Zhao * Update ofm.ts * Update ofm.ts --------- Co-authored-by: Jacky Zhao --- quartz/plugins/transformers/ofm.ts | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 6688059dd..8caad979e 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -26,6 +26,7 @@ export interface Options { parseBlockReferences: boolean enableInHtmlEmbed: boolean enableYouTubeEmbed: boolean + enableVideoEmbed: boolean } const defaultOptions: Options = { @@ -37,7 +38,8 @@ const defaultOptions: Options = { parseTags: true, parseBlockReferences: true, enableInHtmlEmbed: false, - enableYouTubeEmbed: false, + enableYouTubeEmbed: true, + enableVideoEmbed: false, } const icons = { @@ -130,6 +132,7 @@ const calloutLineRegex = new RegExp(/^> *\[\!\w+\][+-]?.*$/, "gm") const tagRegex = new RegExp(/(?:^| )#((?:[-_\p{L}\p{Emoji}\d])+(?:\/[-_\p{L}\p{Emoji}\d]+)*)/, "gu") const blockReferenceRegex = new RegExp(/\^([A-Za-z0-9]+)$/, "g") const ytLinkRegex = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/ +const videoExtensionRegex = new RegExp(/\.(mp4|webm|ogg|avi|mov|flv|wmv|mkv|mpg|mpeg|3gp|m4v)$/) export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin | undefined> = ( userOpts, @@ -346,11 +349,31 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin } }) } - mdastFindReplace(tree, replacements) } }) + if (opts.enableVideoEmbed) { + plugins.push(() => { + return (tree: Root, _file) => { + visit(tree, "image", (node, index, parent) => { + const match = node.url.match(videoExtensionRegex) + if (parent && match) { + const htmlNode: PhrasingContent = { + type: "html", + value: ``, + } + if (index && index >= 0 && index < parent.children.length) { + parent.children.splice(index, 1, htmlNode) + } else { + console.warn("Warning: Invalid index, htmlNode not added") + } + } + }) + } + }) + } + if (opts.callouts) { plugins.push(() => { return (tree: Root, _file) => { From d7d5d8253cb403d32fc8486473f4c2d0c9ca0639 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Wed, 17 Jan 2024 09:45:05 -0800 Subject: [PATCH 17/98] fix: clean up ofm code for video parsing --- quartz/plugins/transformers/ofm.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 8caad979e..76234dde1 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -1,10 +1,10 @@ import { QuartzTransformerPlugin } from "../types" -import { Root, Html, BlockContent, DefinitionContent, Paragraph, Code } from "mdast" +import { Root, Html, Image, BlockContent, DefinitionContent, Paragraph, Code } from "mdast" import { Element, Literal, Root as HtmlRoot } from "hast" import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-find-and-replace" import { slug as slugAnchor } from "github-slugger" import rehypeRaw from "rehype-raw" -import { visit } from "unist-util-visit" +import { SKIP, visit } from "unist-util-visit" import path from "path" import { JSResource } from "../../util/resources" // @ts-ignore @@ -39,7 +39,7 @@ const defaultOptions: Options = { parseBlockReferences: true, enableInHtmlEmbed: false, enableYouTubeEmbed: true, - enableVideoEmbed: false, + enableVideoEmbed: true, } const icons = { @@ -357,17 +357,15 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin plugins.push(() => { return (tree: Root, _file) => { visit(tree, "image", (node, index, parent) => { - const match = node.url.match(videoExtensionRegex) - if (parent && match) { - const htmlNode: PhrasingContent = { + if (parent && index != undefined && videoExtensionRegex.test(node.url)) { + console.log("replacin") + const newNode: Html = { type: "html", - value: ``, - } - if (index && index >= 0 && index < parent.children.length) { - parent.children.splice(index, 1, htmlNode) - } else { - console.warn("Warning: Invalid index, htmlNode not added") + value: ``, } + + parent.children.splice(index, 1, newNode) + return SKIP } }) } From 129e0c60a99dd7ddd1bd44f9833a0e153b7c0c21 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Wed, 17 Jan 2024 09:46:01 -0800 Subject: [PATCH 18/98] fix: remove extra console log --- quartz/plugins/transformers/ofm.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 76234dde1..e1a719c6f 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -358,7 +358,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin return (tree: Root, _file) => { visit(tree, "image", (node, index, parent) => { if (parent && index != undefined && videoExtensionRegex.test(node.url)) { - console.log("replacin") const newNode: Html = { type: "html", value: ``, From af811d824fa526f5a8d48b7f4cfd718ade91385e Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Wed, 17 Jan 2024 20:03:14 -0800 Subject: [PATCH 19/98] style: make internal link have less visual padding (closes #706) --- quartz/styles/base.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 68ee11136..8fb464df1 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -70,6 +70,7 @@ a { background-color: var(--highlight); padding: 0 0.1rem; border-radius: 5px; + line-height: 1.4rem; &:has(> img) { background-color: none; From ce3dd0923b93e8c1cbe95fe584418d6ee5dcba69 Mon Sep 17 00:00:00 2001 From: kabirgh <15871468+kabirgh@users.noreply.github.com> Date: Thu, 18 Jan 2024 18:56:14 +0000 Subject: [PATCH 20/98] refactor: move emit from callback to helper file function (#704) * Change emit from callback to helpers file function * Update docs, remove commented code, improve type sig --- docs/advanced/making plugins.md | 15 ++++++--------- quartz/plugins/emitters/404.tsx | 6 ++++-- quartz/plugins/emitters/aliases.ts | 7 +++++-- quartz/plugins/emitters/assets.ts | 2 +- quartz/plugins/emitters/cname.ts | 2 +- quartz/plugins/emitters/componentResources.ts | 16 ++++++++++------ quartz/plugins/emitters/contentIndex.ts | 12 ++++++++---- quartz/plugins/emitters/contentPage.tsx | 6 ++++-- quartz/plugins/emitters/folderPage.tsx | 6 ++++-- quartz/plugins/emitters/helpers.ts | 19 +++++++++++++++++++ quartz/plugins/emitters/static.ts | 2 +- quartz/plugins/emitters/tagPage.tsx | 6 ++++-- quartz/plugins/types.ts | 15 +-------------- quartz/processors/emit.ts | 13 +------------ 14 files changed, 69 insertions(+), 58 deletions(-) create mode 100644 quartz/plugins/emitters/helpers.ts diff --git a/docs/advanced/making plugins.md b/docs/advanced/making plugins.md index fcc88a7bc..65209a2ca 100644 --- a/docs/advanced/making plugins.md +++ b/docs/advanced/making plugins.md @@ -216,22 +216,19 @@ export type QuartzEmitterPlugin = ( export type QuartzEmitterPluginInstance = { name: string - emit( - ctx: BuildCtx, - content: ProcessedContent[], - resources: StaticResources, - emitCallback: EmitCallback, - ): Promise + emit(ctx: BuildCtx, content: ProcessedContent[], resources: StaticResources): Promise getQuartzComponents(ctx: BuildCtx): QuartzComponent[] } ``` -An emitter plugin must define a `name` field an `emit` function and a `getQuartzComponents` function. `emit` is responsible for looking at all the parsed and filtered content and then appropriately creating files and returning a list of paths to files the plugin created. +An emitter plugin must define a `name` field, an `emit` function, and a `getQuartzComponents` function. `emit` is responsible for looking at all the parsed and filtered content and then appropriately creating files and returning a list of paths to files the plugin created. -Creating new files can be done via regular Node [fs module](https://nodejs.org/api/fs.html) (i.e. `fs.cp` or `fs.writeFile`) or via the `emitCallback` if you are creating files that contain text. The `emitCallback` function is the 4th argument of the emit function. Its interface looks something like this: +Creating new files can be done via regular Node [fs module](https://nodejs.org/api/fs.html) (i.e. `fs.cp` or `fs.writeFile`) or via the `write` function in `quartz/plugins/emitters/helpers.ts` if you are creating files that contain text. `write` has the following signature: ```ts -export type EmitCallback = (data: { +export type WriteOptions = (data: { + // the build context + ctx: BuildCtx // the name of the file to emit (not including the file extension) slug: ServerSlug // the file extension diff --git a/quartz/plugins/emitters/404.tsx b/quartz/plugins/emitters/404.tsx index cd079a065..58ae59a4b 100644 --- a/quartz/plugins/emitters/404.tsx +++ b/quartz/plugins/emitters/404.tsx @@ -7,6 +7,7 @@ import { FilePath, FullSlug } from "../../util/path" import { sharedPageComponents } from "../../../quartz.layout" import { NotFound } from "../../components" import { defaultProcessedContent } from "../vfile" +import { write } from "./helpers" export const NotFoundPage: QuartzEmitterPlugin = () => { const opts: FullPageLayout = { @@ -25,7 +26,7 @@ export const NotFoundPage: QuartzEmitterPlugin = () => { getQuartzComponents() { return [Head, Body, pageBody, Footer] }, - async emit(ctx, _content, resources, emit): Promise { + async emit(ctx, _content, resources): Promise { const cfg = ctx.cfg.configuration const slug = "404" as FullSlug @@ -48,7 +49,8 @@ export const NotFoundPage: QuartzEmitterPlugin = () => { } return [ - await emit({ + await write({ + ctx, content: renderPage(slug, componentData, opts, externalResources), slug, ext: ".html", diff --git a/quartz/plugins/emitters/aliases.ts b/quartz/plugins/emitters/aliases.ts index 210715eb4..118c3926e 100644 --- a/quartz/plugins/emitters/aliases.ts +++ b/quartz/plugins/emitters/aliases.ts @@ -1,13 +1,15 @@ import { FilePath, FullSlug, joinSegments, resolveRelative, simplifySlug } from "../../util/path" import { QuartzEmitterPlugin } from "../types" import path from "path" +import { write } from "./helpers" export const AliasRedirects: QuartzEmitterPlugin = () => ({ name: "AliasRedirects", getQuartzComponents() { return [] }, - async emit({ argv }, content, _resources, emit): Promise { + async emit(ctx, content, _resources): Promise { + const { argv } = ctx const fps: FilePath[] = [] for (const [_tree, file] of content) { @@ -32,7 +34,8 @@ export const AliasRedirects: QuartzEmitterPlugin = () => ({ } const redirUrl = resolveRelative(slug, file.data.slug!) - const fp = await emit({ + const fp = await write({ + ctx, content: ` diff --git a/quartz/plugins/emitters/assets.ts b/quartz/plugins/emitters/assets.ts index edc22d9e9..cc97b2e3e 100644 --- a/quartz/plugins/emitters/assets.ts +++ b/quartz/plugins/emitters/assets.ts @@ -10,7 +10,7 @@ export const Assets: QuartzEmitterPlugin = () => { getQuartzComponents() { return [] }, - async emit({ argv, cfg }, _content, _resources, _emit): Promise { + async emit({ argv, cfg }, _content, _resources): Promise { // glob all non MD/MDX/HTML files in content folder and copy it over const assetsPath = argv.output const fps = await glob("**", argv.directory, ["**/*.md", ...cfg.configuration.ignorePatterns]) diff --git a/quartz/plugins/emitters/cname.ts b/quartz/plugins/emitters/cname.ts index ffe2c6d12..3e17fea2e 100644 --- a/quartz/plugins/emitters/cname.ts +++ b/quartz/plugins/emitters/cname.ts @@ -13,7 +13,7 @@ export const CNAME: QuartzEmitterPlugin = () => ({ getQuartzComponents() { return [] }, - async emit({ argv, cfg }, _content, _resources, _emit): Promise { + async emit({ argv, cfg }, _content, _resources): Promise { if (!cfg.configuration.baseUrl) { console.warn(chalk.yellow("CNAME emitter requires `baseUrl` to be set in your configuration")) return [] diff --git a/quartz/plugins/emitters/componentResources.ts b/quartz/plugins/emitters/componentResources.ts index e8a81bc0b..f92c0a9b8 100644 --- a/quartz/plugins/emitters/componentResources.ts +++ b/quartz/plugins/emitters/componentResources.ts @@ -13,6 +13,7 @@ import { QuartzComponent } from "../../components/types" import { googleFontHref, joinStyles } from "../../util/theme" import { Features, transform } from "lightningcss" import { transform as transpile } from "esbuild" +import { write } from "./helpers" type ComponentResources = { css: string[] @@ -93,7 +94,7 @@ function addGlobalPageResources( function gtag() { dataLayer.push(arguments); } gtag("js", new Date()); gtag("config", "${tagId}", { send_page_view: false }); - + document.addEventListener("nav", () => { gtag("event", "page_view", { page_title: document.title, @@ -121,7 +122,7 @@ function addGlobalPageResources( umamiScript.src = "https://analytics.umami.is/script.js" umamiScript.setAttribute("data-website-id", "${cfg.analytics.websiteId}") umamiScript.async = true - + document.head.appendChild(umamiScript) `) } @@ -168,7 +169,7 @@ export const ComponentResources: QuartzEmitterPlugin = (opts?: Partial< getQuartzComponents() { return [] }, - async emit(ctx, _content, resources, emit): Promise { + async emit(ctx, _content, resources): Promise { // component specific scripts and styles const componentResources = getComponentResources(ctx) // important that this goes *after* component scripts @@ -190,7 +191,8 @@ export const ComponentResources: QuartzEmitterPlugin = (opts?: Partial< ]) const fps = await Promise.all([ - emit({ + write({ + ctx, slug: "index" as FullSlug, ext: ".css", content: transform({ @@ -207,12 +209,14 @@ export const ComponentResources: QuartzEmitterPlugin = (opts?: Partial< include: Features.MediaQueries, }).code.toString(), }), - emit({ + write({ + ctx, slug: "prescript" as FullSlug, ext: ".js", content: prescript, }), - emit({ + write({ + ctx, slug: "postscript" as FullSlug, ext: ".js", content: postscript, diff --git a/quartz/plugins/emitters/contentIndex.ts b/quartz/plugins/emitters/contentIndex.ts index fa8c2c9d4..31e1d3e2a 100644 --- a/quartz/plugins/emitters/contentIndex.ts +++ b/quartz/plugins/emitters/contentIndex.ts @@ -6,6 +6,7 @@ import { FilePath, FullSlug, SimpleSlug, joinSegments, simplifySlug } from "../. import { QuartzEmitterPlugin } from "../types" import { toHtml } from "hast-util-to-html" import path from "path" +import { write } from "./helpers" export type ContentIndex = Map export type ContentDetails = { @@ -91,7 +92,7 @@ export const ContentIndex: QuartzEmitterPlugin> = (opts) => { opts = { ...defaultOptions, ...opts } return { name: "ContentIndex", - async emit(ctx, content, _resources, emit) { + async emit(ctx, content, _resources) { const cfg = ctx.cfg.configuration const emitted: FilePath[] = [] const linkIndex: ContentIndex = new Map() @@ -115,7 +116,8 @@ export const ContentIndex: QuartzEmitterPlugin> = (opts) => { if (opts?.enableSiteMap) { emitted.push( - await emit({ + await write({ + ctx, content: generateSiteMap(cfg, linkIndex), slug: "sitemap" as FullSlug, ext: ".xml", @@ -125,7 +127,8 @@ export const ContentIndex: QuartzEmitterPlugin> = (opts) => { if (opts?.enableRSS) { emitted.push( - await emit({ + await write({ + ctx, content: generateRSSFeed(cfg, linkIndex, opts.rssLimit), slug: "index" as FullSlug, ext: ".xml", @@ -146,7 +149,8 @@ export const ContentIndex: QuartzEmitterPlugin> = (opts) => { ) emitted.push( - await emit({ + await write({ + ctx, content: JSON.stringify(simplifiedIndex), slug: fp, ext: ".json", diff --git a/quartz/plugins/emitters/contentPage.tsx b/quartz/plugins/emitters/contentPage.tsx index 338bfae44..f8e640473 100644 --- a/quartz/plugins/emitters/contentPage.tsx +++ b/quartz/plugins/emitters/contentPage.tsx @@ -8,6 +8,7 @@ import { FilePath, pathToRoot } from "../../util/path" import { defaultContentPageLayout, sharedPageComponents } from "../../../quartz.layout" import { Content } from "../../components" import chalk from "chalk" +import { write } from "./helpers" export const ContentPage: QuartzEmitterPlugin> = (userOpts) => { const opts: FullPageLayout = { @@ -26,7 +27,7 @@ export const ContentPage: QuartzEmitterPlugin> = (userOp getQuartzComponents() { return [Head, Header, Body, ...header, ...beforeBody, pageBody, ...left, ...right, Footer] }, - async emit(ctx, content, resources, emit): Promise { + async emit(ctx, content, resources): Promise { const cfg = ctx.cfg.configuration const fps: FilePath[] = [] const allFiles = content.map((c) => c[1].data) @@ -49,7 +50,8 @@ export const ContentPage: QuartzEmitterPlugin> = (userOp } const content = renderPage(slug, componentData, opts, externalResources) - const fp = await emit({ + const fp = await write({ + ctx, content, slug, ext: ".html", diff --git a/quartz/plugins/emitters/folderPage.tsx b/quartz/plugins/emitters/folderPage.tsx index 8632eceb4..a4bd1aed2 100644 --- a/quartz/plugins/emitters/folderPage.tsx +++ b/quartz/plugins/emitters/folderPage.tsx @@ -17,6 +17,7 @@ import { } from "../../util/path" import { defaultListPageLayout, sharedPageComponents } from "../../../quartz.layout" import { FolderContent } from "../../components" +import { write } from "./helpers" export const FolderPage: QuartzEmitterPlugin = (userOpts) => { const opts: FullPageLayout = { @@ -35,7 +36,7 @@ export const FolderPage: QuartzEmitterPlugin = (userOpts) => { getQuartzComponents() { return [Head, Header, Body, ...header, ...beforeBody, pageBody, ...left, ...right, Footer] }, - async emit(ctx, content, resources, emit): Promise { + async emit(ctx, content, resources): Promise { const fps: FilePath[] = [] const allFiles = content.map((c) => c[1].data) const cfg = ctx.cfg.configuration @@ -82,7 +83,8 @@ export const FolderPage: QuartzEmitterPlugin = (userOpts) => { } const content = renderPage(slug, componentData, opts, externalResources) - const fp = await emit({ + const fp = await write({ + ctx, content, slug, ext: ".html", diff --git a/quartz/plugins/emitters/helpers.ts b/quartz/plugins/emitters/helpers.ts new file mode 100644 index 000000000..ef1d1c35c --- /dev/null +++ b/quartz/plugins/emitters/helpers.ts @@ -0,0 +1,19 @@ +import path from "path" +import fs from "fs" +import { BuildCtx } from "../../util/ctx" +import { FilePath, FullSlug, joinSegments } from "../../util/path" + +type WriteOptions = { + ctx: BuildCtx + slug: FullSlug + ext: `.${string}` | "" + content: string +} + +export const write = async ({ ctx, slug, ext, content }: WriteOptions): Promise => { + const pathToPage = joinSegments(ctx.argv.output, slug + ext) as FilePath + const dir = path.dirname(pathToPage) + await fs.promises.mkdir(dir, { recursive: true }) + await fs.promises.writeFile(pathToPage, content) + return pathToPage +} diff --git a/quartz/plugins/emitters/static.ts b/quartz/plugins/emitters/static.ts index f0118e2e8..9f93d9b0a 100644 --- a/quartz/plugins/emitters/static.ts +++ b/quartz/plugins/emitters/static.ts @@ -8,7 +8,7 @@ export const Static: QuartzEmitterPlugin = () => ({ getQuartzComponents() { return [] }, - async emit({ argv, cfg }, _content, _resources, _emit): Promise { + async emit({ argv, cfg }, _content, _resources): Promise { const staticPath = joinSegments(QUARTZ, "static") const fps = await glob("**", staticPath, cfg.configuration.ignorePatterns) await fs.promises.cp(staticPath, joinSegments(argv.output, "static"), { diff --git a/quartz/plugins/emitters/tagPage.tsx b/quartz/plugins/emitters/tagPage.tsx index 566911983..56a552c69 100644 --- a/quartz/plugins/emitters/tagPage.tsx +++ b/quartz/plugins/emitters/tagPage.tsx @@ -14,6 +14,7 @@ import { } from "../../util/path" import { defaultListPageLayout, sharedPageComponents } from "../../../quartz.layout" import { TagContent } from "../../components" +import { write } from "./helpers" export const TagPage: QuartzEmitterPlugin = (userOpts) => { const opts: FullPageLayout = { @@ -32,7 +33,7 @@ export const TagPage: QuartzEmitterPlugin = (userOpts) => { getQuartzComponents() { return [Head, Header, Body, ...header, ...beforeBody, pageBody, ...left, ...right, Footer] }, - async emit(ctx, content, resources, emit): Promise { + async emit(ctx, content, resources): Promise { const fps: FilePath[] = [] const allFiles = content.map((c) => c[1].data) const cfg = ctx.cfg.configuration @@ -81,7 +82,8 @@ export const TagPage: QuartzEmitterPlugin = (userOpts) => { } const content = renderPage(slug, componentData, opts, externalResources) - const fp = await emit({ + const fp = await write({ + ctx, content, slug: file.data.slug!, ext: ".html", diff --git a/quartz/plugins/types.ts b/quartz/plugins/types.ts index eaeb12aec..bf1c0db0e 100644 --- a/quartz/plugins/types.ts +++ b/quartz/plugins/types.ts @@ -36,19 +36,6 @@ export type QuartzEmitterPlugin = ( ) => QuartzEmitterPluginInstance export type QuartzEmitterPluginInstance = { name: string - emit( - ctx: BuildCtx, - content: ProcessedContent[], - resources: StaticResources, - emitCallback: EmitCallback, - ): Promise + emit(ctx: BuildCtx, content: ProcessedContent[], resources: StaticResources): Promise getQuartzComponents(ctx: BuildCtx): QuartzComponent[] } - -export interface EmitOptions { - slug: FullSlug - ext: `.${string}` | "" - content: string -} - -export type EmitCallback = (data: EmitOptions) => Promise diff --git a/quartz/processors/emit.ts b/quartz/processors/emit.ts index 3b357aa94..c68e0edeb 100644 --- a/quartz/processors/emit.ts +++ b/quartz/processors/emit.ts @@ -1,10 +1,6 @@ -import path from "path" -import fs from "fs" import { PerfTimer } from "../util/perf" import { getStaticResourcesFromPlugins } from "../plugins" -import { EmitCallback } from "../plugins/types" import { ProcessedContent } from "../plugins/vfile" -import { FilePath, joinSegments } from "../util/path" import { QuartzLogger } from "../util/log" import { trace } from "../util/trace" import { BuildCtx } from "../util/ctx" @@ -15,19 +11,12 @@ export async function emitContent(ctx: BuildCtx, content: ProcessedContent[]) { const log = new QuartzLogger(ctx.argv.verbose) log.start(`Emitting output files`) - const emit: EmitCallback = async ({ slug, ext, content }) => { - const pathToPage = joinSegments(argv.output, slug + ext) as FilePath - const dir = path.dirname(pathToPage) - await fs.promises.mkdir(dir, { recursive: true }) - await fs.promises.writeFile(pathToPage, content) - return pathToPage - } let emittedFiles = 0 const staticResources = getStaticResourcesFromPlugins(ctx) for (const emitter of cfg.plugins.emitters) { try { - const emitted = await emitter.emit(ctx, content, staticResources, emit) + const emitted = await emitter.emit(ctx, content, staticResources) emittedFiles += emitted.length if (ctx.argv.verbose) { From 1f2ea96ae0700f1cd4267f9bac7a59a8962f961f Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 20 Jan 2024 00:33:08 -0800 Subject: [PATCH 21/98] fix: allow dashes and underscores in block references (closes #712) --- quartz/plugins/transformers/ofm.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index e1a719c6f..8c6f48890 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -130,7 +130,7 @@ const calloutLineRegex = new RegExp(/^> *\[\!\w+\][+-]?.*$/, "gm") // (?:[-_\p{L}\d\p{Z}])+ -> non-capturing group, non-empty string of (Unicode-aware) alpha-numeric characters and symbols, hyphens and/or underscores // (?:\/[-_\p{L}\d\p{Z}]+)*) -> non-capturing group, matches an arbitrary number of tag strings separated by "/" const tagRegex = new RegExp(/(?:^| )#((?:[-_\p{L}\p{Emoji}\d])+(?:\/[-_\p{L}\p{Emoji}\d]+)*)/, "gu") -const blockReferenceRegex = new RegExp(/\^([A-Za-z0-9]+)$/, "g") +const blockReferenceRegex = new RegExp(/\^([-_A-Za-z0-9]+)$/, "g") const ytLinkRegex = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/ const videoExtensionRegex = new RegExp(/\.(mp4|webm|ogg|avi|mov|flv|wmv|mkv|mpg|mpeg|3gp|m4v)$/) From c11395e7bcd75eef37b4f4e9c67dc9c6f912c0b7 Mon Sep 17 00:00:00 2001 From: LUCASTUCIOUS Date: Sat, 20 Jan 2024 22:18:35 +0100 Subject: [PATCH 22/98] feat: Add an option to display or not reading time from notes (#707) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add an option to display or not reading time from notes * Prettier (?) * Remove ContentMeta override from quartz.layout.ts * Make it positive ! 🌞 * Update quartz/components/ContentMeta.tsx --------- Co-authored-by: Jacky Zhao --- quartz/components/ContentMeta.tsx | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/quartz/components/ContentMeta.tsx b/quartz/components/ContentMeta.tsx index 21dc13f95..254c5d405 100644 --- a/quartz/components/ContentMeta.tsx +++ b/quartz/components/ContentMeta.tsx @@ -2,18 +2,37 @@ import { formatDate, getDate } from "./Date" import { QuartzComponentConstructor, QuartzComponentProps } from "./types" import readingTime from "reading-time" -export default (() => { +interface ContentMetaOptions { + /** + * Whether to display reading time + */ + showReadingTime: boolean +} + +const defaultOptions: ContentMetaOptions = { + showReadingTime: true, +} + +export default ((opts?: Partial) => { + // Merge options with defaults + const options: ContentMetaOptions = { ...defaultOptions, ...opts } + function ContentMetadata({ cfg, fileData, displayClass }: QuartzComponentProps) { const text = fileData.text + if (text) { const segments: string[] = [] - const { text: timeTaken, words: _words } = readingTime(text) if (fileData.dates) { segments.push(formatDate(getDate(cfg, fileData)!)) } - segments.push(timeTaken) + // Display reading time if enabled + if (options.showReadingTime) { + const { text: timeTaken, words: _words } = readingTime(text) + segments.push(timeTaken) + } + return {segments.join(", ")} } else { return null From 4d338cec137a30fdc00771235f75d46fed878002 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Sun, 21 Jan 2024 14:33:32 -0500 Subject: [PATCH 23/98] feat(ofm): add options to parse arrows (#713) * feat(ofm): add options to parse arrows Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * feat(ofm): add options to parse arrows Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --------- Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- docs/features/Obsidian compatibility.md | 1 + quartz/plugins/transformers/ofm.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/docs/features/Obsidian compatibility.md b/docs/features/Obsidian compatibility.md index d519e1779..1254370e0 100644 --- a/docs/features/Obsidian compatibility.md +++ b/docs/features/Obsidian compatibility.md @@ -25,6 +25,7 @@ Finally, Quartz also provides `Plugin.CrawlLinks` which allows you to customize - `callouts`: whether to enable [[callouts]]. Defaults to `true` - `mermaid`: whether to enable [[Mermaid diagrams]]. Defaults to `true` - `parseTags`: whether to try and parse tags in the content body. Defaults to `true` + - `parseArrows`: whether to try and parse arrows in the content body. Defaults to `true`. - `enableInHtmlEmbed`: whether to try and parse Obsidian flavoured markdown in raw HTML. Defaults to `false` - `enableYouTubeEmbed`: whether to enable embedded YouTube videos using external image Markdown syntax. Defaults to `false` - Link resolution behaviour: diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 8c6f48890..e1f7651bd 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -23,6 +23,7 @@ export interface Options { callouts: boolean mermaid: boolean parseTags: boolean + parseArrows: boolean parseBlockReferences: boolean enableInHtmlEmbed: boolean enableYouTubeEmbed: boolean @@ -36,6 +37,7 @@ const defaultOptions: Options = { callouts: true, mermaid: true, parseTags: true, + parseArrows: true, parseBlockReferences: true, enableInHtmlEmbed: false, enableYouTubeEmbed: true, @@ -111,6 +113,8 @@ function canonicalizeCallout(calloutName: string): keyof typeof callouts { export const externalLinkRegex = /^https?:\/\//i +export const arrowRegex = new RegExp(/-{1,2}>/, "g") + // !? -> optional embedding // \[\[ -> open brace // ([^\[\]\|\#]+) -> one or more non-special characters ([,],|, or #) (name) @@ -294,6 +298,18 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin ]) } + if (opts.parseArrows) { + replacements.push([ + arrowRegex, + (_value: string, ..._capture: string[]) => { + return { + type: "html", + value: `→`, + } + }, + ]) + } + if (opts.parseTags) { replacements.push([ tagRegex, From 015b4f6a15da3b81f9e3ad004aa24636ab3882ed Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 21 Jan 2024 12:39:15 -0800 Subject: [PATCH 24/98] fix: remove quartz 3 references, update font style in popovers --- README.md | 2 -- docs/index.md | 3 --- quartz/components/styles/popover.scss | 1 + 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 4b4731c9b..27d6dbdb0 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ Quartz is a set of tools that helps you publish your [digital garden](https://jzhao.xyz/posts/networked-thought) and notes as a website for free. Quartz v4 features a from-the-ground rewrite focusing on end-user extensibility and ease-of-use. -**If you are looking for Quartz v3, you can find it on the [`hugo` branch](https://github.com/jackyzha0/quartz/tree/hugo).** - 🔗 Read the documentation and get started: https://quartz.jzhao.xyz/ [Join the Discord Community](https://discord.gg/cRFFHYye7t) diff --git a/docs/index.md b/docs/index.md index 655f5c39b..7804ac6ba 100644 --- a/docs/index.md +++ b/docs/index.md @@ -25,9 +25,6 @@ This will guide you through initializing your Quartz with content. Once you've d 4. [[build|Build and preview]] Quartz 5. [[hosting|Host]] Quartz online -> [!info] -> Coming from Quartz 3? See the [[migrating from Quartz 3|migration guide]] for the differences between Quartz 3 and Quartz 4 and how to migrate. - ## 🔧 Features - [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], and [many more](./features) right out of the box diff --git a/quartz/components/styles/popover.scss b/quartz/components/styles/popover.scss index fae0e121b..e46292a21 100644 --- a/quartz/components/styles/popover.scss +++ b/quartz/components/styles/popover.scss @@ -26,6 +26,7 @@ max-height: 20rem; padding: 0 1rem 1rem 1rem; font-weight: initial; + font-style: initial; line-height: normal; font-size: initial; font-family: var(--bodyFont); From 0403fa70aa24cd3c16fbd9caf434cdcd277f1a14 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Sun, 21 Jan 2024 23:50:00 -0500 Subject: [PATCH 25/98] fix(search): use anchor element (closes #698) (#717) * fix(search): use anchor element This addresses #698 to allow search title to include links for SPA Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * fix: formatter Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * chore: move itemTile to `a` Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * chore: remove nested a title Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * chore(search): remove spaNavigate since now searchResult is an `a` item Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --------- Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- quartz/components/scripts/search.inline.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts index 11e1c0da8..ab76b5f4d 100644 --- a/quartz/components/scripts/search.inline.ts +++ b/quartz/components/scripts/search.inline.ts @@ -222,16 +222,16 @@ document.addEventListener("nav", async (e: unknown) => { const resultToHTML = ({ slug, title, content, tags }: Item) => { const htmlTags = tags.length > 0 ? `${tags.join("")}` : `` - const button = document.createElement("button") - button.classList.add("result-card") - button.id = slug - button.innerHTML = `${title}${htmlTags}${content}` - button.addEventListener("click", () => { - const targ = resolveRelative(currentSlug, slug) - window.spaNavigate(new URL(targ, window.location.toString())) + const itemTile = document.createElement("a") + itemTile.classList.add("result-card") + itemTile.id = slug + itemTile.href = new URL(resolveRelative(currentSlug, slug), location.toString()).toString() + itemTile.innerHTML = `${title}${htmlTags}${content}` + itemTile.addEventListener("click", (event) => { + if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return hideSearch() }) - return button + return itemTile } function displayResults(finalResults: Item[]) { From 273931d25c73932abe810c97ecb424a387ada065 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 21 Jan 2024 21:14:12 -0800 Subject: [PATCH 26/98] fix: breadcrumbs on non-folder pages --- quartz/components/Breadcrumbs.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/quartz/components/Breadcrumbs.tsx b/quartz/components/Breadcrumbs.tsx index 0497b6458..182d9d62c 100644 --- a/quartz/components/Breadcrumbs.tsx +++ b/quartz/components/Breadcrumbs.tsx @@ -69,9 +69,9 @@ export default ((opts?: Partial) => { for (const file of allFiles) { if (file.slug?.endsWith("index")) { const folderParts = file.slug?.split("/") - if (folderParts) { - // 2nd last to exclude the /index - const folderName = folderParts[folderParts?.length - 2] + // 2nd last to exclude the /index + const folderName = folderParts?.at(-2) + if (folderName) { folderIndex.set(folderName, file) } } @@ -104,13 +104,14 @@ export default ((opts?: Partial) => { } // Add current file to crumb (can directly use frontmatter title) - if (options.showCurrentPage && slugParts.at(-1) === "") { + if (options.showCurrentPage && slugParts.at(-1) !== "index") { crumbs.push({ displayName: fileData.frontmatter!.title, path: "", }) } } + return ( {crumbs.map((crumb, index) => ( From cd826fb4774795004bfba1b5edd0f2fc8b4b435c Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 22 Jan 2024 10:03:59 -0800 Subject: [PATCH 27/98] fix: process comments at a text level rather than a markdown level --- quartz/plugins/transformers/ofm.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index e1f7651bd..74a45237f 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -163,6 +163,14 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin }) } + // do comments at text level + if (opts.comments) { + if (src instanceof Buffer) { + src = src.toString() + } + src.replace(commentRegex, "") + } + // pre-transform wikilinks (fix anchors to things that may contain illegal syntax e.g. codeblocks, latex) if (opts.wikilinks) { if (src instanceof Buffer) { @@ -286,18 +294,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin ]) } - if (opts.comments) { - replacements.push([ - commentRegex, - (_value: string, ..._capture: string[]) => { - return { - type: "text", - value: "", - } - }, - ]) - } - if (opts.parseArrows) { replacements.push([ arrowRegex, From 2c8d0f8ab60cbf2e5e5338709e63267d466fb068 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 22 Jan 2024 10:29:57 -0800 Subject: [PATCH 28/98] fix: more robust ofm comment handling --- quartz/plugins/transformers/ofm.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 74a45237f..c06729676 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -1,5 +1,5 @@ import { QuartzTransformerPlugin } from "../types" -import { Root, Html, Image, BlockContent, DefinitionContent, Paragraph, Code } from "mdast" +import { Root, Html, BlockContent, DefinitionContent, Paragraph, Code } from "mdast" import { Element, Literal, Root as HtmlRoot } from "hast" import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-find-and-replace" import { slug as slugAnchor } from "github-slugger" @@ -125,7 +125,7 @@ export const wikilinkRegex = new RegExp( "g", ) const highlightRegex = new RegExp(/==([^=]+)==/, "g") -const commentRegex = new RegExp(/%%(.+)%%/, "g") +const commentRegex = new RegExp(/%%[\s\S]*?%%/, "g") // from https://github.com/escwxyz/remark-obsidian-callout/blob/main/src/index.ts const calloutRegex = new RegExp(/^\[\!(\w+)\]([+-]?)/) const calloutLineRegex = new RegExp(/^> *\[\!\w+\][+-]?.*$/, "gm") @@ -151,6 +151,15 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin return { name: "ObsidianFlavoredMarkdown", textTransform(_ctx, src) { + // do comments at text level + if (opts.comments) { + if (src instanceof Buffer) { + src = src.toString() + } + + src = src.replace(commentRegex, "") + } + // pre-transform blockquotes if (opts.callouts) { if (src instanceof Buffer) { @@ -163,14 +172,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin }) } - // do comments at text level - if (opts.comments) { - if (src instanceof Buffer) { - src = src.toString() - } - src.replace(commentRegex, "") - } - // pre-transform wikilinks (fix anchors to things that may contain illegal syntax e.g. codeblocks, latex) if (opts.wikilinks) { if (src instanceof Buffer) { From 4edd27d3f9510745ceee52a3e37409d8f943e5f2 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 22 Jan 2024 10:48:23 -0800 Subject: [PATCH 29/98] fix: font weight in search --- quartz/components/styles/search.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quartz/components/styles/search.scss b/quartz/components/styles/search.scss index 66f809f97..09bdb4e77 100644 --- a/quartz/components/styles/search.scss +++ b/quartz/components/styles/search.scss @@ -95,7 +95,7 @@ border-bottom: none; width: 100%; - // normalize button props + // normalize card props font-family: inherit; font-size: 100%; line-height: 1.15; @@ -104,6 +104,7 @@ text-align: left; background: var(--light); outline: none; + font-weight: inherit; & .highlight { color: var(--secondary); From 7ca491bc1d918e86a97f27597389e269bae523db Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 22 Jan 2024 10:55:15 -0800 Subject: [PATCH 30/98] fix: add polyfill for broken tabindex on mac --- quartz/components/scripts/search.inline.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts index ab76b5f4d..ce1a28329 100644 --- a/quartz/components/scripts/search.inline.ts +++ b/quartz/components/scripts/search.inline.ts @@ -134,7 +134,14 @@ document.addEventListener("nav", async (e: unknown) => { const anchor = document.getElementsByClassName("result-card")[0] as HTMLInputElement | null anchor?.click() } - } else if (e.key === "ArrowDown") { + } else if (e.key === "ArrowUp" || (e.shiftKey && e.key === "Tab")) { + e.preventDefault() + if (results?.contains(document.activeElement)) { + // If an element in results-container already has focus, focus previous one + const prevResult = document.activeElement?.previousElementSibling as HTMLInputElement | null + prevResult?.focus() + } + } else if (e.key === "ArrowDown" || e.key === "Tab") { e.preventDefault() // When first pressing ArrowDown, results wont contain the active element, so focus first element if (!results?.contains(document.activeElement)) { @@ -145,13 +152,6 @@ document.addEventListener("nav", async (e: unknown) => { const nextResult = document.activeElement?.nextElementSibling as HTMLInputElement | null nextResult?.focus() } - } else if (e.key === "ArrowUp") { - e.preventDefault() - if (results?.contains(document.activeElement)) { - // If an element in results-container already has focus, focus previous one - const prevResult = document.activeElement?.previousElementSibling as HTMLInputElement | null - prevResult?.focus() - } } } From c9ac2a7507e42041fefe337f9328e6dc1281a9ff Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 22 Jan 2024 10:56:58 -0800 Subject: [PATCH 31/98] pkg: bump to 4.1.5 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73531b4b9..7e135f1a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jackyzha0/quartz", - "version": "4.1.4", + "version": "4.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jackyzha0/quartz", - "version": "4.1.4", + "version": "4.1.5", "license": "MIT", "dependencies": { "@clack/prompts": "^0.7.0", diff --git a/package.json b/package.json index bb79280d8..ea7629241 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@jackyzha0/quartz", "description": "🌱 publish your digital garden and notes as a website", "private": true, - "version": "4.1.4", + "version": "4.1.5", "type": "module", "author": "jackyzha0 ", "license": "MIT", From eb302c05b8044ccbe862a962268201db58b4423e Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:53:28 -0500 Subject: [PATCH 32/98] fix(search): update no results to be `a` (#721) Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- quartz/components/scripts/search.inline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts index ce1a28329..df21f6b35 100644 --- a/quartz/components/scripts/search.inline.ts +++ b/quartz/components/scripts/search.inline.ts @@ -239,10 +239,10 @@ document.addEventListener("nav", async (e: unknown) => { removeAllChildren(results) if (finalResults.length === 0) { - results.innerHTML = ` + results.innerHTML = ` No results. Try another search term? - ` + ` } else { results.append(...finalResults.map(resultToHTML)) } From 1ce12fc1fc2327b2cc54a11f67117e35a85f6eca Mon Sep 17 00:00:00 2001 From: kabirgh <15871468+kabirgh@users.noreply.github.com> Date: Tue, 23 Jan 2024 18:55:37 +0000 Subject: [PATCH 33/98] cleanup: Move `rebuild` function outside `startServing` function (#715) * Move rebuild function outside `startServing` * Move toRebuild and toRemove inside rebuild func * Revert "Move toRebuild and toRemove inside rebuild func" This reverts commit 8c4dbb13c7a670ff8af806e8bfd1ca1aa216073b. * Rename func to rebuildFromEntrypoint --- quartz/build.ts | 208 ++++++++++++++++++++++++++++-------------------- 1 file changed, 123 insertions(+), 85 deletions(-) diff --git a/quartz/build.ts b/quartz/build.ts index 24f049882..b78ff2bc6 100644 --- a/quartz/build.ts +++ b/quartz/build.ts @@ -3,13 +3,13 @@ sourceMapSupport.install(options) import path from "path" import { PerfTimer } from "./util/perf" import { rimraf } from "rimraf" -import { isGitIgnored } from "globby" +import { GlobbyFilterFunction, isGitIgnored } from "globby" import chalk from "chalk" import { parseMarkdown } from "./processors/parse" import { filterContent } from "./processors/filter" import { emitContent } from "./processors/emit" import cfg from "../quartz.config" -import { FilePath, joinSegments, slugifyFilePath } from "./util/path" +import { FilePath, FullSlug, joinSegments, slugifyFilePath } from "./util/path" import chokidar from "chokidar" import { ProcessedContent } from "./plugins/vfile" import { Argv, BuildCtx } from "./util/ctx" @@ -18,6 +18,19 @@ import { trace } from "./util/trace" import { options } from "./util/sourcemap" import { Mutex } from "async-mutex" +type BuildData = { + ctx: BuildCtx + ignored: GlobbyFilterFunction + mut: Mutex + initialSlugs: FullSlug[] + // TODO merge contentMap and trackedAssets + contentMap: Map + trackedAssets: Set + toRebuild: Set + toRemove: Set + lastBuildMs: number +} + async function buildQuartz(argv: Argv, mut: Mutex, clientRefresh: () => void) { const ctx: BuildCtx = { argv, @@ -73,92 +86,22 @@ async function startServing( ) { const { argv } = ctx - const ignored = await isGitIgnored() const contentMap = new Map() for (const content of initialContent) { const [_tree, vfile] = content contentMap.set(vfile.data.filePath!, content) } - const initialSlugs = ctx.allSlugs - let lastBuildMs = 0 - const toRebuild: Set = new Set() - const toRemove: Set = new Set() - const trackedAssets: Set = new Set() - async function rebuild(fp: string, action: "add" | "change" | "delete") { - // don't do anything for gitignored files - if (ignored(fp)) { - return - } - - // dont bother rebuilding for non-content files, just track and refresh - fp = toPosixPath(fp) - const filePath = joinSegments(argv.directory, fp) as FilePath - if (path.extname(fp) !== ".md") { - if (action === "add" || action === "change") { - trackedAssets.add(filePath) - } else if (action === "delete") { - trackedAssets.delete(filePath) - } - clientRefresh() - return - } - - if (action === "add" || action === "change") { - toRebuild.add(filePath) - } else if (action === "delete") { - toRemove.add(filePath) - } - - // debounce rebuilds every 250ms - - const buildStart = new Date().getTime() - lastBuildMs = buildStart - const release = await mut.acquire() - if (lastBuildMs > buildStart) { - release() - return - } - - const perf = new PerfTimer() - console.log(chalk.yellow("Detected change, rebuilding...")) - try { - const filesToRebuild = [...toRebuild].filter((fp) => !toRemove.has(fp)) - - const trackedSlugs = [...new Set([...contentMap.keys(), ...toRebuild, ...trackedAssets])] - .filter((fp) => !toRemove.has(fp)) - .map((fp) => slugifyFilePath(path.posix.relative(argv.directory, fp) as FilePath)) - - ctx.allSlugs = [...new Set([...initialSlugs, ...trackedSlugs])] - const parsedContent = await parseMarkdown(ctx, filesToRebuild) - for (const content of parsedContent) { - const [_tree, vfile] = content - contentMap.set(vfile.data.filePath!, content) - } - - for (const fp of toRemove) { - contentMap.delete(fp) - } - - const parsedFiles = [...contentMap.values()] - const filteredContent = filterContent(ctx, parsedFiles) - - // TODO: we can probably traverse the link graph to figure out what's safe to delete here - // instead of just deleting everything - await rimraf(argv.output) - await emitContent(ctx, filteredContent) - console.log(chalk.green(`Done rebuilding in ${perf.timeSince()}`)) - } catch (err) { - console.log(chalk.yellow(`Rebuild failed. Waiting on a change to fix the error...`)) - if (argv.verbose) { - console.log(chalk.red(err)) - } - } - - release() - clientRefresh() - toRebuild.clear() - toRemove.clear() + const buildData: BuildData = { + ctx, + mut, + contentMap, + ignored: await isGitIgnored(), + initialSlugs: ctx.allSlugs, + toRebuild: new Set(), + toRemove: new Set(), + trackedAssets: new Set(), + lastBuildMs: 0, } const watcher = chokidar.watch(".", { @@ -168,15 +111,110 @@ async function startServing( }) watcher - .on("add", (fp) => rebuild(fp, "add")) - .on("change", (fp) => rebuild(fp, "change")) - .on("unlink", (fp) => rebuild(fp, "delete")) + .on("add", (fp) => rebuildFromEntrypoint(fp, "add", clientRefresh, buildData)) + .on("change", (fp) => rebuildFromEntrypoint(fp, "change", clientRefresh, buildData)) + .on("unlink", (fp) => rebuildFromEntrypoint(fp, "delete", clientRefresh, buildData)) return async () => { await watcher.close() } } +async function rebuildFromEntrypoint( + fp: string, + action: "add" | "change" | "delete", + clientRefresh: () => void, + buildData: BuildData, // note: this function mutates buildData +) { + const { + ctx, + ignored, + mut, + initialSlugs, + contentMap, + toRebuild, + toRemove, + trackedAssets, + lastBuildMs, + } = buildData + + const { argv } = ctx + + // don't do anything for gitignored files + if (ignored(fp)) { + return + } + + // dont bother rebuilding for non-content files, just track and refresh + fp = toPosixPath(fp) + const filePath = joinSegments(argv.directory, fp) as FilePath + if (path.extname(fp) !== ".md") { + if (action === "add" || action === "change") { + trackedAssets.add(filePath) + } else if (action === "delete") { + trackedAssets.delete(filePath) + } + clientRefresh() + return + } + + if (action === "add" || action === "change") { + toRebuild.add(filePath) + } else if (action === "delete") { + toRemove.add(filePath) + } + + // debounce rebuilds every 250ms + + const buildStart = new Date().getTime() + buildData.lastBuildMs = buildStart + const release = await mut.acquire() + if (lastBuildMs > buildStart) { + release() + return + } + + const perf = new PerfTimer() + console.log(chalk.yellow("Detected change, rebuilding...")) + try { + const filesToRebuild = [...toRebuild].filter((fp) => !toRemove.has(fp)) + + const trackedSlugs = [...new Set([...contentMap.keys(), ...toRebuild, ...trackedAssets])] + .filter((fp) => !toRemove.has(fp)) + .map((fp) => slugifyFilePath(path.posix.relative(argv.directory, fp) as FilePath)) + + ctx.allSlugs = [...new Set([...initialSlugs, ...trackedSlugs])] + const parsedContent = await parseMarkdown(ctx, filesToRebuild) + for (const content of parsedContent) { + const [_tree, vfile] = content + contentMap.set(vfile.data.filePath!, content) + } + + for (const fp of toRemove) { + contentMap.delete(fp) + } + + const parsedFiles = [...contentMap.values()] + const filteredContent = filterContent(ctx, parsedFiles) + + // TODO: we can probably traverse the link graph to figure out what's safe to delete here + // instead of just deleting everything + await rimraf(argv.output) + await emitContent(ctx, filteredContent) + console.log(chalk.green(`Done rebuilding in ${perf.timeSince()}`)) + } catch (err) { + console.log(chalk.yellow(`Rebuild failed. Waiting on a change to fix the error...`)) + if (argv.verbose) { + console.log(chalk.red(err)) + } + } + + release() + clientRefresh() + toRebuild.clear() + toRemove.clear() +} + export default async (argv: Argv, mut: Mutex, clientRefresh: () => void) => { try { return await buildQuartz(argv, mut, clientRefresh) From 0a76707062b366af4c6b5e85afb5fcdef6a8196a Mon Sep 17 00:00:00 2001 From: kabirgh <15871468+kabirgh@users.noreply.github.com> Date: Tue, 23 Jan 2024 22:52:41 +0000 Subject: [PATCH 34/98] feat: Emit custom event when theme changes (#723) * Emit custom event when theme changes * Type themechange custom event * Update darkmode docs --- docs/features/darkmode.md | 9 +++++++++ index.d.ts | 1 + quartz/components/scripts/darkmode.inline.ts | 19 ++++++++++++------- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/docs/features/darkmode.md b/docs/features/darkmode.md index dfa231409..dff75b44d 100644 --- a/docs/features/darkmode.md +++ b/docs/features/darkmode.md @@ -12,3 +12,12 @@ Quartz supports darkmode out of the box that respects the user's theme preferenc - Component: `quartz/components/Darkmode.tsx` - Style: `quartz/components/styles/darkmode.scss` - Script: `quartz/components/scripts/darkmode.inline.ts` + +You can also listen to the `themechange` event to perform any custom logic when the theme changes. + +```js +document.addEventListener("themechange", (e) => { + console.log("Theme changed to " + e.detail.theme) // either "light" or "dark" + // your logic here +}) +``` diff --git a/index.d.ts b/index.d.ts index aec536d25..a6c594fff 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,6 +6,7 @@ declare module "*.scss" { // dom custom event interface CustomEventMap { nav: CustomEvent<{ url: FullSlug }> + themechange: CustomEvent<{ theme: "light" | "dark" }> } declare const fetchData: Promise diff --git a/quartz/components/scripts/darkmode.inline.ts b/quartz/components/scripts/darkmode.inline.ts index c42a367c9..86735e396 100644 --- a/quartz/components/scripts/darkmode.inline.ts +++ b/quartz/components/scripts/darkmode.inline.ts @@ -2,15 +2,19 @@ const userPref = window.matchMedia("(prefers-color-scheme: light)").matches ? "l const currentTheme = localStorage.getItem("theme") ?? userPref document.documentElement.setAttribute("saved-theme", currentTheme) +const emitThemeChangeEvent = (theme: "light" | "dark") => { + const event: CustomEventMap["themechange"] = new CustomEvent("themechange", { + detail: { theme }, + }) + document.dispatchEvent(event) +} + document.addEventListener("nav", () => { const switchTheme = (e: any) => { - if (e.target.checked) { - document.documentElement.setAttribute("saved-theme", "dark") - localStorage.setItem("theme", "dark") - } else { - document.documentElement.setAttribute("saved-theme", "light") - localStorage.setItem("theme", "light") - } + const newTheme = e.target.checked ? "dark" : "light" + document.documentElement.setAttribute("saved-theme", newTheme) + localStorage.setItem("theme", newTheme) + emitThemeChangeEvent(newTheme) } // Darkmode toggle @@ -28,5 +32,6 @@ document.addEventListener("nav", () => { document.documentElement.setAttribute("saved-theme", newTheme) localStorage.setItem("theme", newTheme) toggleSwitch.checked = e.matches + emitThemeChangeEvent(newTheme) }) }) From 5fb203a6dff8bcf238d3926992d621070e2a62b0 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Tue, 23 Jan 2024 14:18:53 -0800 Subject: [PATCH 35/98] fix(style): make a not inline-block --- quartz/styles/base.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 8fb464df1..27bad69ac 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -59,7 +59,6 @@ a { text-decoration: none; transition: color 0.2s ease; color: var(--secondary); - display: inline-block; &:hover { color: var(--tertiary) !important; From fa6c02d3213dfd4e6da8e78bd3a2e7004555fd01 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Tue, 23 Jan 2024 17:08:52 -0800 Subject: [PATCH 36/98] fix: make search result card block --- quartz/components/styles/search.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/quartz/components/styles/search.scss b/quartz/components/styles/search.scss index 09bdb4e77..5fe0aad50 100644 --- a/quartz/components/styles/search.scss +++ b/quartz/components/styles/search.scss @@ -94,6 +94,7 @@ border: 1px solid var(--lightgray); border-bottom: none; width: 100%; + display: block; // normalize card props font-family: inherit; From b22bcd17b4301c6ef398124eec11f6dff0c2d37d Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Tue, 23 Jan 2024 20:20:35 -0800 Subject: [PATCH 37/98] fix: border-box result-card --- quartz/components/styles/search.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/quartz/components/styles/search.scss b/quartz/components/styles/search.scss index 5fe0aad50..d1d271637 100644 --- a/quartz/components/styles/search.scss +++ b/quartz/components/styles/search.scss @@ -95,6 +95,7 @@ border-bottom: none; width: 100%; display: block; + box-sizing: border-box; // normalize card props font-family: inherit; From d5b40279bd12fd527553f53da98f3fd9d85e88d8 Mon Sep 17 00:00:00 2001 From: LUCASTUCIOUS Date: Thu, 25 Jan 2024 08:54:24 +0100 Subject: [PATCH 38/98] feat: Enable custom callout (#724) * Enable custom callout make a callout custom defaulted to a note one. * Add a comment * remove comment from quartz/plugins/transformers/ofm.ts Co-authored-by: Jacky Zhao * Update quartz/plugins/transformers/ofm.ts Co-authored-by: Jacky Zhao --------- Co-authored-by: Jacky Zhao --- quartz/plugins/transformers/ofm.ts | 7 ++++--- quartz/styles/callouts.scss | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index c06729676..f6345c5b5 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -108,7 +108,8 @@ const calloutMapping: Record = { function canonicalizeCallout(calloutName: string): keyof typeof callouts { let callout = calloutName.toLowerCase() as keyof typeof calloutMapping - return calloutMapping[callout] ?? "note" + // if callout is not recognized, make it a custom one + return calloutMapping[callout] ?? calloutName } export const externalLinkRegex = /^https?:\/\//i @@ -431,7 +432,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin value: ` - ${callouts[calloutType]} + ${callouts[calloutType] ?? callouts.note} ${title} ${collapse ? toggleIcon : ""} `, @@ -457,7 +458,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin node.data = { hProperties: { ...(node.data?.hProperties ?? {}), - className: `callout ${collapse ? "is-collapsible" : ""} ${ + className: `callout ${calloutType} ${collapse ? "is-collapsible" : ""} ${ defaultState === "collapsed" ? "is-collapsed" : "" }`, "data-callout": calloutType, diff --git a/quartz/styles/callouts.scss b/quartz/styles/callouts.scss index 703bd67f6..34d3a4560 100644 --- a/quartz/styles/callouts.scss +++ b/quartz/styles/callouts.scss @@ -13,7 +13,7 @@ margin-top: 0; } - &[data-callout="note"] { + &[data-callout] { --color: #448aff; --border: #448aff44; --bg: #448aff10; From d90199c8dbb2028cbe1f22997ab1cb0c26022916 Mon Sep 17 00:00:00 2001 From: Xinyang Yu <47915643+xy-241@users.noreply.github.com> Date: Fri, 26 Jan 2024 01:56:26 +0800 Subject: [PATCH 39/98] fix: code block overflow scroll (#729) --- quartz/styles/base.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 27bad69ac..16be6ad53 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -356,6 +356,7 @@ pre { counter-increment: line 0; display: grid; padding: 0.5rem 0; + overflow-x: scroll; & [data-highlighted-chars] { background-color: var(--highlight); From a8e1c4abc2f5a76d0ff0d582b5c1cbfb81ddbe2f Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Thu, 25 Jan 2024 22:22:01 -0800 Subject: [PATCH 40/98] docs: rearrange showcase --- docs/showcase.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/showcase.md b/docs/showcase.md index 16235e46a..cdef5fc50 100644 --- a/docs/showcase.md +++ b/docs/showcase.md @@ -7,13 +7,10 @@ Want to see what Quartz can do? Here are some cool community gardens: - [Quartz Documentation (this site!)](https://quartz.jzhao.xyz/) - [Jacky Zhao's Garden](https://jzhao.xyz/) - [Socratica Toolbox](https://toolbox.socratica.info/) -- [Brandon Boswell's Garden](https://brandonkboswell.com) -- [Scaling Synthesis - A hypertext research notebook](https://scalingsynthesis.com/) -- [Data Dictionary 🧠](https://glossary.airbyte.com/) -- [sspaeti.com's Second Brain](https://brain.sspaeti.com/) - [oldwinter の数字花园](https://garden.oldwinter.top/) +- [Aaron Pham's Garden](https://aarnphm.xyz/) +- [The Quantum Garden](https://quantumgardener.blog/) - [Abhijeet's Math Wiki](https://abhmul.github.io/quartz/Math-Wiki/) -- [Mike's AI Garden 🤖🪴](https://mwalton.me/) - [Matt Dunn's Second Brain](https://mattdunn.info/) - [Pelayo Arbues' Notes](https://pelayoarbues.github.io/) - [Vince Imbat's Talahardin](https://vinceimbat.com/) @@ -22,7 +19,11 @@ Want to see what Quartz can do? Here are some cool community gardens: - [Mau Camargo's Notkesto](https://notes.camargomau.com/) - [Caicai's Novels](https://imoko.cc/blog/caicai/) - [🌊 Collapsed Wave](https://collapsedwave.com/) -- [Aaron Pham's Garden](https://aarnphm.xyz/) - [Sideny's 3D Artist's Handbook](https://sidney-eliot.github.io/3d-artists-handbook/) +- [Mike's AI Garden 🤖🪴](https://mwalton.me/) +- [Brandon Boswell's Garden](https://brandonkboswell.com) +- [Scaling Synthesis - A hypertext research notebook](https://scalingsynthesis.com/) +- [Data Dictionary 🧠](https://glossary.airbyte.com/) +- [sspaeti.com's Second Brain](https://brain.sspaeti.com/) If you want to see your own on here, submit a [Pull Request adding yourself to this file](https://github.com/jackyzha0/quartz/blob/v4/docs/showcase.md)! From b87c6cd5c792d90fcd1ee553187af8d5c00980d3 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Fri, 26 Jan 2024 10:55:59 -0800 Subject: [PATCH 41/98] docs: add nicole van der hoeven's setup guide --- docs/index.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/index.md b/docs/index.md index 7804ac6ba..0783d4470 100644 --- a/docs/index.md +++ b/docs/index.md @@ -25,6 +25,9 @@ This will guide you through initializing your Quartz with content. Once you've d 4. [[build|Build and preview]] Quartz 5. [[hosting|Host]] Quartz online +If you prefer video format you can also try following Nicole van der Hoeven's +[video guide on how set up Quartz!](https://www.youtube.com/watch?v=6s6DT1yN4dw&t=227s) + ## 🔧 Features - [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], and [many more](./features) right out of the box From 8fa1a1e7b9de36a93afed138dccb5f6663d40941 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Fri, 26 Jan 2024 13:40:37 -0800 Subject: [PATCH 42/98] fix: allow partial when specifiying layout for emitter plugins --- quartz/plugins/emitters/folderPage.tsx | 2 +- quartz/plugins/emitters/tagPage.tsx | 2 +- quartz/plugins/types.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/quartz/plugins/emitters/folderPage.tsx b/quartz/plugins/emitters/folderPage.tsx index a4bd1aed2..04a5a0086 100644 --- a/quartz/plugins/emitters/folderPage.tsx +++ b/quartz/plugins/emitters/folderPage.tsx @@ -19,7 +19,7 @@ import { defaultListPageLayout, sharedPageComponents } from "../../../quartz.lay import { FolderContent } from "../../components" import { write } from "./helpers" -export const FolderPage: QuartzEmitterPlugin = (userOpts) => { +export const FolderPage: QuartzEmitterPlugin> = (userOpts) => { const opts: FullPageLayout = { ...sharedPageComponents, ...defaultListPageLayout, diff --git a/quartz/plugins/emitters/tagPage.tsx b/quartz/plugins/emitters/tagPage.tsx index 56a552c69..3e450f6a8 100644 --- a/quartz/plugins/emitters/tagPage.tsx +++ b/quartz/plugins/emitters/tagPage.tsx @@ -16,7 +16,7 @@ import { defaultListPageLayout, sharedPageComponents } from "../../../quartz.lay import { TagContent } from "../../components" import { write } from "./helpers" -export const TagPage: QuartzEmitterPlugin = (userOpts) => { +export const TagPage: QuartzEmitterPlugin> = (userOpts) => { const opts: FullPageLayout = { ...sharedPageComponents, ...defaultListPageLayout, diff --git a/quartz/plugins/types.ts b/quartz/plugins/types.ts index bf1c0db0e..a361bb9fd 100644 --- a/quartz/plugins/types.ts +++ b/quartz/plugins/types.ts @@ -2,7 +2,7 @@ import { PluggableList } from "unified" import { StaticResources } from "../util/resources" import { ProcessedContent } from "./vfile" import { QuartzComponent } from "../components/types" -import { FilePath, FullSlug } from "../util/path" +import { FilePath } from "../util/path" import { BuildCtx } from "../util/ctx" export interface PluginTypes { From 448ba008e0eba87736067d486222900407c212c3 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Fri, 26 Jan 2024 20:16:54 -0800 Subject: [PATCH 43/98] docs: fix phrasing --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 0783d4470..f9f8603b6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -25,7 +25,7 @@ This will guide you through initializing your Quartz with content. Once you've d 4. [[build|Build and preview]] Quartz 5. [[hosting|Host]] Quartz online -If you prefer video format you can also try following Nicole van der Hoeven's +If you prefer instructions in a video format you can try following Nicole van der Hoeven's [video guide on how set up Quartz!](https://www.youtube.com/watch?v=6s6DT1yN4dw&t=227s) ## 🔧 Features From af3a4ff9cd0d49ffa414844b2d54e04e344486aa Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Fri, 26 Jan 2024 20:23:43 -0800 Subject: [PATCH 44/98] docs: i can't type --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index f9f8603b6..1cb02dc95 100644 --- a/docs/index.md +++ b/docs/index.md @@ -26,7 +26,7 @@ This will guide you through initializing your Quartz with content. Once you've d 5. [[hosting|Host]] Quartz online If you prefer instructions in a video format you can try following Nicole van der Hoeven's -[video guide on how set up Quartz!](https://www.youtube.com/watch?v=6s6DT1yN4dw&t=227s) +[video guide on how to set up Quartz!](https://www.youtube.com/watch?v=6s6DT1yN4dw&t=227s) ## 🔧 Features From b211d49922cef3910b78cf61c27c1285406c6c5d Mon Sep 17 00:00:00 2001 From: LUCASTUCIOUS Date: Sun, 28 Jan 2024 03:34:21 +0100 Subject: [PATCH 45/98] feat: Handling cssclasses properties in Quartz (#711) * Add cssclasses to article * Prettier * Update quartz/components/pages/Content.tsx * Update quartz/components/pages/Content.tsx --------- Co-authored-by: Jacky Zhao --- quartz/components/pages/Content.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quartz/components/pages/Content.tsx b/quartz/components/pages/Content.tsx index 76cecc38c..2e6416f66 100644 --- a/quartz/components/pages/Content.tsx +++ b/quartz/components/pages/Content.tsx @@ -3,7 +3,9 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "../types" function Content({ fileData, tree }: QuartzComponentProps) { const content = htmlToJsx(fileData.filePath!, tree) - return {content} + const classes: string[] = fileData.frontmatter?.cssclasses ?? [] + const classString = ["popover-hint", ...classes].join(" ") + return {content} } export default (() => Content) satisfies QuartzComponentConstructor From 42ee069c1cc515e6c5e595143e46c8201c6cbe3f Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 27 Jan 2024 21:39:16 -0800 Subject: [PATCH 46/98] fix: generalize frontmatter parsing and coercing --- quartz/plugins/emitters/aliases.ts | 7 +- quartz/plugins/filters/explicit.ts | 7 +- quartz/plugins/transformers/frontmatter.ts | 98 +++++++++++++++------- quartz/plugins/transformers/lastmod.ts | 46 ++++------ quartz/plugins/transformers/ofm.ts | 2 +- 5 files changed, 90 insertions(+), 70 deletions(-) diff --git a/quartz/plugins/emitters/aliases.ts b/quartz/plugins/emitters/aliases.ts index 118c3926e..d407629db 100644 --- a/quartz/plugins/emitters/aliases.ts +++ b/quartz/plugins/emitters/aliases.ts @@ -15,12 +15,7 @@ export const AliasRedirects: QuartzEmitterPlugin = () => ({ for (const [_tree, file] of content) { const ogSlug = simplifySlug(file.data.slug!) const dir = path.posix.relative(argv.directory, path.dirname(file.data.filePath!)) - - let aliases: FullSlug[] = file.data.frontmatter?.aliases ?? file.data.frontmatter?.alias ?? [] - if (typeof aliases === "string") { - aliases = [aliases] - } - + const aliases = file.data.frontmatter?.aliases ?? [] const slugs: FullSlug[] = aliases.map((alias) => path.posix.join(dir, alias) as FullSlug) const permalink = file.data.frontmatter?.permalink if (typeof permalink === "string") { diff --git a/quartz/plugins/filters/explicit.ts b/quartz/plugins/filters/explicit.ts index 48f92bdf2..79a46a81c 100644 --- a/quartz/plugins/filters/explicit.ts +++ b/quartz/plugins/filters/explicit.ts @@ -3,11 +3,6 @@ import { QuartzFilterPlugin } from "../types" export const ExplicitPublish: QuartzFilterPlugin = () => ({ name: "ExplicitPublish", shouldPublish(_ctx, [_tree, vfile]) { - const publishProperty = vfile.data?.frontmatter?.publish ?? false - const publishFlag = - typeof publishProperty === "string" - ? publishProperty.toLowerCase() === "true" - : Boolean(publishProperty) - return publishFlag + return vfile.data?.frontmatter?.publish ?? false }, }) diff --git a/quartz/plugins/transformers/frontmatter.ts b/quartz/plugins/transformers/frontmatter.ts index 26a665d8f..41c1b1375 100644 --- a/quartz/plugins/transformers/frontmatter.ts +++ b/quartz/plugins/transformers/frontmatter.ts @@ -5,17 +5,56 @@ import yaml from "js-yaml" import toml from "toml" import { slugTag } from "../../util/path" import { QuartzPluginData } from "../vfile" +import chalk from "chalk" export interface Options { delims: string | string[] language: "yaml" | "toml" - oneLineTagDelim: string } const defaultOptions: Options = { delims: "---", language: "yaml", - oneLineTagDelim: ",", +} + +function coerceDate(fp: string, d: unknown): Date | undefined { + if (d === undefined || d === null) return undefined + const dt = new Date(d as string | number) + const invalidDate = isNaN(dt.getTime()) || dt.getTime() === 0 + if (invalidDate) { + console.log( + chalk.yellow( + `\nWarning: found invalid date "${d}" in \`${fp}\`. Supported formats: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format`, + ), + ) + + return undefined + } + + return dt +} + +function coalesceAliases(data: { [key: string]: any }, aliases: string[]) { + for (const alias of aliases) { + if (data[alias] !== undefined && data[alias] !== null) return data[alias] + } +} + +function coerceToArray(input: string | string[]): string[] | undefined { + if (input === undefined || input === null) return undefined + + // coerce to array + if (!Array.isArray(input)) { + input = input + .toString() + .split(",") + .map((tag: string) => tag.trim()) + } + + // remove all non-strings + return input + .filter((tag: unknown) => typeof tag === "string" || typeof tag === "number") + .map((tag: string | number) => tag.toString()) } export const FrontMatter: QuartzTransformerPlugin | undefined> = (userOpts) => { @@ -23,12 +62,11 @@ export const FrontMatter: QuartzTransformerPlugin | undefined> return { name: "FrontMatter", markdownPlugins() { - const { oneLineTagDelim } = opts - return [ [remarkFrontmatter, ["yaml", "toml"]], () => { return (_, file) => { + const fp = file.data.filePath! const { data } = matter(Buffer.from(file.value), { ...opts, engines: { @@ -37,35 +75,29 @@ export const FrontMatter: QuartzTransformerPlugin | undefined> }, }) - // tag is an alias for tags - if (data.tag) { - data.tags = data.tag - } - - // coerce title to string if (data.title) { data.title = data.title.toString() } else if (data.title === null || data.title === undefined) { data.title = file.stem ?? "Untitled" } - if (data.tags) { - // coerce to array - if (!Array.isArray(data.tags)) { - data.tags = data.tags - .toString() - .split(oneLineTagDelim) - .map((tag: string) => tag.trim()) - } + const tags = coerceToArray(coalesceAliases(data, ["tags", "tag"])) + if (tags) data.tags = [...new Set(tags.map((tag: string) => slugTag(tag)))] - // remove all non-string tags - data.tags = data.tags - .filter((tag: unknown) => typeof tag === "string" || typeof tag === "number") - .map((tag: string | number) => tag.toString()) - } + const aliases = coerceToArray(coalesceAliases(data, ["aliases", "alias"])) + if (aliases) data.aliases = aliases + const cssclasses = coerceToArray(coalesceAliases(data, ["cssclasses", "cssclass"])) + if (cssclasses) data.cssclasses = cssclasses + const created = coerceDate(fp, coalesceAliases(data, ["created", "date"])) - // slug them all!! - data.tags = [...new Set(data.tags?.map((tag: string) => slugTag(tag)))] + if (created) data.created = created + const modified = coerceDate( + fp, + coalesceAliases(data, ["modified", "lastmod", "updated", "last-modified"]), + ) + if (modified) data.modified = modified + const published = coerceDate(fp, coalesceAliases(data, ["published", "publishDate"])) + if (published) data.published = published // fill in frontmatter file.data.frontmatter = data as QuartzPluginData["frontmatter"] @@ -78,9 +110,19 @@ export const FrontMatter: QuartzTransformerPlugin | undefined> declare module "vfile" { interface DataMap { - frontmatter: { [key: string]: any } & { + frontmatter: { [key: string]: unknown } & { title: string - tags: string[] - } + } & Partial<{ + tags: string[] + aliases: string[] + description: string + publish: boolean + draft: boolean + enableToc: string + cssclasses: string[] + created: Date + modified: Date + published: Date + }> } } diff --git a/quartz/plugins/transformers/lastmod.ts b/quartz/plugins/transformers/lastmod.ts index 6e12616f7..193664d65 100644 --- a/quartz/plugins/transformers/lastmod.ts +++ b/quartz/plugins/transformers/lastmod.ts @@ -12,21 +12,6 @@ const defaultOptions: Options = { priority: ["frontmatter", "git", "filesystem"], } -function coerceDate(fp: string, d: any): Date { - const dt = new Date(d) - const invalidDate = isNaN(dt.getTime()) || dt.getTime() === 0 - if (invalidDate && d !== undefined) { - console.log( - chalk.yellow( - `\nWarning: found invalid date "${d}" in \`${fp}\`. Supported formats: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format`, - ), - ) - } - - return invalidDate ? new Date() : dt -} - -type MaybeDate = undefined | string | number export const CreatedModifiedDate: QuartzTransformerPlugin | undefined> = ( userOpts, ) => { @@ -38,23 +23,21 @@ export const CreatedModifiedDate: QuartzTransformerPlugin | und () => { let repo: Repository | undefined = undefined return async (_tree, file) => { - let created: MaybeDate = undefined - let modified: MaybeDate = undefined - let published: MaybeDate = undefined + let created: Date | undefined = undefined + let modified: Date | undefined = undefined + let published: Date | undefined = undefined const fp = file.data.filePath! const fullFp = path.posix.join(file.cwd, fp) for (const source of opts.priority) { if (source === "filesystem") { const st = await fs.promises.stat(fullFp) - created ||= st.birthtimeMs - modified ||= st.mtimeMs + created ||= new Date(st.birthtimeMs) + modified ||= new Date(st.mtimeMs) } else if (source === "frontmatter" && file.data.frontmatter) { - created ||= file.data.frontmatter.date - modified ||= file.data.frontmatter.lastmod - modified ||= file.data.frontmatter.updated - modified ||= file.data.frontmatter["last-modified"] - published ||= file.data.frontmatter.publishDate + created ||= file.data.frontmatter.created + modified ||= file.data.frontmatter.modified + published ||= file.data.frontmatter.published } else if (source === "git") { if (!repo) { // Get a reference to the main git repo. @@ -64,7 +47,9 @@ export const CreatedModifiedDate: QuartzTransformerPlugin | und } try { - modified ||= await repo.getFileLatestModifiedDateAsync(file.data.filePath!) + modified ||= new Date( + await repo.getFileLatestModifiedDateAsync(file.data.filePath!), + ) } catch { console.log( chalk.yellow( @@ -76,10 +61,13 @@ export const CreatedModifiedDate: QuartzTransformerPlugin | und } } + created ||= new Date() + modified ||= new Date() + published ||= new Date() file.data.dates = { - created: coerceDate(fp, created), - modified: coerceDate(fp, modified), - published: coerceDate(fp, published), + created, + modified, + published, } } }, diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index f6345c5b5..735d1146c 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -318,7 +318,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin } tag = slugTag(tag) - if (file.data.frontmatter && !file.data.frontmatter.tags.includes(tag)) { + if (file.data.frontmatter?.tags?.includes(tag)) { file.data.frontmatter.tags.push(tag) } From b11fefbbbe5c67e539002a9cbb688c8b8f17da31 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 27 Jan 2024 21:44:38 -0800 Subject: [PATCH 47/98] feat: enable dependabot --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..dc108f27f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" From 0a2d746e38ca4b912652f2a93a9c8ab84916df36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Jan 2024 21:47:04 -0800 Subject: [PATCH 48/98] chore(deps): bump rehype-pretty-code from 0.12.3 to 0.12.6 (#741) Bumps [rehype-pretty-code](https://github.com/atomiks/rehype-pretty-code) from 0.12.3 to 0.12.6. - [Release notes](https://github.com/atomiks/rehype-pretty-code/releases) - [Commits](https://github.com/atomiks/rehype-pretty-code/compare/v0.12.3...v0.12.6) --- updated-dependencies: - dependency-name: rehype-pretty-code 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 | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e135f1a3..d5283400a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "rehype-autolink-headings": "^7.1.0", "rehype-katex": "^7.0.0", "rehype-mathjax": "^5.0.0", - "rehype-pretty-code": "^0.12.3", + "rehype-pretty-code": "^0.12.6", "rehype-raw": "^7.0.0", "rehype-slug": "^6.0.0", "remark": "^15.0.1", @@ -4705,9 +4705,9 @@ } }, "node_modules/rehype-pretty-code": { - "version": "0.12.3", - "resolved": "https://registry.npmjs.org/rehype-pretty-code/-/rehype-pretty-code-0.12.3.tgz", - "integrity": "sha512-6NbIit8A3hLrkKBEbNs862jVnTLeIOM2AmM0VZ/MtyHb+OuNMeCa6UZSx6UG4zrobm5tY9efTwhih1exsGYsiw==", + "version": "0.12.6", + "resolved": "https://registry.npmjs.org/rehype-pretty-code/-/rehype-pretty-code-0.12.6.tgz", + "integrity": "sha512-AW18s4eXwnb4PGwL0Y8BoUzBJr23epWNXndCKaZ52S4kl/4tsgM+406oCp5NdtPZsB0ItpaY+hCMv3kw58DLrA==", "dependencies": { "@types/hast": "^3.0.3", "hast-util-to-string": "^3.0.0", @@ -4720,7 +4720,7 @@ "node": ">=18" }, "peerDependencies": { - "shikiji": "^0.7.0 || ^0.8.0 || ^0.9.0" + "shikiji": "^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0" } }, "node_modules/rehype-raw": { diff --git a/package.json b/package.json index ea7629241..c2a578841 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "rehype-autolink-headings": "^7.1.0", "rehype-katex": "^7.0.0", "rehype-mathjax": "^5.0.0", - "rehype-pretty-code": "^0.12.3", + "rehype-pretty-code": "^0.12.6", "rehype-raw": "^7.0.0", "rehype-slug": "^6.0.0", "remark": "^15.0.1", From bebd6320b70fca79c1a1cbdaaaea4f87c92f87fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Jan 2024 21:56:51 -0800 Subject: [PATCH 49/98] chore(deps-dev): bump tsx from 4.6.2 to 4.7.0 (#743) Bumps [tsx](https://github.com/privatenumber/tsx) from 4.6.2 to 4.7.0. - [Release notes](https://github.com/privatenumber/tsx/releases) - [Changelog](https://github.com/privatenumber/tsx/blob/develop/release.config.cjs) - [Commits](https://github.com/privatenumber/tsx/compare/v4.6.2...v4.7.0) --- updated-dependencies: - dependency-name: tsx dependency-type: direct:development 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 | 597 +++++++++------------------------------------- package.json | 2 +- 2 files changed, 113 insertions(+), 486 deletions(-) diff --git a/package-lock.json b/package-lock.json index d5283400a..de5d80751 100644 --- a/package-lock.json +++ b/package-lock.json @@ -82,7 +82,7 @@ "@types/yargs": "^17.0.32", "esbuild": "^0.19.9", "prettier": "^3.1.1", - "tsx": "^4.6.2", + "tsx": "^4.7.0", "typescript": "^5.3.3" }, "engines": { @@ -124,10 +124,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.9.tgz", - "integrity": "sha512-jkYjjq7SdsWuNI6b5quymW0oC83NN5FdRPuCbs9HZ02mfVdAP8B8eeqLSYU3gb6OJEaY5CQabtTFbqBf26H3GA==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", "cpu": [ "arm" ], @@ -140,9 +155,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.9.tgz", - "integrity": "sha512-q4cR+6ZD0938R19MyEW3jEsMzbb/1rulLXiNAJQADD/XYp7pT+rOS5JGxvpRW8dFDEfjW4wLgC/3FXIw4zYglQ==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", "cpu": [ "arm64" ], @@ -155,9 +170,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.9.tgz", - "integrity": "sha512-KOqoPntWAH6ZxDwx1D6mRntIgZh9KodzgNOy5Ebt9ghzffOk9X2c1sPwtM9P+0eXbefnDhqYfkh5PLP5ULtWFA==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", "cpu": [ "x64" ], @@ -170,9 +185,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.9.tgz", - "integrity": "sha512-KBJ9S0AFyLVx2E5D8W0vExqRW01WqRtczUZ8NRu+Pi+87opZn5tL4Y0xT0mA4FtHctd0ZgwNoN639fUUGlNIWw==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", "cpu": [ "arm64" ], @@ -185,9 +200,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.9.tgz", - "integrity": "sha512-vE0VotmNTQaTdX0Q9dOHmMTao6ObjyPm58CHZr1UK7qpNleQyxlFlNCaHsHx6Uqv86VgPmR4o2wdNq3dP1qyDQ==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", "cpu": [ "x64" ], @@ -200,9 +215,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.9.tgz", - "integrity": "sha512-uFQyd/o1IjiEk3rUHSwUKkqZwqdvuD8GevWF065eqgYfexcVkxh+IJgwTaGZVu59XczZGcN/YMh9uF1fWD8j1g==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", "cpu": [ "arm64" ], @@ -215,9 +230,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.9.tgz", - "integrity": "sha512-WMLgWAtkdTbTu1AWacY7uoj/YtHthgqrqhf1OaEWnZb7PQgpt8eaA/F3LkV0E6K/Lc0cUr/uaVP/49iE4M4asA==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", "cpu": [ "x64" ], @@ -230,9 +245,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.9.tgz", - "integrity": "sha512-C/ChPohUYoyUaqn1h17m/6yt6OB14hbXvT8EgM1ZWaiiTYz7nWZR0SYmMnB5BzQA4GXl3BgBO1l8MYqL/He3qw==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", "cpu": [ "arm" ], @@ -245,9 +260,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.9.tgz", - "integrity": "sha512-PiPblfe1BjK7WDAKR1Cr9O7VVPqVNpwFcPWgfn4xu0eMemzRp442hXyzF/fSwgrufI66FpHOEJk0yYdPInsmyQ==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", "cpu": [ "arm64" ], @@ -260,9 +275,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.9.tgz", - "integrity": "sha512-f37i/0zE0MjDxijkPSQw1CO/7C27Eojqb+r3BbHVxMLkj8GCa78TrBZzvPyA/FNLUMzP3eyHCVkAopkKVja+6Q==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", "cpu": [ "ia32" ], @@ -275,9 +290,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.9.tgz", - "integrity": "sha512-t6mN147pUIf3t6wUt3FeumoOTPfmv9Cc6DQlsVBpB7eCpLOqQDyWBP1ymXn1lDw4fNUSb/gBcKAmvTP49oIkaA==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", "cpu": [ "loong64" ], @@ -290,9 +305,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.9.tgz", - "integrity": "sha512-jg9fujJTNTQBuDXdmAg1eeJUL4Jds7BklOTkkH80ZgQIoCTdQrDaHYgbFZyeTq8zbY+axgptncko3v9p5hLZtw==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", "cpu": [ "mips64el" ], @@ -305,9 +320,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.9.tgz", - "integrity": "sha512-tkV0xUX0pUUgY4ha7z5BbDS85uI7ABw3V1d0RNTii7E9lbmV8Z37Pup2tsLV46SQWzjOeyDi1Q7Wx2+QM8WaCQ==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", "cpu": [ "ppc64" ], @@ -320,9 +335,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.9.tgz", - "integrity": "sha512-DfLp8dj91cufgPZDXr9p3FoR++m3ZJ6uIXsXrIvJdOjXVREtXuQCjfMfvmc3LScAVmLjcfloyVtpn43D56JFHg==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", "cpu": [ "riscv64" ], @@ -335,9 +350,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.9.tgz", - "integrity": "sha512-zHbglfEdC88KMgCWpOl/zc6dDYJvWGLiUtmPRsr1OgCViu3z5GncvNVdf+6/56O2Ca8jUU+t1BW261V6kp8qdw==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", "cpu": [ "s390x" ], @@ -350,9 +365,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.9.tgz", - "integrity": "sha512-JUjpystGFFmNrEHQnIVG8hKwvA2DN5o7RqiO1CVX8EN/F/gkCjkUMgVn6hzScpwnJtl2mPR6I9XV1oW8k9O+0A==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", "cpu": [ "x64" ], @@ -365,9 +380,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.9.tgz", - "integrity": "sha512-GThgZPAwOBOsheA2RUlW5UeroRfESwMq/guy8uEe3wJlAOjpOXuSevLRd70NZ37ZrpO6RHGHgEHvPg1h3S1Jug==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", "cpu": [ "x64" ], @@ -380,9 +395,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.9.tgz", - "integrity": "sha512-Ki6PlzppaFVbLnD8PtlVQfsYw4S9n3eQl87cqgeIw+O3sRr9IghpfSKY62mggdt1yCSZ8QWvTZ9jo9fjDSg9uw==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", "cpu": [ "x64" ], @@ -395,9 +410,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.9.tgz", - "integrity": "sha512-MLHj7k9hWh4y1ddkBpvRj2b9NCBhfgBt3VpWbHQnXRedVun/hC7sIyTGDGTfsGuXo4ebik2+3ShjcPbhtFwWDw==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", "cpu": [ "x64" ], @@ -410,9 +425,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.9.tgz", - "integrity": "sha512-GQoa6OrQ8G08guMFgeXPH7yE/8Dt0IfOGWJSfSH4uafwdC7rWwrfE6P9N8AtPGIjUzdo2+7bN8Xo3qC578olhg==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", "cpu": [ "arm64" ], @@ -425,9 +440,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.9.tgz", - "integrity": "sha512-UOozV7Ntykvr5tSOlGCrqU3NBr3d8JqPes0QWN2WOXfvkWVGRajC+Ym0/Wj88fUgecUCLDdJPDF0Nna2UK3Qtg==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", "cpu": [ "ia32" ], @@ -440,9 +455,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.9.tgz", - "integrity": "sha512-oxoQgglOP7RH6iasDrhY+R/3cHrfwIDvRlT4CGChflq6twk8iENeVvMJjmvBb94Ik1Z+93iGO27err7w6l54GQ==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", "cpu": [ "x64" ], @@ -2011,9 +2026,9 @@ } }, "node_modules/esbuild": { - "version": "0.19.9", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.9.tgz", - "integrity": "sha512-U9CHtKSy+EpPsEBa+/A2gMs/h3ylBC0H0KSqIg7tpztHerLi6nrrcoUJAkNCEPumx8yJ+Byic4BVwHgRbN0TBg==", + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -2022,28 +2037,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.19.9", - "@esbuild/android-arm64": "0.19.9", - "@esbuild/android-x64": "0.19.9", - "@esbuild/darwin-arm64": "0.19.9", - "@esbuild/darwin-x64": "0.19.9", - "@esbuild/freebsd-arm64": "0.19.9", - "@esbuild/freebsd-x64": "0.19.9", - "@esbuild/linux-arm": "0.19.9", - "@esbuild/linux-arm64": "0.19.9", - "@esbuild/linux-ia32": "0.19.9", - "@esbuild/linux-loong64": "0.19.9", - "@esbuild/linux-mips64el": "0.19.9", - "@esbuild/linux-ppc64": "0.19.9", - "@esbuild/linux-riscv64": "0.19.9", - "@esbuild/linux-s390x": "0.19.9", - "@esbuild/linux-x64": "0.19.9", - "@esbuild/netbsd-x64": "0.19.9", - "@esbuild/openbsd-x64": "0.19.9", - "@esbuild/sunos-x64": "0.19.9", - "@esbuild/win32-arm64": "0.19.9", - "@esbuild/win32-ia32": "0.19.9", - "@esbuild/win32-x64": "0.19.9" + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" } }, "node_modules/esbuild-sass-plugin": { @@ -5636,12 +5652,12 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tsx": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.6.2.tgz", - "integrity": "sha512-QPpBdJo+ZDtqZgAnq86iY/PD2KYCUPSUGIunHdGwyII99GKH+f3z3FZ8XNFLSGQIA4I365ui8wnQpl8OKLqcsg==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.0.tgz", + "integrity": "sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==", "dev": true, "dependencies": { - "esbuild": "~0.18.20", + "esbuild": "~0.19.10", "get-tsconfig": "^4.7.2" }, "bin": { @@ -5654,395 +5670,6 @@ "fsevents": "~2.3.3" } }, - "node_modules/tsx/node_modules/@esbuild/android-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/android-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/android-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/darwin-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-loong64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-s390x": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/sunos-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/win32-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/win32-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/@esbuild/win32-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/tsx/node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" - } - }, "node_modules/typescript": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", diff --git a/package.json b/package.json index c2a578841..d37111523 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "@types/yargs": "^17.0.32", "esbuild": "^0.19.9", "prettier": "^3.1.1", - "tsx": "^4.6.2", + "tsx": "^4.7.0", "typescript": "^5.3.3" } } From 319dec42453fd3d24e9d10c6865f9ff0389d54f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Jan 2024 21:59:02 -0800 Subject: [PATCH 50/98] chore(deps): bump @napi-rs/simple-git from 0.1.9 to 0.1.11 (#746) Bumps [@napi-rs/simple-git](https://github.com/Brooooooklyn/simple-git) from 0.1.9 to 0.1.11. - [Release notes](https://github.com/Brooooooklyn/simple-git/releases) - [Commits](https://github.com/Brooooooklyn/simple-git/compare/v0.1.9...v0.1.11) --- updated-dependencies: - dependency-name: "@napi-rs/simple-git" 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 | 96 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/package-lock.json b/package-lock.json index de5d80751..a90ed6fb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@clack/prompts": "^0.7.0", "@floating-ui/dom": "^1.5.3", - "@napi-rs/simple-git": "0.1.9", + "@napi-rs/simple-git": "0.1.11", "async-mutex": "^0.4.0", "chalk": "^5.3.0", "chokidar": "^3.5.3", @@ -508,30 +508,30 @@ } }, "node_modules/@napi-rs/simple-git": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git/-/simple-git-0.1.9.tgz", - "integrity": "sha512-qKzDS0+VjMvVyU28px+C6zlD1HKy83NIdYzfMQWa/g/V1iG/Ic8uwrS2ihHfm7mp7X0PPrmINLiTTi6ieUIKfw==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git/-/simple-git-0.1.11.tgz", + "integrity": "sha512-z14cPCBrtDKKVJ3q4GS5gmXEithGUAt+U8sICgA9i3UFdxJKD4H5rCnO7BVC3htdE9g6OR2w2IcHAL56AjpFbg==", "engines": { "node": ">= 10" }, "optionalDependencies": { - "@napi-rs/simple-git-android-arm-eabi": "0.1.9", - "@napi-rs/simple-git-android-arm64": "0.1.9", - "@napi-rs/simple-git-darwin-arm64": "0.1.9", - "@napi-rs/simple-git-darwin-x64": "0.1.9", - "@napi-rs/simple-git-linux-arm-gnueabihf": "0.1.9", - "@napi-rs/simple-git-linux-arm64-gnu": "0.1.9", - "@napi-rs/simple-git-linux-arm64-musl": "0.1.9", - "@napi-rs/simple-git-linux-x64-gnu": "0.1.9", - "@napi-rs/simple-git-linux-x64-musl": "0.1.9", - "@napi-rs/simple-git-win32-arm64-msvc": "0.1.9", - "@napi-rs/simple-git-win32-x64-msvc": "0.1.9" + "@napi-rs/simple-git-android-arm-eabi": "0.1.11", + "@napi-rs/simple-git-android-arm64": "0.1.11", + "@napi-rs/simple-git-darwin-arm64": "0.1.11", + "@napi-rs/simple-git-darwin-x64": "0.1.11", + "@napi-rs/simple-git-linux-arm-gnueabihf": "0.1.11", + "@napi-rs/simple-git-linux-arm64-gnu": "0.1.11", + "@napi-rs/simple-git-linux-arm64-musl": "0.1.11", + "@napi-rs/simple-git-linux-x64-gnu": "0.1.11", + "@napi-rs/simple-git-linux-x64-musl": "0.1.11", + "@napi-rs/simple-git-win32-arm64-msvc": "0.1.11", + "@napi-rs/simple-git-win32-x64-msvc": "0.1.11" } }, "node_modules/@napi-rs/simple-git-android-arm-eabi": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm-eabi/-/simple-git-android-arm-eabi-0.1.9.tgz", - "integrity": "sha512-9D4JnfePMpgL4pg9aMUX7/TIWEUQ+Tgx8n3Pf8TNCMGjUbImJyYsDSLJzbcv9wH7srgn4GRjSizXFJHAPjzEug==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm-eabi/-/simple-git-android-arm-eabi-0.1.11.tgz", + "integrity": "sha512-wt4Wu9MxvKzEqT4iwodFs7Nrc31K73gR5hM7VnlO6iLELmUQZ5JVJkYoFWgzLQWtzIC48W2+zFMbBgY6+F2rZg==", "cpu": [ "arm" ], @@ -544,9 +544,9 @@ } }, "node_modules/@napi-rs/simple-git-android-arm64": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm64/-/simple-git-android-arm64-0.1.9.tgz", - "integrity": "sha512-Krilsw0gPrrASZzudNEl9pdLuNbhoTK0j7pUbfB8FRifpPdFB/zouwuEm0aSnsDXN4ftGrmGG82kuiR/2MeoPg==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm64/-/simple-git-android-arm64-0.1.11.tgz", + "integrity": "sha512-5/Aj6N44CxwhV3TZWRZ4vGqFj4wb2/a2gwvUZJo9Dwik9Spls7As8LaLe7pOptiGPH0GRP3H5kTT7I6twHNgqw==", "cpu": [ "arm64" ], @@ -559,9 +559,9 @@ } }, "node_modules/@napi-rs/simple-git-darwin-arm64": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-arm64/-/simple-git-darwin-arm64-0.1.9.tgz", - "integrity": "sha512-H/F09nDgYjv4gcFrZBgdTKkZEepqt0KLYcCJuUADuxkKupmjLdecMhypXLk13AzvLW4UQI7NlLTLDXUFLyr2BA==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-arm64/-/simple-git-darwin-arm64-0.1.11.tgz", + "integrity": "sha512-vdVsJUNcRsGVu0hBmLZdxxgwIbJA/Ias8NKWze8MZkZ3VyBwhg0uAzFgESEL3/USAgeCCHjF3uwVki8E+iPq1w==", "cpu": [ "arm64" ], @@ -574,9 +574,9 @@ } }, "node_modules/@napi-rs/simple-git-darwin-x64": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-x64/-/simple-git-darwin-x64-0.1.9.tgz", - "integrity": "sha512-jBR2xS9nVPqmHv0TWz874W0m/d453MGrMeLjB+boK5IPPLhg3AWIZj0aN9jy2Je1BGVAa0w3INIQJtBBeB6kFA==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-x64/-/simple-git-darwin-x64-0.1.11.tgz", + "integrity": "sha512-ufVuZxyJ3LpApk3V101X9qYNX91fnQ4isulz9lWjg90U7Xz0Cav4J3yyFZy6B/cJpYxuiy49R8wV1xDtTeGThA==", "cpu": [ "x64" ], @@ -589,9 +589,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-arm-gnueabihf": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm-gnueabihf/-/simple-git-linux-arm-gnueabihf-0.1.9.tgz", - "integrity": "sha512-3n0+VpO4YfZxndZ0sCvsHIvsazd+JmbSjrlTRBCnJeAU1/sfos3skNZtKGZksZhjvd+3o+/GFM8L7Xnv01yggA==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm-gnueabihf/-/simple-git-linux-arm-gnueabihf-0.1.11.tgz", + "integrity": "sha512-rFafW0Qc/j5we2ghUecB7mFzGcNDtJ5lTiB4I7kffNeL8pEi6Yi7kST8hylswcCowia65d45xsyeNp1mFlFwcg==", "cpu": [ "arm" ], @@ -604,9 +604,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-arm64-gnu": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-gnu/-/simple-git-linux-arm64-gnu-0.1.9.tgz", - "integrity": "sha512-lIzf0KHU2SKC12vMrWwCtysG2Sdt31VHRPMUiz9lD9t3xwVn8qhFSTn5yDkTeG3rgX6o0p5EKalfQN5BXsJq2w==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-gnu/-/simple-git-linux-arm64-gnu-0.1.11.tgz", + "integrity": "sha512-HZ4yaqpj/FQ3V9qNQrTGhtXb7pLAARXeRJrwoaGfz3eZ069y2bHReFcNR//5bsVhZ18JaS9EV47F8WjDxtpI5g==", "cpu": [ "arm64" ], @@ -619,9 +619,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-arm64-musl": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-musl/-/simple-git-linux-arm64-musl-0.1.9.tgz", - "integrity": "sha512-KQozUoNXrxrB8k741ncWXSiMbjl1AGBGfZV21PANzUM8wH4Yem2bg3kfglYS/QIx3udspsT35I9abu49n7D1/w==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-musl/-/simple-git-linux-arm64-musl-0.1.11.tgz", + "integrity": "sha512-b39lJiC3n2+Y6Exjx6qwHoBF++D3k2hN4mZZkvQCFSdLXJ2xtalCatSRWW3pt+mHOHMOgbGektL5v5BYq52hxw==", "cpu": [ "arm64" ], @@ -634,9 +634,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-x64-gnu": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-gnu/-/simple-git-linux-x64-gnu-0.1.9.tgz", - "integrity": "sha512-O/Niui5mnHPcK3iYC3ui8wgERtJWsQ3Y74W/09t0bL/3dgzGMl4oQt0qTj9dWCsnoGsIEYHPzwCBp/2vqYp/pw==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-gnu/-/simple-git-linux-x64-gnu-0.1.11.tgz", + "integrity": "sha512-9EPFvY7PZg+oqWi6Jft5WgSsQtvy9Ey1g4NG+LG8y1RbvaNKthxKbR5zgx196pnFVdcLtsuIdOv/OaQlbcTXkw==", "cpu": [ "x64" ], @@ -649,9 +649,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-x64-musl": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-musl/-/simple-git-linux-x64-musl-0.1.9.tgz", - "integrity": "sha512-L9n+e8Wn3hKr3RsIdY8GaB+ry4xZ4BaGwyKExgoB8nDGQuRUY9oP6p0WA4hWfJvJnU1H6hvo36a5UFPReyBO7A==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-musl/-/simple-git-linux-x64-musl-0.1.11.tgz", + "integrity": "sha512-doIt1lPYIGL3UthlEQjdM9s1Wv0v8bz8LVAgbzJMS+UpVZzArwLWkanAJCy1HjgMTUMiE3AVJqACKIF3EfW/TQ==", "cpu": [ "x64" ], @@ -664,9 +664,9 @@ } }, "node_modules/@napi-rs/simple-git-win32-arm64-msvc": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-arm64-msvc/-/simple-git-win32-arm64-msvc-0.1.9.tgz", - "integrity": "sha512-Z6Ja/SZK+lMvRWaxj7wjnvSbAsGrH006sqZo8P8nxKUdZfkVvoCaAWr1r0cfkk2Z3aijLLtD+vKeXGlUPH6gGQ==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-arm64-msvc/-/simple-git-win32-arm64-msvc-0.1.11.tgz", + "integrity": "sha512-TK3Uvj3Q72ebxfxDT/eLFt8sxCNHo20QMvqJ5BHt4zP1Y9Fl1DXSPRUKLBIhJd0nPcI45ZOMRiZyoT8joxAC9g==", "cpu": [ "arm64" ], @@ -679,9 +679,9 @@ } }, "node_modules/@napi-rs/simple-git-win32-x64-msvc": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-x64-msvc/-/simple-git-win32-x64-msvc-0.1.9.tgz", - "integrity": "sha512-VAZj1UvC+R2MjKOD3I/Y7dmQlHWAYy4omhReQJRpbCf+oGCBi9CWiIduGqeYEq723nLIKdxP7XjaO0wl1NnUww==", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-x64-msvc/-/simple-git-win32-x64-msvc-0.1.11.tgz", + "integrity": "sha512-XOgP6kFDXGmB2KCXFQEsCq70n/Do2h7W9o7qZu8APAD+Sc8JGKz4hKG7PKY2ot924v9nIoKSYbHnupnhXSoXkg==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index d37111523..71dea10cd 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "dependencies": { "@clack/prompts": "^0.7.0", "@floating-ui/dom": "^1.5.3", - "@napi-rs/simple-git": "0.1.9", + "@napi-rs/simple-git": "0.1.11", "async-mutex": "^0.4.0", "chalk": "^5.3.0", "chokidar": "^3.5.3", From 7695df69e51d365506a8385107c5423fe3c9ff3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Jan 2024 22:00:38 -0800 Subject: [PATCH 51/98] chore(deps): bump rehype-mathjax from 5.0.0 to 6.0.0 (#745) Bumps [rehype-mathjax](https://github.com/remarkjs/remark-math) from 5.0.0 to 6.0.0. - [Release notes](https://github.com/remarkjs/remark-math/releases) - [Commits](https://github.com/remarkjs/remark-math/compare/rehype-mathjax@5.0.0...rehype-mathjax@6.0.0) --- updated-dependencies: - dependency-name: rehype-mathjax dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 254 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 132 insertions(+), 124 deletions(-) diff --git a/package-lock.json b/package-lock.json index a90ed6fb1..c26c1de13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "reading-time": "^1.5.0", "rehype-autolink-headings": "^7.1.0", "rehype-katex": "^7.0.0", - "rehype-mathjax": "^5.0.0", + "rehype-mathjax": "^6.0.0", "rehype-pretty-code": "^0.12.6", "rehype-raw": "^7.0.0", "rehype-slug": "^6.0.0", @@ -90,6 +90,16 @@ "npm": ">=9.3.1" } }, + "node_modules/@asamuzakjp/dom-selector": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-2.0.2.tgz", + "integrity": "sha512-x1KXOatwofR6ZAYzXRBL5wrdV0vwNxlTCK9NCuLqAzQYARqGcvFwiJA6A1ERuh+dgeA4Dxm3JBYictIes+SqUQ==", + "dependencies": { + "bidi-js": "^1.0.3", + "css-tree": "^2.3.1", + "is-potential-custom-element-name": "^1.0.1" + } + }, "node_modules/@clack/core": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@clack/core/-/core-0.3.3.tgz", @@ -745,14 +755,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "engines": { - "node": ">= 10" - } - }, "node_modules/@types/cli-spinner": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@types/cli-spinner/-/cli-spinner-0.2.3.tgz", @@ -1068,9 +1070,9 @@ "integrity": "sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==" }, "node_modules/@types/mathjax": { - "version": "0.0.37", - "resolved": "https://registry.npmjs.org/@types/mathjax/-/mathjax-0.0.37.tgz", - "integrity": "sha512-y0WSZBtBNQwcYipTU/BhgeFu1EZNlFvUNCmkMXV9kBQZq7/o5z82dNVyH3yy2Xv5zzeNeQoHSL4Xm06+EQiH+g==" + "version": "0.0.40", + "resolved": "https://registry.npmjs.org/@types/mathjax/-/mathjax-0.0.40.tgz", + "integrity": "sha512-rHusx08LCg92WJxrsM3SPjvLTSvK5C+gealtSuhKbEOcUZfWlwigaFoPLf6Dfxhg4oryN5qP9Sj7zOQ4HYXINw==" }, "node_modules/@types/mdast": { "version": "4.0.3", @@ -1157,21 +1159,15 @@ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, - "node_modules/abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "deprecated": "Use your platform's native atob() and btoa() methods instead" - }, "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", "dependencies": { - "debug": "4" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, "node_modules/ansi-regex": { @@ -1252,6 +1248,14 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/bidi-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", + "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", + "dependencies": { + "require-from-string": "^2.0.2" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -1518,15 +1522,27 @@ "node": ">= 8" } }, + "node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, "node_modules/cssstyle": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", - "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", + "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", "dependencies": { "rrweb-cssom": "^0.6.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/d3": { @@ -1900,16 +1916,15 @@ } }, "node_modules/data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/debug": { @@ -1992,18 +2007,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "deprecated": "Use your platform's native DOMException instead", - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -2703,14 +2706,14 @@ } }, "node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", "dependencies": { - "whatwg-encoding": "^2.0.0" + "whatwg-encoding": "^3.1.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/html-void-elements": { @@ -2723,28 +2726,27 @@ } }, "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", + "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/iconv-lite": { @@ -2972,39 +2974,37 @@ } }, "node_modules/jsdom": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", - "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.2.0.tgz", + "integrity": "sha512-L88oL7D/8ufIES+Zjz7v0aes+oBMh2Xnh3ygWvL0OaICOomKEPKuPnIfBJekiXr+BHbbMjrWn/xqrDQuxFTeyA==", "dependencies": { - "abab": "^2.0.6", - "cssstyle": "^3.0.0", - "data-urls": "^4.0.0", + "@asamuzakjp/dom-selector": "^2.0.1", + "cssstyle": "^4.0.1", + "data-urls": "^5.0.0", "decimal.js": "^10.4.3", - "domexception": "^4.0.0", "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.4", "parse5": "^7.1.2", "rrweb-cssom": "^0.6.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^4.0.0", + "tough-cookie": "^4.1.3", + "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.1", - "ws": "^8.13.0", - "xml-name-validator": "^4.0.0" + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.16.0", + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=16" + "node": ">=18" }, "peerDependencies": { - "canvas": "^2.5.0" + "canvas": "^2.11.2" }, "peerDependenciesMeta": { "canvas": { @@ -3678,6 +3678,11 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4347,11 +4352,6 @@ "node": ">=0.10.0" } }, - "node_modules/nwsapi": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", - "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==" - }, "node_modules/parse-entities": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", @@ -4658,15 +4658,15 @@ } }, "node_modules/rehype-mathjax": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/rehype-mathjax/-/rehype-mathjax-5.0.0.tgz", - "integrity": "sha512-IRPgpSpwOq4JNn3efeTrbYDMmzjOKCTJtu1Wyo/+6nenyqwqIvlojYDczRILOeHa1HyCMYmqpdvfOovOVzDIGg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/rehype-mathjax/-/rehype-mathjax-6.0.0.tgz", + "integrity": "sha512-SioRmn+0mRWtDc4QVKG9JG88bXhPazfhc11GQoQ68mwot2WWyfabyZ7tuJu3Z4LCf893wXkQTVTF8PUlntoDwA==", "dependencies": { "@types/hast": "^3.0.0", - "@types/mathjax": "^0.0.37", + "@types/mathjax": "^0.0.40", "hast-util-from-dom": "^5.0.0", "hast-util-to-text": "^4.0.0", - "jsdom": "^22.0.0", + "jsdom": "^23.0.0", "mathjax-full": "^3.0.0", "unified": "^11.0.0", "unist-util-visit-parents": "^6.0.0" @@ -4925,6 +4925,14 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -5610,14 +5618,14 @@ } }, "node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", "dependencies": { - "punycode": "^2.3.0" + "punycode": "^2.3.1" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/tr46/node_modules/punycode": { @@ -5990,14 +5998,14 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", - "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dependencies": { - "xml-name-validator": "^4.0.0" + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/web-namespaces": { @@ -6018,34 +6026,34 @@ } }, "node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dependencies": { "iconv-lite": "0.6.3" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-url": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", - "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", "dependencies": { - "tr46": "^4.1.1", + "tr46": "^5.0.0", "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/which": { @@ -6154,9 +6162,9 @@ } }, "node_modules/ws": { - "version": "8.15.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.15.1.tgz", - "integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "engines": { "node": ">=10.0.0" }, @@ -6174,11 +6182,11 @@ } }, "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/xmlchars": { diff --git a/package.json b/package.json index 71dea10cd..987536eab 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "reading-time": "^1.5.0", "rehype-autolink-headings": "^7.1.0", "rehype-katex": "^7.0.0", - "rehype-mathjax": "^5.0.0", + "rehype-mathjax": "^6.0.0", "rehype-pretty-code": "^0.12.6", "rehype-raw": "^7.0.0", "rehype-slug": "^6.0.0", From 2739457c86ccaff582de96f2d57bb9d1aabe6f60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Jan 2024 22:01:43 -0800 Subject: [PATCH 52/98] chore(deps): bump shikiji from 0.9.9 to 0.10.2 (#742) Bumps [shikiji](https://github.com/antfu/shikiji/tree/HEAD/packages/shikiji) from 0.9.9 to 0.10.2. - [Release notes](https://github.com/antfu/shikiji/releases) - [Commits](https://github.com/antfu/shikiji/commits/v0.10.2/packages/shikiji) --- updated-dependencies: - dependency-name: shikiji 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 | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index c26c1de13..031422a3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,7 +54,7 @@ "rfdc": "^1.3.0", "rimraf": "^5.0.5", "serve-handler": "^6.1.5", - "shikiji": "^0.9.9", + "shikiji": "^0.10.2", "source-map-support": "^0.5.21", "to-vfile": "^8.0.0", "toml": "^3.0.0", @@ -5335,17 +5335,17 @@ } }, "node_modules/shikiji": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.9.9.tgz", - "integrity": "sha512-/S3unr/0mZTstNOuAmNDEufeimtqeQb8lXvPMLsYfDvqyfmG6334bO2xmDzD0kfxH2y8gnFgSWAJpdEzksmYXg==", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/shikiji/-/shikiji-0.10.2.tgz", + "integrity": "sha512-wtZg3T0vtYV2PnqusWQs3mDaJBdCPWxFDrBM/SE5LfrX92gjUvfEMlc+vJnoKY6Z/S44OWaCRzNIsdBRWcTAiw==", "dependencies": { - "shikiji-core": "0.9.9" + "shikiji-core": "0.10.2" } }, "node_modules/shikiji-core": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/shikiji-core/-/shikiji-core-0.9.9.tgz", - "integrity": "sha512-qu5Qq7Co6JIMY312J9Ek6WYjXieeyJT/fIqmkcjF4MdnMNlUnhSqPo8/42g5UdPgdyTCwijS7Nhg8DfLSLodkg==" + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/shikiji-core/-/shikiji-core-0.10.2.tgz", + "integrity": "sha512-9Of8HMlF96usXJHmCL3Gd0Fcf0EcyJUF9m8EoAKKd98mHXi0La2AZl1h6PegSFGtiYcBDK/fLuKbDa1l16r1fA==" }, "node_modules/signal-exit": { "version": "4.1.0", diff --git a/package.json b/package.json index 987536eab..bbaa688bd 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "rfdc": "^1.3.0", "rimraf": "^5.0.5", "serve-handler": "^6.1.5", - "shikiji": "^0.9.9", + "shikiji": "^0.10.2", "source-map-support": "^0.5.21", "to-vfile": "^8.0.0", "toml": "^3.0.0", From efdce070e1cea59d52d9f3bf47d468890658eceb Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 27 Jan 2024 22:15:25 -0800 Subject: [PATCH 53/98] deps: bump flexsearch --- package-lock.json | 15 ++++----------- package.json | 3 +-- quartz/cli/handlers.js | 1 + quartz/components/scripts/search.inline.ts | 17 ++++++++--------- tsconfig.json | 2 +- 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 031422a3d..594c5ad3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "cli-spinner": "^0.2.10", "d3": "^7.8.5", "esbuild-sass-plugin": "^2.16.0", - "flexsearch": "0.7.21", + "flexsearch": "0.7.43", "github-slugger": "^2.0.0", "globby": "^14.0.0", "gray-matter": "^4.0.3", @@ -71,7 +71,6 @@ "devDependencies": { "@types/cli-spinner": "^0.2.3", "@types/d3": "^7.4.3", - "@types/flexsearch": "^0.7.3", "@types/hast": "^3.0.3", "@types/js-yaml": "^4.0.9", "@types/node": "^20.1.2", @@ -1038,12 +1037,6 @@ "@types/estree": "*" } }, - "node_modules/@types/flexsearch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@types/flexsearch/-/flexsearch-0.7.3.tgz", - "integrity": "sha512-HXwADeHEP4exXkCIwy2n1+i0f1ilP1ETQOH5KDOugjkTFZPntWo0Gr8stZOaebkxsdx+k0X/K6obU/+it07ocg==", - "dev": true - }, "node_modules/@types/geojson": { "version": "7946.0.10", "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz", @@ -2196,9 +2189,9 @@ } }, "node_modules/flexsearch": { - "version": "0.7.21", - "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.7.21.tgz", - "integrity": "sha512-W7cHV7Hrwjid6lWmy0IhsWDFQboWSng25U3VVywpHOTJnnAZNPScog67G+cVpeX9f7yDD21ih0WDrMMT+JoaYg==" + "version": "0.7.43", + "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.7.43.tgz", + "integrity": "sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg==" }, "node_modules/foreground-child": { "version": "3.1.1", diff --git a/package.json b/package.json index bbaa688bd..5ebe7eee1 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "cli-spinner": "^0.2.10", "d3": "^7.8.5", "esbuild-sass-plugin": "^2.16.0", - "flexsearch": "0.7.21", + "flexsearch": "0.7.43", "github-slugger": "^2.0.0", "globby": "^14.0.0", "gray-matter": "^4.0.3", @@ -93,7 +93,6 @@ "devDependencies": { "@types/cli-spinner": "^0.2.3", "@types/d3": "^7.4.3", - "@types/flexsearch": "^0.7.3", "@types/hast": "^3.0.3", "@types/js-yaml": "^4.0.9", "@types/node": "^20.1.2", diff --git a/quartz/cli/handlers.js b/quartz/cli/handlers.js index 6f8aad1ab..8e32620b3 100644 --- a/quartz/cli/handlers.js +++ b/quartz/cli/handlers.js @@ -258,6 +258,7 @@ export async function handleBuild(argv) { }, write: false, bundle: true, + minify: true, platform: "browser", format: "esm", }) diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts index df21f6b35..941d35bb3 100644 --- a/quartz/components/scripts/search.inline.ts +++ b/quartz/components/scripts/search.inline.ts @@ -1,4 +1,4 @@ -import { Document, SimpleDocumentSearchResultSetUnit } from "flexsearch" +import FlexSearch from "flexsearch" import { ContentDetails } from "../../plugins/emitters/contentIndex" import { registerEscapeHandler, removeAllChildren } from "./util" import { FullSlug, resolveRelative } from "../../util/path" @@ -11,7 +11,7 @@ interface Item { tags: string[] } -let index: Document | undefined = undefined +let index: FlexSearch.Document | undefined = undefined // Can be expanded with things like "term" in the future type SearchType = "basic" | "tags" @@ -250,7 +250,7 @@ document.addEventListener("nav", async (e: unknown) => { async function onType(e: HTMLElementEventMap["input"]) { let term = (e.target as HTMLInputElement).value - let searchResults: SimpleDocumentSearchResultSetUnit[] + let searchResults: FlexSearch.SimpleDocumentSearchResultSetUnit[] if (term.toLowerCase().startsWith("#")) { searchType = "tags" @@ -305,24 +305,23 @@ document.addEventListener("nav", async (e: unknown) => { // setup index if it hasn't been already if (!index) { - index = new Document({ + index = new FlexSearch.Document({ charset: "latin:extra", - optimize: true, encode: encoder, document: { id: "id", index: [ { field: "title", - tokenize: "reverse", + tokenize: "forward", }, { field: "content", - tokenize: "reverse", + tokenize: "forward", }, { field: "tags", - tokenize: "reverse", + tokenize: "forward", }, ], }, @@ -340,7 +339,7 @@ document.addEventListener("nav", async (e: unknown) => { * @param index index to fill * @param data data to fill index with */ -async function fillDocument(index: Document, data: any) { +async function fillDocument(index: FlexSearch.Document, data: any) { let id = 0 for (const [slug, fileData] of Object.entries(data)) { await index.addAsync(id, { diff --git a/tsconfig.json b/tsconfig.json index 784ab231b..df6e2ddfe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "experimentalDecorators": true, "module": "esnext", "target": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "strict": true, "incremental": true, "resolveJsonModule": true, From 2b62e29282f0e4572477f918162f8b5b4fbbcd51 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 27 Jan 2024 22:19:37 -0800 Subject: [PATCH 54/98] fix: revert bad tsconfig change --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index df6e2ddfe..784ab231b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "experimentalDecorators": true, "module": "esnext", "target": "esnext", - "moduleResolution": "bundler", + "moduleResolution": "node", "strict": true, "incremental": true, "resolveJsonModule": true, From a70078ccdcbb195fe487454e9e3f8612ccd5e7a1 Mon Sep 17 00:00:00 2001 From: LUCASTUCIOUS Date: Sun, 28 Jan 2024 07:21:32 +0100 Subject: [PATCH 55/98] feat: Option to mask folder count (#734) * Option to mask folder count * Update quartz/components/pages/FolderContent.tsx --------- Co-authored-by: Jacky Zhao --- quartz/components/pages/FolderContent.tsx | 86 ++++++++++++++--------- 1 file changed, 51 insertions(+), 35 deletions(-) diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx index 765f84657..1acb98a8a 100644 --- a/quartz/components/pages/FolderContent.tsx +++ b/quartz/components/pages/FolderContent.tsx @@ -8,40 +8,56 @@ import { Root } from "hast" import { pluralize } from "../../util/lang" import { htmlToJsx } from "../../util/jsx" -function FolderContent(props: QuartzComponentProps) { - const { tree, fileData, allFiles } = props - const folderSlug = _stripSlashes(simplifySlug(fileData.slug!)) - const allPagesInFolder = allFiles.filter((file) => { - const fileSlug = _stripSlashes(simplifySlug(file.slug!)) - const prefixed = fileSlug.startsWith(folderSlug) && fileSlug !== folderSlug - const folderParts = folderSlug.split(path.posix.sep) - const fileParts = fileSlug.split(path.posix.sep) - const isDirectChild = fileParts.length === folderParts.length + 1 - return prefixed && isDirectChild - }) - - const listProps = { - ...props, - allFiles: allPagesInFolder, - } - - const content = - (tree as Root).children.length === 0 - ? fileData.description - : htmlToJsx(fileData.filePath!, tree) - - return ( - - - {content} - - {pluralize(allPagesInFolder.length, "item")} under this folder. - - - - - ) +interface FolderContentOptions { + /** + * Whether to display number of folders + */ + showFolderCount: boolean } -FolderContent.css = style + PageList.css -export default (() => FolderContent) satisfies QuartzComponentConstructor +const defaultOptions: FolderContentOptions = { + showFolderCount: true, +} + +export default ((opts?: Partial) => { + // Merge options with defaults + const options: FolderContentOptions = { ...defaultOptions, ...opts } + + function FolderContent(props: QuartzComponentProps) { + const { tree, fileData, allFiles } = props + const folderSlug = _stripSlashes(simplifySlug(fileData.slug!)) + const allPagesInFolder = allFiles.filter((file) => { + const fileSlug = _stripSlashes(simplifySlug(file.slug!)) + const prefixed = fileSlug.startsWith(folderSlug) && fileSlug !== folderSlug + const folderParts = folderSlug.split(path.posix.sep) + const fileParts = fileSlug.split(path.posix.sep) + const isDirectChild = fileParts.length === folderParts.length + 1 + return prefixed && isDirectChild + }) + + const listProps = { + ...props, + allFiles: allPagesInFolder, + } + + const content = + (tree as Root).children.length === 0 + ? fileData.description + : htmlToJsx(fileData.filePath!, tree) + + return ( + + + {content} + + {options.showFolderCount && {pluralize(allPagesInFolder.length, "item")} under this folder.} + + + + + ) + } + + FolderContent.css = style + PageList.css + return FolderContent +}) satisfies QuartzComponentConstructor From ba40516c544f4196302364a84ee2cbecb331d46d Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 27 Jan 2024 22:24:13 -0800 Subject: [PATCH 56/98] fix: fmt --- quartz/components/pages/FolderContent.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx index 1acb98a8a..67cfa8dd4 100644 --- a/quartz/components/pages/FolderContent.tsx +++ b/quartz/components/pages/FolderContent.tsx @@ -20,7 +20,6 @@ const defaultOptions: FolderContentOptions = { } export default ((opts?: Partial) => { - // Merge options with defaults const options: FolderContentOptions = { ...defaultOptions, ...opts } function FolderContent(props: QuartzComponentProps) { @@ -50,7 +49,9 @@ export default ((opts?: Partial) => { {content} - {options.showFolderCount && {pluralize(allPagesInFolder.length, "item")} under this folder.} + {options.showFolderCount && ( + {pluralize(allPagesInFolder.length, "item")} under this folder. + )} From 211f95c5277be05b0f1768d36ad8d9129241e663 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 27 Jan 2024 22:49:57 -0800 Subject: [PATCH 57/98] fix: allow alt to be defined in wikilinks alongside dims --- quartz/plugins/transformers/ofm.ts | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 735d1146c..7c9b33bbd 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -116,13 +116,13 @@ export const externalLinkRegex = /^https?:\/\//i export const arrowRegex = new RegExp(/-{1,2}>/, "g") -// !? -> optional embedding -// \[\[ -> open brace -// ([^\[\]\|\#]+) -> one or more non-special characters ([,],|, or #) (name) -// (#[^\[\]\|\#]+)? -> # then one or more non-special characters (heading link) -// (|[^\[\]\|\#]+)? -> | then one or more non-special characters (alias) +// !? -> optional embedding +// \[\[ -> open brace +// ([^\[\]\|\#]+) -> one or more non-special characters ([,],|, or #) (name) +// (#[^\[\]\|\#]+)? -> # then one or more non-special characters (heading link) +// (\|[^\[\]\#]+)? -> | then one or more non-special characters (alias) export const wikilinkRegex = new RegExp( - /!?\[\[([^\[\]\|\#]+)?(#+[^\[\]\|\#]+)?(\|[^\[\]\|\#]+)?\]\]/, + /!?\[\[([^\[\]\|\#]+)?(#+[^\[\]\|\#]+)?(\|[^\[\]\#]+)?\]\]/, "g", ) const highlightRegex = new RegExp(/==([^=]+)==/, "g") @@ -222,7 +222,15 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin const ext: string = path.extname(fp).toLowerCase() const url = slugifyFilePath(fp as FilePath) if ([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg", ".webp"].includes(ext)) { - const dims = alias ?? "" + // either |alt|dims or |dims + let [alt, dims] = (alias ?? "").split("|") + + // |dims case, treat first alt slot as dims + if (dims === undefined) { + dims = alt + alt = "" + } + let [width, height] = dims.split("x", 2) width ||= "auto" height ||= "auto" @@ -233,6 +241,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin hProperties: { width, height, + alt, }, }, } From c4b756c8174255ac8c4a0d34769a3f886b24d3d5 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 27 Jan 2024 23:13:17 -0800 Subject: [PATCH 58/98] style: remove redundant webkit prefix --- quartz/styles/base.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 16be6ad53..d597ba7d5 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -4,7 +4,6 @@ html { scroll-behavior: smooth; - -webkit-text-size-adjust: none; text-size-adjust: none; overflow-x: hidden; width: 100vw; From bf5a556cc15edd311cf5cb7faab2509569e6af0a Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 28 Jan 2024 00:20:08 -0800 Subject: [PATCH 59/98] docs: improve first-time git setup --- docs/authoring content.md | 16 +++-------- docs/index.md | 3 +- docs/setting up your GitHub repository.md | 35 ++++++++++++++--------- quartz/cli/handlers.js | 15 +++++----- 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/docs/authoring content.md b/docs/authoring content.md index 248214037..c259e5011 100644 --- a/docs/authoring content.md +++ b/docs/authoring content.md @@ -28,21 +28,13 @@ The rest of your content lives here. You can use **Markdown** here :) Some common frontmatter fields that are natively supported by Quartz: - `title`: Title of the page. If it isn't provided, Quartz will use the name of the file as the title. +- `description`: Description of the page used for link previews. - `aliases`: Other names for this note. This is a list of strings. +- `tags`: Tags for this note. - `draft`: Whether to publish the page or not. This is one way to make [[private pages|pages private]] in Quartz. - `date`: A string representing the day the note was published. Normally uses `YYYY-MM-DD` format. ## Syncing your Content -When your Quartz is at a point you're happy with, you can save your changes to GitHub by doing `npx quartz sync`. - -> [!hint] Flags and options -> For full help options, you can run `npx quartz sync --help`. -> -> Most of these have sensible defaults but you can override them if you have a custom setup: -> -> - `-d` or `--directory`: the content folder. This is normally just `content` -> - `-v` or `--verbose`: print out extra logging information -> - `--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 +When your Quartz is at a point you're happy with, you can save your changes to GitHub. +First, make sure you've [[setting up your GitHub repository|already setup your GitHub repository]] and then do `npx quartz sync`. diff --git a/docs/index.md b/docs/index.md index 1cb02dc95..cbf8719d1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,7 +23,8 @@ This will guide you through initializing your Quartz with content. Once you've d 2. [[configuration|Configure]] Quartz's behaviour 3. Change Quartz's [[layout]] 4. [[build|Build and preview]] Quartz -5. [[hosting|Host]] Quartz online +5. Sync your changes with [[setting up your GitHub repository|GitHub]] +6. [[hosting|Host]] Quartz online If you prefer instructions in a video format you can try following Nicole van der Hoeven's [video guide on how to set up Quartz!](https://www.youtube.com/watch?v=6s6DT1yN4dw&t=227s) diff --git a/docs/setting up your GitHub repository.md b/docs/setting up your GitHub repository.md index 1b5461b51..43a556dc1 100644 --- a/docs/setting up your GitHub repository.md +++ b/docs/setting up your GitHub repository.md @@ -15,25 +15,34 @@ At the top of your repository on GitHub.com's Quick Setup page, click the clipb 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. ```bash -# add your repository -git remote add origin REMOTE-URL +# list all the repositories that are tracked +git remote -v -# track the main quartz repository for updates +# if the origin doesn't match your own repository, set your repository as the origin +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 ``` -To verify that you set the remote URL correctly, run the following command. - -```bash -git remote -v -``` - -Then, you can sync the content to upload it to your repository. +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. ```bash npx quartz sync --no-pull ``` -> [!hint] -> If `npx quartz sync` fails with `fatal: --[no-]autostash option is only valid with --rebase`, you -> may have an outdated version of `git`. Updating `git` should fix this issue. +> [!warning]- `fatal: --[no-]autostash option is only valid with --rebase` +> You may have an outdated version of `git`. Updating `git` should fix this issue. + +In future updates, you can simply run `npx quartz sync` every time you want to push updates to your repository. + +> [!hint] Flags and options +> For full help options, you can run `npx quartz sync --help`. +> +> Most of these have sensible defaults but you can override them if you have a custom setup: +> +> - `-d` or `--directory`: the content folder. This is normally just `content` +> - `-v` or `--verbose`: print out extra logging information +> - `--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 diff --git a/quartz/cli/handlers.js b/quartz/cli/handlers.js index 8e32620b3..b8b97b721 100644 --- a/quartz/cli/handlers.js +++ b/quartz/cli/handlers.js @@ -168,22 +168,20 @@ See the [documentation](https://quartz.jzhao.xyz) for how to get started. // get a preferred link resolution strategy linkResolutionStrategy = exitIfCancel( await select({ - message: `Choose how Quartz should resolve links in your content. You can change this later in \`quartz.config.ts\`.`, + message: `Choose how Quartz should resolve links in your content. This should match Obsidian's link format. You can change this later in \`quartz.config.ts\`.`, options: [ - { - value: "absolute", - label: "Treat links as absolute path", - hint: "for content made for Quartz 3 and Hugo", - }, { value: "shortest", label: "Treat links as shortest path", - hint: "for most Obsidian vaults", + hint: "(default)", + }, + { + value: "absolute", + label: "Treat links as absolute path", }, { value: "relative", label: "Treat links as relative paths", - hint: "for just normal Markdown files", }, ], }), @@ -202,6 +200,7 @@ See the [documentation](https://quartz.jzhao.xyz) for how to get started. // setup remote execSync( `git remote show upstream || git remote add upstream https://github.com/jackyzha0/quartz.git`, + { stdio: "ignore" }, ) outro(`You're all set! Not sure what to do next? Try: From 85f05ea99b16e246b5b86e5408ff35ffa52783e2 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 28 Jan 2024 21:27:16 -0800 Subject: [PATCH 60/98] fix: revert parsing dates in frontmatter --- quartz/plugins/transformers/frontmatter.ts | 32 --------------- quartz/plugins/transformers/lastmod.ts | 46 ++++++++++++++-------- 2 files changed, 29 insertions(+), 49 deletions(-) diff --git a/quartz/plugins/transformers/frontmatter.ts b/quartz/plugins/transformers/frontmatter.ts index 41c1b1375..eae359e1e 100644 --- a/quartz/plugins/transformers/frontmatter.ts +++ b/quartz/plugins/transformers/frontmatter.ts @@ -5,7 +5,6 @@ import yaml from "js-yaml" import toml from "toml" import { slugTag } from "../../util/path" import { QuartzPluginData } from "../vfile" -import chalk from "chalk" export interface Options { delims: string | string[] @@ -17,23 +16,6 @@ const defaultOptions: Options = { language: "yaml", } -function coerceDate(fp: string, d: unknown): Date | undefined { - if (d === undefined || d === null) return undefined - const dt = new Date(d as string | number) - const invalidDate = isNaN(dt.getTime()) || dt.getTime() === 0 - if (invalidDate) { - console.log( - chalk.yellow( - `\nWarning: found invalid date "${d}" in \`${fp}\`. Supported formats: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format`, - ), - ) - - return undefined - } - - return dt -} - function coalesceAliases(data: { [key: string]: any }, aliases: string[]) { for (const alias of aliases) { if (data[alias] !== undefined && data[alias] !== null) return data[alias] @@ -66,7 +48,6 @@ export const FrontMatter: QuartzTransformerPlugin | undefined> [remarkFrontmatter, ["yaml", "toml"]], () => { return (_, file) => { - const fp = file.data.filePath! const { data } = matter(Buffer.from(file.value), { ...opts, engines: { @@ -88,16 +69,6 @@ export const FrontMatter: QuartzTransformerPlugin | undefined> if (aliases) data.aliases = aliases const cssclasses = coerceToArray(coalesceAliases(data, ["cssclasses", "cssclass"])) if (cssclasses) data.cssclasses = cssclasses - const created = coerceDate(fp, coalesceAliases(data, ["created", "date"])) - - if (created) data.created = created - const modified = coerceDate( - fp, - coalesceAliases(data, ["modified", "lastmod", "updated", "last-modified"]), - ) - if (modified) data.modified = modified - const published = coerceDate(fp, coalesceAliases(data, ["published", "publishDate"])) - if (published) data.published = published // fill in frontmatter file.data.frontmatter = data as QuartzPluginData["frontmatter"] @@ -120,9 +91,6 @@ declare module "vfile" { draft: boolean enableToc: string cssclasses: string[] - created: Date - modified: Date - published: Date }> } } diff --git a/quartz/plugins/transformers/lastmod.ts b/quartz/plugins/transformers/lastmod.ts index 193664d65..31c8c2084 100644 --- a/quartz/plugins/transformers/lastmod.ts +++ b/quartz/plugins/transformers/lastmod.ts @@ -12,6 +12,21 @@ const defaultOptions: Options = { priority: ["frontmatter", "git", "filesystem"], } +function coerceDate(fp: string, d: any): Date { + const dt = new Date(d) + const invalidDate = isNaN(dt.getTime()) || dt.getTime() === 0 + if (invalidDate && d !== undefined) { + console.log( + chalk.yellow( + `\nWarning: found invalid date "${d}" in \`${fp}\`. Supported formats: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format`, + ), + ) + } + + return invalidDate ? new Date() : dt +} + +type MaybeDate = undefined | string | number export const CreatedModifiedDate: QuartzTransformerPlugin | undefined> = ( userOpts, ) => { @@ -23,21 +38,23 @@ export const CreatedModifiedDate: QuartzTransformerPlugin | und () => { let repo: Repository | undefined = undefined return async (_tree, file) => { - let created: Date | undefined = undefined - let modified: Date | undefined = undefined - let published: Date | undefined = undefined + let created: MaybeDate = undefined + let modified: MaybeDate = undefined + let published: MaybeDate = undefined const fp = file.data.filePath! const fullFp = path.posix.join(file.cwd, fp) for (const source of opts.priority) { if (source === "filesystem") { const st = await fs.promises.stat(fullFp) - created ||= new Date(st.birthtimeMs) - modified ||= new Date(st.mtimeMs) + created ||= st.birthtimeMs + modified ||= st.mtimeMs } else if (source === "frontmatter" && file.data.frontmatter) { - created ||= file.data.frontmatter.created - modified ||= file.data.frontmatter.modified - published ||= file.data.frontmatter.published + created ||= file.data.frontmatter.date as MaybeDate + modified ||= file.data.frontmatter.lastmod as MaybeDate + modified ||= file.data.frontmatter.updated as MaybeDate + modified ||= file.data.frontmatter["last-modified"] as MaybeDate + published ||= file.data.frontmatter.publishDate as MaybeDate } else if (source === "git") { if (!repo) { // Get a reference to the main git repo. @@ -47,9 +64,7 @@ export const CreatedModifiedDate: QuartzTransformerPlugin | und } try { - modified ||= new Date( - await repo.getFileLatestModifiedDateAsync(file.data.filePath!), - ) + modified ||= await repo.getFileLatestModifiedDateAsync(file.data.filePath!) } catch { console.log( chalk.yellow( @@ -61,13 +76,10 @@ export const CreatedModifiedDate: QuartzTransformerPlugin | und } } - created ||= new Date() - modified ||= new Date() - published ||= new Date() file.data.dates = { - created, - modified, - published, + created: coerceDate(fp, created), + modified: coerceDate(fp, modified), + published: coerceDate(fp, published), } } }, From b014d060f3f16b2460da08cdf88bef25d05d5d3b Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 28 Jan 2024 22:12:01 -0800 Subject: [PATCH 61/98] fix: content-disposition inline should apply to all resource types (closes #728) --- quartz/cli/handlers.js | 2 +- quartz/util/path.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quartz/cli/handlers.js b/quartz/cli/handlers.js index b8b97b721..12e7e8ec9 100644 --- a/quartz/cli/handlers.js +++ b/quartz/cli/handlers.js @@ -347,7 +347,7 @@ export async function handleBuild(argv) { directoryListing: false, headers: [ { - source: "**/*.html", + source: "**/*.*", headers: [{ key: "Content-Disposition", value: "inline" }], }, ], diff --git a/quartz/util/path.ts b/quartz/util/path.ts index 95acf119d..07f25a59d 100644 --- a/quartz/util/path.ts +++ b/quartz/util/path.ts @@ -52,7 +52,7 @@ function sluggify(s: string): string { .split("/") .map((segment) => segment.replace(/\s/g, "-").replace(/%/g, "-percent").replace(/\?/g, "-q").replace(/#/g, ""), - ) // slugify all segments + ) .join("/") // always use / as sep .replace(/\/$/, "") } From 16adbd30114bfcc1aaefa851a5a1786787f97a10 Mon Sep 17 00:00:00 2001 From: Mara-Li Date: Mon, 29 Jan 2024 07:12:48 +0100 Subject: [PATCH 62/98] fix: `cssclasses` was not applied on folder note (index) (#749) * docs: improve first-time git setup * fix: cssClasses was not applied on index page * refactor: remove vscode files * fix: format * fix: cssClasses should be applied on the entire div, not only the article * feat: support cssClasses for tag-listing --------- Co-authored-by: Jacky Zhao --- quartz/components/pages/FolderContent.tsx | 5 +++-- quartz/components/pages/TagContent.tsx | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx index 67cfa8dd4..436ed91fe 100644 --- a/quartz/components/pages/FolderContent.tsx +++ b/quartz/components/pages/FolderContent.tsx @@ -33,7 +33,8 @@ export default ((opts?: Partial) => { const isDirectChild = fileParts.length === folderParts.length + 1 return prefixed && isDirectChild }) - + const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? [] + const classes = ["popover-hint", ...cssClasses].join(" ") const listProps = { ...props, allFiles: allPagesInFolder, @@ -45,7 +46,7 @@ export default ((opts?: Partial) => { : htmlToJsx(fileData.filePath!, tree) return ( - + {content} diff --git a/quartz/components/pages/TagContent.tsx b/quartz/components/pages/TagContent.tsx index 890755bbc..50507461d 100644 --- a/quartz/components/pages/TagContent.tsx +++ b/quartz/components/pages/TagContent.tsx @@ -26,7 +26,8 @@ function TagContent(props: QuartzComponentProps) { (tree as Root).children.length === 0 ? fileData.description : htmlToJsx(fileData.filePath!, tree) - + const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? [] + const classes = ["popover-hint", ...cssClasses].join(" ") if (tag === "/") { const tags = [ ...new Set( @@ -37,9 +38,8 @@ function TagContent(props: QuartzComponentProps) { for (const tag of tags) { tagItemMap.set(tag, allPagesWithTag(tag)) } - return ( - + {content} @@ -81,7 +81,7 @@ function TagContent(props: QuartzComponentProps) { } return ( - + {content} {pluralize(pages.length, "item")} with this tag. From 603c181ad27109327617a78e5f672ebf68edc267 Mon Sep 17 00:00:00 2001 From: Mara-Li Date: Mon, 29 Jan 2024 07:13:59 +0100 Subject: [PATCH 63/98] feat: allow to config a translation for date (#739) * fix: alt error mix with height/width More granular detection of alt and resize in image * fix: format * feat: allow to translate the date displayed * style: format * fix: rename to fusion dateLocale with locale (i18n support) * Update quartz/components/PageList.tsx Co-authored-by: Jacky Zhao * remove default key as it was already set * add docstring for locale --------- Co-authored-by: Jacky Zhao --- quartz/cfg.ts | 6 ++++++ quartz/components/ContentMeta.tsx | 2 +- quartz/components/Date.tsx | 9 +++++---- quartz/components/PageList.tsx | 2 +- quartz/components/RecentNotes.tsx | 2 +- quartz/plugins/transformers/ofm.ts | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/quartz/cfg.ts b/quartz/cfg.ts index 7f0f206e1..153bbe21d 100644 --- a/quartz/cfg.ts +++ b/quartz/cfg.ts @@ -35,6 +35,12 @@ export interface GlobalConfiguration { */ baseUrl?: string theme: Theme + /** + * The locale to use for date formatting. Default to "en-US" + * Allow to translate the date in the language of your choice. + * Need to be formated following the IETF language tag format (https://en.wikipedia.org/wiki/IETF_language_tag) + */ + locale?: string } export interface QuartzConfig { diff --git a/quartz/components/ContentMeta.tsx b/quartz/components/ContentMeta.tsx index 254c5d405..5337feed8 100644 --- a/quartz/components/ContentMeta.tsx +++ b/quartz/components/ContentMeta.tsx @@ -24,7 +24,7 @@ export default ((opts?: Partial) => { const segments: string[] = [] if (fileData.dates) { - segments.push(formatDate(getDate(cfg, fileData)!)) + segments.push(formatDate(getDate(cfg, fileData)!, cfg.locale)) } // Display reading time if enabled diff --git a/quartz/components/Date.tsx b/quartz/components/Date.tsx index 8713cfd3c..6feac178c 100644 --- a/quartz/components/Date.tsx +++ b/quartz/components/Date.tsx @@ -3,6 +3,7 @@ import { QuartzPluginData } from "../plugins/vfile" interface Props { date: Date + locale?: string } export type ValidDateType = keyof Required["dates"] @@ -16,14 +17,14 @@ export function getDate(cfg: GlobalConfiguration, data: QuartzPluginData): Date return data.dates?.[cfg.defaultDateType] } -export function formatDate(d: Date): string { - return d.toLocaleDateString("en-US", { +export function formatDate(d: Date, locale = "en-US"): string { + return d.toLocaleDateString(locale, { year: "numeric", month: "short", day: "2-digit", }) } -export function Date({ date }: Props) { - return <>{formatDate(date)}> +export function Date({ date, locale }: Props) { + return <>{formatDate(date, locale)}> } diff --git a/quartz/components/PageList.tsx b/quartz/components/PageList.tsx index eb34f02f7..644e354c4 100644 --- a/quartz/components/PageList.tsx +++ b/quartz/components/PageList.tsx @@ -46,7 +46,7 @@ export function PageList({ cfg, fileData, allFiles, limit }: Props) { {page.dates && ( - + )} diff --git a/quartz/components/RecentNotes.tsx b/quartz/components/RecentNotes.tsx index 63f040d81..9a53ad7eb 100644 --- a/quartz/components/RecentNotes.tsx +++ b/quartz/components/RecentNotes.tsx @@ -47,7 +47,7 @@ export default ((userOpts?: Partial) => { {page.dates && ( - + )} diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 7c9b33bbd..1eeb78322 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -441,7 +441,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin value: ` - ${callouts[calloutType] ?? callouts.note} + ${callouts[calloutType] ?? callouts.note} ${title} ${collapse ? toggleIcon : ""} `, From b7152f743bc90411ffd5a9e59057a79be430751b Mon Sep 17 00:00:00 2001 From: Mara-Li Date: Mon, 29 Jan 2024 07:52:04 +0100 Subject: [PATCH 64/98] feat: div that encapsulate PageList component (#750) * feat: div that encapsulate PageList component * change class to follow review Co-authored-by: Jacky Zhao * apply page-listing div to TagContent --------- Co-authored-by: Jacky Zhao --- quartz/components/pages/FolderContent.tsx | 12 +++++++----- quartz/components/pages/TagContent.tsx | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx index 436ed91fe..47fb02f1b 100644 --- a/quartz/components/pages/FolderContent.tsx +++ b/quartz/components/pages/FolderContent.tsx @@ -50,11 +50,13 @@ export default ((opts?: Partial) => { {content} - {options.showFolderCount && ( - {pluralize(allPagesInFolder.length, "item")} under this folder. - )} - - + + {options.showFolderCount && ( + {pluralize(allPagesInFolder.length, "item")} under this folder. + )} + + + ) diff --git a/quartz/components/pages/TagContent.tsx b/quartz/components/pages/TagContent.tsx index 50507461d..ec30c5ff9 100644 --- a/quartz/components/pages/TagContent.tsx +++ b/quartz/components/pages/TagContent.tsx @@ -62,11 +62,13 @@ function TagContent(props: QuartzComponentProps) { {content && {content}} - - {pluralize(pages.length, "item")} with this tag.{" "} - {pages.length > numPages && `Showing first ${numPages}.`} - - + + + {pluralize(pages.length, "item")} with this tag.{" "} + {pages.length > numPages && `Showing first ${numPages}.`} + + + ) })} @@ -83,9 +85,11 @@ function TagContent(props: QuartzComponentProps) { return ( {content} - {pluralize(pages.length, "item")} with this tag. - - + + {pluralize(pages.length, "item")} with this tag. + + + ) From f68872c09f011b12db9de360eb852010bd07ed79 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Mon, 29 Jan 2024 02:38:59 -0500 Subject: [PATCH 65/98] feat(icon): update content for gfm links (#751) * feat(icon): update content for gfm links Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * chore: remove unused var Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * fix: inherit display to remove additional spacing Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * revert: remove redundant svg attribute Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --------- Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- quartz/plugins/transformers/gfm.ts | 32 ++++++++++++++++++++++++++++-- quartz/styles/base.scss | 1 - 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/quartz/plugins/transformers/gfm.ts b/quartz/plugins/transformers/gfm.ts index 40c2205d3..7860f851c 100644 --- a/quartz/plugins/transformers/gfm.ts +++ b/quartz/plugins/transformers/gfm.ts @@ -37,8 +37,36 @@ export const GitHubFlavoredMarkdown: QuartzTransformerPlugin | "data-no-popover": true, }, content: { - type: "text", - value: " §", + type: "element", + tagName: "svg", + properties: { + width: 18, + height: 18, + viewBox: "0 0 24 24", + fill: "none", + stroke: "currentColor", + "stroke-width": "2", + "stroke-linecap": "round", + "stroke-linejoin": "round", + }, + children: [ + { + type: "element", + tagName: "path", + properties: { + d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", + }, + children: [], + }, + { + type: "element", + tagName: "path", + properties: { + d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", + }, + children: [], + }, + ], }, }, ], diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index d597ba7d5..65e68f3a5 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -276,7 +276,6 @@ h6 { opacity: 0; transition: opacity 0.2s ease; transform: translateY(-0.1rem); - display: inline-block; font-family: var(--codeFont); user-select: none; } From 76be137283a497c88b7da445cd9f4b8533a04f35 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 29 Jan 2024 00:56:12 -0800 Subject: [PATCH 66/98] fix: attempt to merge cached folder state between builds (closes #691) --- quartz/components/Explorer.tsx | 3 +- quartz/components/scripts/explorer.inline.ts | 156 ++++++++----------- quartz/components/scripts/toc.inline.ts | 6 +- 3 files changed, 68 insertions(+), 97 deletions(-) diff --git a/quartz/components/Explorer.tsx b/quartz/components/Explorer.tsx index e3ed9b1cc..fdfff23b1 100644 --- a/quartz/components/Explorer.tsx +++ b/quartz/components/Explorer.tsx @@ -69,9 +69,8 @@ export default ((userOpts?: Partial) => { } // Get all folders of tree. Initialize with collapsed state - const folders = fileTree.getFolderPaths(opts.folderDefaultState === "collapsed") - // Stringify to pass json tree as data attribute ([data-tree]) + const folders = fileTree.getFolderPaths(opts.folderDefaultState === "collapsed") jsonTree = JSON.stringify(folders) } diff --git a/quartz/components/scripts/explorer.inline.ts b/quartz/components/scripts/explorer.inline.ts index 8e79d200e..12546bbb0 100644 --- a/quartz/components/scripts/explorer.inline.ts +++ b/quartz/components/scripts/explorer.inline.ts @@ -1,132 +1,106 @@ import { FolderState } from "../ExplorerNode" -// Current state of folders -let explorerState: FolderState[] - +type MaybeHTMLElement = HTMLElement | undefined +let currentExplorerState: FolderState[] const observer = new IntersectionObserver((entries) => { // If last element is observed, remove gradient of "overflow" class so element is visible - const explorer = document.getElementById("explorer-ul") + const explorerUl = document.getElementById("explorer-ul") + if (!explorerUl) return for (const entry of entries) { if (entry.isIntersecting) { - explorer?.classList.add("no-background") + explorerUl.classList.add("no-background") } else { - explorer?.classList.remove("no-background") + explorerUl.classList.remove("no-background") } } }) function toggleExplorer(this: HTMLElement) { - // Toggle collapsed state of entire explorer this.classList.toggle("collapsed") - const content = this.nextElementSibling as HTMLElement + const content = this.nextElementSibling as MaybeHTMLElement + if (!content) return + content.classList.toggle("collapsed") content.style.maxHeight = content.style.maxHeight === "0px" ? content.scrollHeight + "px" : "0px" } function toggleFolder(evt: MouseEvent) { evt.stopPropagation() + const target = evt.target as MaybeHTMLElement + if (!target) return - // Element that was clicked - const target = evt.target as HTMLElement - - // Check if target was svg icon or button const isSvg = target.nodeName === "svg" + const childFolderContainer = ( + isSvg + ? target.parentElement?.nextSibling + : target.parentElement?.parentElement?.nextElementSibling + ) as MaybeHTMLElement + const currentFolderParent = ( + isSvg ? target.nextElementSibling : target.parentElement + ) as MaybeHTMLElement + if (!(childFolderContainer && currentFolderParent)) return - // corresponding element relative to clicked button/folder - let childFolderContainer: HTMLElement - - // element of folder (stores folder-path dataset) - let currentFolderParent: HTMLElement - - // Get correct relative container and toggle collapsed class - if (isSvg) { - childFolderContainer = target.parentElement?.nextSibling as HTMLElement - currentFolderParent = target.nextElementSibling as HTMLElement - - childFolderContainer.classList.toggle("open") - } else { - childFolderContainer = target.parentElement?.parentElement?.nextElementSibling as HTMLElement - currentFolderParent = target.parentElement as HTMLElement - - childFolderContainer.classList.toggle("open") - } - if (!childFolderContainer) return - - // Collapse folder container + childFolderContainer.classList.toggle("open") const isCollapsed = childFolderContainer.classList.contains("open") setFolderState(childFolderContainer, !isCollapsed) - - // Save folder state to localStorage - const clickFolderPath = currentFolderParent.dataset.folderpath as string - - const fullFolderPath = clickFolderPath - toggleCollapsedByPath(explorerState, fullFolderPath) - - const stringifiedFileTree = JSON.stringify(explorerState) + const fullFolderPath = currentFolderParent.dataset.folderpath as string + toggleCollapsedByPath(currentExplorerState, fullFolderPath) + const stringifiedFileTree = JSON.stringify(currentExplorerState) localStorage.setItem("fileTree", stringifiedFileTree) } function setupExplorer() { - // Set click handler for collapsing entire explorer const explorer = document.getElementById("explorer") + if (!explorer) return + + if (explorer.dataset.behavior === "collapse") { + for (const item of document.getElementsByClassName( + "folder-button", + ) as HTMLCollectionOf) { + item.removeEventListener("click", toggleFolder) + item.addEventListener("click", toggleFolder) + } + } + + explorer.removeEventListener("click", toggleExplorer) + explorer.addEventListener("click", toggleExplorer) + + // Set up click handlers for each folder (click handler on folder "icon") + for (const item of document.getElementsByClassName( + "folder-icon", + ) as HTMLCollectionOf) { + item.removeEventListener("click", toggleFolder) + item.addEventListener("click", toggleFolder) + } // Get folder state from local storage const storageTree = localStorage.getItem("fileTree") - - // Convert to bool const useSavedFolderState = explorer?.dataset.savestate === "true" + const oldExplorerState: FolderState[] = + storageTree && useSavedFolderState ? JSON.parse(storageTree) : [] + const oldIndex = new Map(oldExplorerState.map((entry) => [entry.path, entry.collapsed])) + const newExplorerState: FolderState[] = explorer.dataset.tree + ? JSON.parse(explorer.dataset.tree) + : [] + currentExplorerState = [] + for (const { path, collapsed } of newExplorerState) { + currentExplorerState.push({ path, collapsed: oldIndex.get(path) ?? collapsed }) + } - if (explorer) { - // Get config - const collapseBehavior = explorer.dataset.behavior - - // Add click handlers for all folders (click handler on folder "label") - if (collapseBehavior === "collapse") { - Array.prototype.forEach.call( - document.getElementsByClassName("folder-button"), - function (item) { - item.removeEventListener("click", toggleFolder) - item.addEventListener("click", toggleFolder) - }, - ) + currentExplorerState.map((folderState) => { + const folderLi = document.querySelector( + `[data-folderpath='${folderState.path}']`, + ) as MaybeHTMLElement + const folderUl = folderLi?.parentElement?.nextElementSibling as MaybeHTMLElement + if (folderUl) { + setFolderState(folderUl, folderState.collapsed) } - - // Add click handler to main explorer - explorer.removeEventListener("click", toggleExplorer) - explorer.addEventListener("click", toggleExplorer) - } - - // Set up click handlers for each folder (click handler on folder "icon") - Array.prototype.forEach.call(document.getElementsByClassName("folder-icon"), function (item) { - item.removeEventListener("click", toggleFolder) - item.addEventListener("click", toggleFolder) }) - - if (storageTree && useSavedFolderState) { - // Get state from localStorage and set folder state - explorerState = JSON.parse(storageTree) - explorerState.map((folderUl) => { - // grab element for matching folder path - const folderLi = document.querySelector(`[data-folderpath='${folderUl.path}']`) as HTMLElement - - // Get corresponding content tag and set state - if (folderLi) { - const folderUL = folderLi.parentElement?.nextElementSibling - if (folderUL) { - setFolderState(folderUL as HTMLElement, folderUl.collapsed) - } - } - }) - } else if (explorer?.dataset.tree) { - // If tree is not in localStorage or config is disabled, use tree passed from Explorer as dataset - explorerState = JSON.parse(explorer.dataset.tree) - } } window.addEventListener("resize", setupExplorer) document.addEventListener("nav", () => { setupExplorer() - observer.disconnect() // select pseudo element at end of list @@ -142,11 +116,7 @@ document.addEventListener("nav", () => { * @param collapsed if folder should be set to collapsed or not */ function setFolderState(folderElement: HTMLElement, collapsed: boolean) { - if (collapsed) { - folderElement?.classList.remove("open") - } else { - folderElement?.classList.add("open") - } + return collapsed ? folderElement.classList.remove("open") : folderElement.classList.add("open") } /** diff --git a/quartz/components/scripts/toc.inline.ts b/quartz/components/scripts/toc.inline.ts index f3da52cd5..2e1e52b0e 100644 --- a/quartz/components/scripts/toc.inline.ts +++ b/quartz/components/scripts/toc.inline.ts @@ -16,7 +16,8 @@ const observer = new IntersectionObserver((entries) => { function toggleToc(this: HTMLElement) { this.classList.toggle("collapsed") - const content = this.nextElementSibling as HTMLElement + const content = this.nextElementSibling as HTMLElement | undefined + if (!content) return content.classList.toggle("collapsed") content.style.maxHeight = content.style.maxHeight === "0px" ? content.scrollHeight + "px" : "0px" } @@ -25,7 +26,8 @@ function setupToc() { const toc = document.getElementById("toc") if (toc) { const collapsed = toc.classList.contains("collapsed") - const content = toc.nextElementSibling as HTMLElement + const content = toc.nextElementSibling as HTMLElement | undefined + if (!content) return content.style.maxHeight = collapsed ? "0px" : content.scrollHeight + "px" toc.removeEventListener("click", toggleToc) toc.addEventListener("click", toggleToc) From 2d727443b3cc716ea057a897f588e2c563102d5c Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 29 Jan 2024 09:36:36 -0800 Subject: [PATCH 67/98] fix: implement regex fix for alt in image wikilinks (closes #753) --- quartz/plugins/transformers/ofm.ts | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 1eeb78322..3757f4212 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -138,6 +138,7 @@ const tagRegex = new RegExp(/(?:^| )#((?:[-_\p{L}\p{Emoji}\d])+(?:\/[-_\p{L}\p{E const blockReferenceRegex = new RegExp(/\^([-_A-Za-z0-9]+)$/, "g") const ytLinkRegex = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/ const videoExtensionRegex = new RegExp(/\.(mp4|webm|ogg|avi|mov|flv|wmv|mkv|mpg|mpeg|3gp|m4v)$/) +const wikilinkImageEmbedRegex = new RegExp(/^(?(?!^\d*x?\d*$).*?)?(\|?\s*?(?\d+)(x(?\d+))?)?$/) export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin | undefined> = ( userOpts, @@ -222,18 +223,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin const ext: string = path.extname(fp).toLowerCase() const url = slugifyFilePath(fp as FilePath) if ([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg", ".webp"].includes(ext)) { - // either |alt|dims or |dims - let [alt, dims] = (alias ?? "").split("|") - - // |dims case, treat first alt slot as dims - if (dims === undefined) { - dims = alt - alt = "" - } - - let [width, height] = dims.split("x", 2) - width ||= "auto" - height ||= "auto" + const match = wikilinkImageEmbedRegex.exec(alias ?? "") + const alt = match?.groups?.alt ?? "" + const width = match?.groups?.width ?? "auto" + const height = match?.groups?.height ?? "auto" return { type: "image", url, @@ -267,9 +260,8 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin return { type: "html", data: { hProperties: { transclude: true } }, - value: `Transclude of ${url}${block}`, + value: `Transclude of ${url}${block}`, } } @@ -467,9 +459,8 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin node.data = { hProperties: { ...(node.data?.hProperties ?? {}), - className: `callout ${calloutType} ${collapse ? "is-collapsible" : ""} ${ - defaultState === "collapsed" ? "is-collapsed" : "" - }`, + className: `callout ${calloutType} ${collapse ? "is-collapsible" : ""} ${defaultState === "collapsed" ? "is-collapsed" : "" + }`, "data-callout": calloutType, "data-callout-fold": collapse, }, From ebf429a9c66e206109f17f6f961e3a874c2157cf Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 29 Jan 2024 09:38:14 -0800 Subject: [PATCH 68/98] fix: fmt --- quartz/plugins/transformers/ofm.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 3757f4212..fc98bb2a3 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -138,7 +138,9 @@ const tagRegex = new RegExp(/(?:^| )#((?:[-_\p{L}\p{Emoji}\d])+(?:\/[-_\p{L}\p{E const blockReferenceRegex = new RegExp(/\^([-_A-Za-z0-9]+)$/, "g") const ytLinkRegex = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/ const videoExtensionRegex = new RegExp(/\.(mp4|webm|ogg|avi|mov|flv|wmv|mkv|mpg|mpeg|3gp|m4v)$/) -const wikilinkImageEmbedRegex = new RegExp(/^(?(?!^\d*x?\d*$).*?)?(\|?\s*?(?\d+)(x(?\d+))?)?$/) +const wikilinkImageEmbedRegex = new RegExp( + /^(?(?!^\d*x?\d*$).*?)?(\|?\s*?(?\d+)(x(?\d+))?)?$/, +) export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin | undefined> = ( userOpts, @@ -260,8 +262,9 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin return { type: "html", data: { hProperties: { transclude: true } }, - value: `Transclude of ${url}${block}`, + value: `Transclude of ${url}${block}`, } } @@ -459,8 +462,9 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin node.data = { hProperties: { ...(node.data?.hProperties ?? {}), - className: `callout ${calloutType} ${collapse ? "is-collapsible" : ""} ${defaultState === "collapsed" ? "is-collapsed" : "" - }`, + className: `callout ${calloutType} ${collapse ? "is-collapsible" : ""} ${ + defaultState === "collapsed" ? "is-collapsed" : "" + }`, "data-callout": calloutType, "data-callout-fold": collapse, }, From b85a3543f4aa9424cca02f544723a8329d2d972f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:40:55 -0800 Subject: [PATCH 69/98] chore(deps): bump @napi-rs/simple-git from 0.1.11 to 0.1.14 (#756) Bumps [@napi-rs/simple-git](https://github.com/Brooooooklyn/simple-git) from 0.1.11 to 0.1.14. - [Release notes](https://github.com/Brooooooklyn/simple-git/releases) - [Commits](https://github.com/Brooooooklyn/simple-git/compare/v0.1.11...v0.1.14) --- updated-dependencies: - dependency-name: "@napi-rs/simple-git" 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 | 96 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/package-lock.json b/package-lock.json index 594c5ad3f..98e0b5257 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@clack/prompts": "^0.7.0", "@floating-ui/dom": "^1.5.3", - "@napi-rs/simple-git": "0.1.11", + "@napi-rs/simple-git": "0.1.14", "async-mutex": "^0.4.0", "chalk": "^5.3.0", "chokidar": "^3.5.3", @@ -517,30 +517,30 @@ } }, "node_modules/@napi-rs/simple-git": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git/-/simple-git-0.1.11.tgz", - "integrity": "sha512-z14cPCBrtDKKVJ3q4GS5gmXEithGUAt+U8sICgA9i3UFdxJKD4H5rCnO7BVC3htdE9g6OR2w2IcHAL56AjpFbg==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git/-/simple-git-0.1.14.tgz", + "integrity": "sha512-2cDnsT0nKpQ7yg5u/Zf8/ibp9YFIKhpcfMAGATYuqdJoHuBo6P6UArZ0RDOOtfFC5b9FXuYcGw2ApbM4eWdnbQ==", "engines": { "node": ">= 10" }, "optionalDependencies": { - "@napi-rs/simple-git-android-arm-eabi": "0.1.11", - "@napi-rs/simple-git-android-arm64": "0.1.11", - "@napi-rs/simple-git-darwin-arm64": "0.1.11", - "@napi-rs/simple-git-darwin-x64": "0.1.11", - "@napi-rs/simple-git-linux-arm-gnueabihf": "0.1.11", - "@napi-rs/simple-git-linux-arm64-gnu": "0.1.11", - "@napi-rs/simple-git-linux-arm64-musl": "0.1.11", - "@napi-rs/simple-git-linux-x64-gnu": "0.1.11", - "@napi-rs/simple-git-linux-x64-musl": "0.1.11", - "@napi-rs/simple-git-win32-arm64-msvc": "0.1.11", - "@napi-rs/simple-git-win32-x64-msvc": "0.1.11" + "@napi-rs/simple-git-android-arm-eabi": "0.1.14", + "@napi-rs/simple-git-android-arm64": "0.1.14", + "@napi-rs/simple-git-darwin-arm64": "0.1.14", + "@napi-rs/simple-git-darwin-x64": "0.1.14", + "@napi-rs/simple-git-linux-arm-gnueabihf": "0.1.14", + "@napi-rs/simple-git-linux-arm64-gnu": "0.1.14", + "@napi-rs/simple-git-linux-arm64-musl": "0.1.14", + "@napi-rs/simple-git-linux-x64-gnu": "0.1.14", + "@napi-rs/simple-git-linux-x64-musl": "0.1.14", + "@napi-rs/simple-git-win32-arm64-msvc": "0.1.14", + "@napi-rs/simple-git-win32-x64-msvc": "0.1.14" } }, "node_modules/@napi-rs/simple-git-android-arm-eabi": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm-eabi/-/simple-git-android-arm-eabi-0.1.11.tgz", - "integrity": "sha512-wt4Wu9MxvKzEqT4iwodFs7Nrc31K73gR5hM7VnlO6iLELmUQZ5JVJkYoFWgzLQWtzIC48W2+zFMbBgY6+F2rZg==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm-eabi/-/simple-git-android-arm-eabi-0.1.14.tgz", + "integrity": "sha512-fAJ/Hxc9DhtSHOcB3dPCRW1YcVsqAnbNoOOnHir4aDCtqTP64HrFa7A/675v3vQZpI0u3fXHRcYqW8NF0O/zcg==", "cpu": [ "arm" ], @@ -553,9 +553,9 @@ } }, "node_modules/@napi-rs/simple-git-android-arm64": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm64/-/simple-git-android-arm64-0.1.11.tgz", - "integrity": "sha512-5/Aj6N44CxwhV3TZWRZ4vGqFj4wb2/a2gwvUZJo9Dwik9Spls7As8LaLe7pOptiGPH0GRP3H5kTT7I6twHNgqw==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-android-arm64/-/simple-git-android-arm64-0.1.14.tgz", + "integrity": "sha512-dav730MRAR142DoyNDafuwKXcUCYwlbxxxxOarDph7bbN0mZZnKHOQohvRCD/Uz4aJLaj6khCavXSjLDWArEUg==", "cpu": [ "arm64" ], @@ -568,9 +568,9 @@ } }, "node_modules/@napi-rs/simple-git-darwin-arm64": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-arm64/-/simple-git-darwin-arm64-0.1.11.tgz", - "integrity": "sha512-vdVsJUNcRsGVu0hBmLZdxxgwIbJA/Ias8NKWze8MZkZ3VyBwhg0uAzFgESEL3/USAgeCCHjF3uwVki8E+iPq1w==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-arm64/-/simple-git-darwin-arm64-0.1.14.tgz", + "integrity": "sha512-f6+DqRnI+vFvnsAyw66mWhwl0vw1TOieHV07hvKbg4PU5j+RBI+lVqwY2L+IEAxDFlPirTWKKvGY1Lr7M/yi/A==", "cpu": [ "arm64" ], @@ -583,9 +583,9 @@ } }, "node_modules/@napi-rs/simple-git-darwin-x64": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-x64/-/simple-git-darwin-x64-0.1.11.tgz", - "integrity": "sha512-ufVuZxyJ3LpApk3V101X9qYNX91fnQ4isulz9lWjg90U7Xz0Cav4J3yyFZy6B/cJpYxuiy49R8wV1xDtTeGThA==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-darwin-x64/-/simple-git-darwin-x64-0.1.14.tgz", + "integrity": "sha512-x/EnwJdDWJAFay8TQt09byJoBlVZhPEaTAPmRR0fUPzWTjrr28bOy8UW1ysszd9ylBxlyIhuWjOHMHu9CBigTQ==", "cpu": [ "x64" ], @@ -598,9 +598,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-arm-gnueabihf": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm-gnueabihf/-/simple-git-linux-arm-gnueabihf-0.1.11.tgz", - "integrity": "sha512-rFafW0Qc/j5we2ghUecB7mFzGcNDtJ5lTiB4I7kffNeL8pEi6Yi7kST8hylswcCowia65d45xsyeNp1mFlFwcg==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm-gnueabihf/-/simple-git-linux-arm-gnueabihf-0.1.14.tgz", + "integrity": "sha512-k0JZaXBl031gP5VOnoMa1I3lCHlBG7QvtunX5rxnRjx2kZ+JgUyT12s/qle/4xkJ0MnmfKTeiD7hs4Cc4Z3Tzw==", "cpu": [ "arm" ], @@ -613,9 +613,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-arm64-gnu": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-gnu/-/simple-git-linux-arm64-gnu-0.1.11.tgz", - "integrity": "sha512-HZ4yaqpj/FQ3V9qNQrTGhtXb7pLAARXeRJrwoaGfz3eZ069y2bHReFcNR//5bsVhZ18JaS9EV47F8WjDxtpI5g==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-gnu/-/simple-git-linux-arm64-gnu-0.1.14.tgz", + "integrity": "sha512-CsmKP6tSIxau10ZKxV1Q1kem2QcJ/Qlov7pxp1Q7kMErcouW0H6vliVniewicaXRVDYV9wK18iD2t5GoJttwlA==", "cpu": [ "arm64" ], @@ -628,9 +628,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-arm64-musl": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-musl/-/simple-git-linux-arm64-musl-0.1.11.tgz", - "integrity": "sha512-b39lJiC3n2+Y6Exjx6qwHoBF++D3k2hN4mZZkvQCFSdLXJ2xtalCatSRWW3pt+mHOHMOgbGektL5v5BYq52hxw==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-arm64-musl/-/simple-git-linux-arm64-musl-0.1.14.tgz", + "integrity": "sha512-krfEckZQ3myoHwmGmqY0aHBnqAzzV66+jFNLQEKaVMSGsXA2P+UcGo0coGzmB13rFRWC2eZpZRNB3MrfrStHkw==", "cpu": [ "arm64" ], @@ -643,9 +643,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-x64-gnu": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-gnu/-/simple-git-linux-x64-gnu-0.1.11.tgz", - "integrity": "sha512-9EPFvY7PZg+oqWi6Jft5WgSsQtvy9Ey1g4NG+LG8y1RbvaNKthxKbR5zgx196pnFVdcLtsuIdOv/OaQlbcTXkw==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-gnu/-/simple-git-linux-x64-gnu-0.1.14.tgz", + "integrity": "sha512-4T2Q2QdO6t3OawkwdVmdqLz2EH8lfAw2cMT/zdjfTMfhNKjJgSg3kTgRnu/tf8TLCb+wu80fFvafwE0laB2VTQ==", "cpu": [ "x64" ], @@ -658,9 +658,9 @@ } }, "node_modules/@napi-rs/simple-git-linux-x64-musl": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-musl/-/simple-git-linux-x64-musl-0.1.11.tgz", - "integrity": "sha512-doIt1lPYIGL3UthlEQjdM9s1Wv0v8bz8LVAgbzJMS+UpVZzArwLWkanAJCy1HjgMTUMiE3AVJqACKIF3EfW/TQ==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-linux-x64-musl/-/simple-git-linux-x64-musl-0.1.14.tgz", + "integrity": "sha512-RaTGW8u+RXJbfRF4QN2Dcr5r5DrFh4wLjOvFeOy7sGX3Q9m3IKuw5AjRxTJqIw6xD/AAPKKNzOvPjrIF7728Lw==", "cpu": [ "x64" ], @@ -673,9 +673,9 @@ } }, "node_modules/@napi-rs/simple-git-win32-arm64-msvc": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-arm64-msvc/-/simple-git-win32-arm64-msvc-0.1.11.tgz", - "integrity": "sha512-TK3Uvj3Q72ebxfxDT/eLFt8sxCNHo20QMvqJ5BHt4zP1Y9Fl1DXSPRUKLBIhJd0nPcI45ZOMRiZyoT8joxAC9g==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-arm64-msvc/-/simple-git-win32-arm64-msvc-0.1.14.tgz", + "integrity": "sha512-kb9bKG9t79HJMuRMqbUJFLfWRf952O2Ea4VFwoRA2d/Uwtowm85Ol3JV9E6oeurguRLqdMLrUKyduCW6Hc9Jsg==", "cpu": [ "arm64" ], @@ -688,9 +688,9 @@ } }, "node_modules/@napi-rs/simple-git-win32-x64-msvc": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-x64-msvc/-/simple-git-win32-x64-msvc-0.1.11.tgz", - "integrity": "sha512-XOgP6kFDXGmB2KCXFQEsCq70n/Do2h7W9o7qZu8APAD+Sc8JGKz4hKG7PKY2ot924v9nIoKSYbHnupnhXSoXkg==", + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@napi-rs/simple-git-win32-x64-msvc/-/simple-git-win32-x64-msvc-0.1.14.tgz", + "integrity": "sha512-3835xy0e2gOaZ3SPt1pINBFSBBL3dOx3cChyAzQU0TnMU4Ye/YOh1qa5pO7BOJlCSnOh7iWt782blxCT0HH61w==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 5ebe7eee1..670fef043 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "dependencies": { "@clack/prompts": "^0.7.0", "@floating-ui/dom": "^1.5.3", - "@napi-rs/simple-git": "0.1.11", + "@napi-rs/simple-git": "0.1.14", "async-mutex": "^0.4.0", "chalk": "^5.3.0", "chokidar": "^3.5.3", From b8ddf53aa8b72286ee55373384447f862a52a91a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:41:33 -0800 Subject: [PATCH 70/98] chore(deps): bump rfdc from 1.3.0 to 1.3.1 (#759) Bumps [rfdc](https://github.com/davidmarkclements/rfdc) from 1.3.0 to 1.3.1. - [Commits](https://github.com/davidmarkclements/rfdc/compare/v1.3.0...v1.3.1) --- updated-dependencies: - dependency-name: rfdc 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 98e0b5257..04e764dc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "remark-smartypants": "^2.0.0", - "rfdc": "^1.3.0", + "rfdc": "^1.3.1", "rimraf": "^5.0.5", "serve-handler": "^6.1.5", "shikiji": "^0.10.2", @@ -5171,9 +5171,9 @@ } }, "node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==" }, "node_modules/rimraf": { "version": "5.0.5", diff --git a/package.json b/package.json index 670fef043..ce156f4ec 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "remark-smartypants": "^2.0.0", - "rfdc": "^1.3.0", + "rfdc": "^1.3.1", "rimraf": "^5.0.5", "serve-handler": "^6.1.5", "shikiji": "^0.10.2", From 5f624edb38c9c95415537fcccb5df616a12ebe56 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:41:51 -0800 Subject: [PATCH 71/98] chore(deps): bump remark-rehype from 11.0.0 to 11.1.0 (#758) Bumps [remark-rehype](https://github.com/remarkjs/remark-rehype) from 11.0.0 to 11.1.0. - [Release notes](https://github.com/remarkjs/remark-rehype/releases) - [Commits](https://github.com/remarkjs/remark-rehype/compare/11.0.0...11.1.0) --- updated-dependencies: - dependency-name: remark-rehype 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 | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 04e764dc1..1a115e250 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "remark-gfm": "^4.0.0", "remark-math": "^6.0.0", "remark-parse": "^11.0.0", - "remark-rehype": "^11.0.0", + "remark-rehype": "^11.1.0", "remark-smartypants": "^2.0.0", "rfdc": "^1.3.1", "rimraf": "^5.0.5", @@ -4854,9 +4854,9 @@ } }, "node_modules/remark-rehype": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.0.0.tgz", - "integrity": "sha512-vx8x2MDMcxuE4lBmQ46zYUDfcFMmvg80WYX+UNLeG6ixjdCCLcw1lrgAukwBTuOFsS78eoAedHGn9sNM0w7TPw==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.0.tgz", + "integrity": "sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g==", "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", diff --git a/package.json b/package.json index ce156f4ec..b1580751b 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "remark-gfm": "^4.0.0", "remark-math": "^6.0.0", "remark-parse": "^11.0.0", - "remark-rehype": "^11.0.0", + "remark-rehype": "^11.1.0", "remark-smartypants": "^2.0.0", "rfdc": "^1.3.1", "rimraf": "^5.0.5", From fbb4d7e39928d7e4c7d6cdea3566e00f58f1a0b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:45:37 -0800 Subject: [PATCH 72/98] chore(deps): bump workerpool from 8.0.0 to 9.1.0 (#757) * chore(deps): bump workerpool from 8.0.0 to 9.1.0 Bumps [workerpool](https://github.com/josdejong/workerpool) from 8.0.0 to 9.1.0. - [Changelog](https://github.com/josdejong/workerpool/blob/master/HISTORY.md) - [Commits](https://github.com/josdejong/workerpool/compare/v8.0.0...v9.1.0) --- updated-dependencies: - dependency-name: workerpool dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * remove @types/workerpool --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacky Zhao --- package-lock.json | 18 ++++-------------- package.json | 3 +-- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1a115e250..22dc37f1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,7 +61,7 @@ "unified": "^11.0.4", "unist-util-visit": "^5.0.0", "vfile": "^6.0.1", - "workerpool": "^8.0.0", + "workerpool": "^9.1.0", "ws": "^8.15.1", "yargs": "^17.7.2" }, @@ -76,7 +76,6 @@ "@types/node": "^20.1.2", "@types/pretty-time": "^1.1.5", "@types/source-map-support": "^0.5.10", - "@types/workerpool": "^6.4.7", "@types/ws": "^8.5.10", "@types/yargs": "^17.0.32", "esbuild": "^0.19.9", @@ -1114,15 +1113,6 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==" }, - "node_modules/@types/workerpool": { - "version": "6.4.7", - "resolved": "https://registry.npmjs.org/@types/workerpool/-/workerpool-6.4.7.tgz", - "integrity": "sha512-DI2U4obcMzFViyNjLw0xXspim++qkAJ4BWRdYPVMMFtOpTvMr6PAk3UTZEoSqnZnvgUkJ3ck97Ybk+iIfuJHMg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/ws": { "version": "8.5.10", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", @@ -6069,9 +6059,9 @@ "integrity": "sha512-Gd9+TUn5nXdwj/hFsPVx5cuHHiF5Bwuc30jZ4+ronF1qHK5O7HD0sgmXWSEgwKquT3ClLoKPVbO6qGwVwLzvAw==" }, "node_modules/workerpool": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-8.0.0.tgz", - "integrity": "sha512-aoLtwqMXoYVA1JV+t8uCLo7sXkF4Q1Ijrn7954X2IVyysk2bv2Il7C9sVJH8xk9xJAL0FNgR+hPOhmvnMk/P5Q==" + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.1.0.tgz", + "integrity": "sha512-+wRWfm9yyJghvXLSHMQj3WXDxHbibHAQmRrWbqKBfy0RjftZNeQaW+Std5bSYc83ydkrxoPTPOWVlXUR9RWJdQ==" }, "node_modules/wrap-ansi": { "version": "8.1.0", diff --git a/package.json b/package.json index b1580751b..ff315a0d0 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "unified": "^11.0.4", "unist-util-visit": "^5.0.0", "vfile": "^6.0.1", - "workerpool": "^8.0.0", + "workerpool": "^9.1.0", "ws": "^8.15.1", "yargs": "^17.7.2" }, @@ -98,7 +98,6 @@ "@types/node": "^20.1.2", "@types/pretty-time": "^1.1.5", "@types/source-map-support": "^0.5.10", - "@types/workerpool": "^6.4.7", "@types/ws": "^8.5.10", "@types/yargs": "^17.0.32", "esbuild": "^0.19.9", From 9555407f65097cfb244d9994c605a7b98765a9a6 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Mon, 29 Jan 2024 19:26:47 -0500 Subject: [PATCH 73/98] fix(type): make sure dispatchEvent also accept UIEvent (#760) Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- globals.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/globals.d.ts b/globals.d.ts index 4473d59eb..0509f2665 100644 --- a/globals.d.ts +++ b/globals.d.ts @@ -4,7 +4,7 @@ export declare global { type: K, listener: (this: Document, ev: CustomEventMap[K]) => void, ): void - dispatchEvent(ev: CustomEventMap[K]): void + dispatchEvent(ev: CustomEventMap[K] | UIEvent): void } interface Window { spaNavigate(url: URL, isBack: boolean = false) From 37c6231e79d197f4d51db86e2760283f316ed191 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Tue, 30 Jan 2024 00:51:13 -0500 Subject: [PATCH 74/98] fix(div): update class name to remove weird space afterwards (#763) Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- quartz/components/ArticleTitle.tsx | 3 ++- quartz/components/Backlinks.tsx | 3 ++- quartz/components/Breadcrumbs.tsx | 3 ++- quartz/components/ContentMeta.tsx | 3 ++- quartz/components/Darkmode.tsx | 3 ++- quartz/components/Explorer.tsx | 3 ++- quartz/components/Graph.tsx | 3 ++- quartz/components/PageTitle.tsx | 3 ++- quartz/components/RecentNotes.tsx | 3 ++- quartz/components/Search.tsx | 3 ++- quartz/components/Spacer.tsx | 3 ++- quartz/components/TableOfContents.tsx | 3 ++- quartz/components/TagList.tsx | 3 ++- quartz/util/lang.ts | 10 ++++++++++ 14 files changed, 36 insertions(+), 13 deletions(-) diff --git a/quartz/components/ArticleTitle.tsx b/quartz/components/ArticleTitle.tsx index a52b2a466..2484c946a 100644 --- a/quartz/components/ArticleTitle.tsx +++ b/quartz/components/ArticleTitle.tsx @@ -1,9 +1,10 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types" +import { classNames } from "../util/lang" function ArticleTitle({ fileData, displayClass }: QuartzComponentProps) { const title = fileData.frontmatter?.title if (title) { - return {title} + return {title} } else { return null } diff --git a/quartz/components/Backlinks.tsx b/quartz/components/Backlinks.tsx index c4172ce24..d5bdc0b95 100644 --- a/quartz/components/Backlinks.tsx +++ b/quartz/components/Backlinks.tsx @@ -1,12 +1,13 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types" import style from "./styles/backlinks.scss" import { resolveRelative, simplifySlug } from "../util/path" +import { classNames } from "../util/lang" function Backlinks({ fileData, allFiles, displayClass }: QuartzComponentProps) { const slug = simplifySlug(fileData.slug!) const backlinkFiles = allFiles.filter((file) => file.links?.includes(slug)) return ( - + Backlinks {backlinkFiles.length > 0 ? ( diff --git a/quartz/components/Breadcrumbs.tsx b/quartz/components/Breadcrumbs.tsx index 182d9d62c..3875f5e55 100644 --- a/quartz/components/Breadcrumbs.tsx +++ b/quartz/components/Breadcrumbs.tsx @@ -2,6 +2,7 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types" import breadcrumbsStyle from "./styles/breadcrumbs.scss" import { FullSlug, SimpleSlug, resolveRelative } from "../util/path" import { QuartzPluginData } from "../plugins/vfile" +import { classNames } from "../util/lang" type CrumbData = { displayName: string @@ -113,7 +114,7 @@ export default ((opts?: Partial) => { } return ( - + {crumbs.map((crumb, index) => ( {crumb.displayName} diff --git a/quartz/components/ContentMeta.tsx b/quartz/components/ContentMeta.tsx index 5337feed8..6cd083e69 100644 --- a/quartz/components/ContentMeta.tsx +++ b/quartz/components/ContentMeta.tsx @@ -1,6 +1,7 @@ import { formatDate, getDate } from "./Date" import { QuartzComponentConstructor, QuartzComponentProps } from "./types" import readingTime from "reading-time" +import { classNames } from "../util/lang" interface ContentMetaOptions { /** @@ -33,7 +34,7 @@ export default ((opts?: Partial) => { segments.push(timeTaken) } - return {segments.join(", ")} + return {segments.join(", ")} } else { return null } diff --git a/quartz/components/Darkmode.tsx b/quartz/components/Darkmode.tsx index f1a7d080a..6d10bb99e 100644 --- a/quartz/components/Darkmode.tsx +++ b/quartz/components/Darkmode.tsx @@ -4,10 +4,11 @@ import darkmodeScript from "./scripts/darkmode.inline" import styles from "./styles/darkmode.scss" import { QuartzComponentConstructor, QuartzComponentProps } from "./types" +import { classNames } from "../util/lang" function Darkmode({ displayClass }: QuartzComponentProps) { return ( - + ) => { function Explorer({ allFiles, displayClass, fileData }: QuartzComponentProps) { constructFileTree(allFiles) return ( - + { const localGraph = { ...defaultOptions.localGraph, ...opts?.localGraph } const globalGraph = { ...defaultOptions.globalGraph, ...opts?.globalGraph } return ( - + Graph View diff --git a/quartz/components/PageTitle.tsx b/quartz/components/PageTitle.tsx index 81d80d110..fb1660a7c 100644 --- a/quartz/components/PageTitle.tsx +++ b/quartz/components/PageTitle.tsx @@ -1,11 +1,12 @@ import { pathToRoot } from "../util/path" import { QuartzComponentConstructor, QuartzComponentProps } from "./types" +import { classNames } from "../util/lang" function PageTitle({ fileData, cfg, displayClass }: QuartzComponentProps) { const title = cfg?.pageTitle ?? "Untitled Quartz" const baseDir = pathToRoot(fileData.slug!) return ( - + {title} ) diff --git a/quartz/components/RecentNotes.tsx b/quartz/components/RecentNotes.tsx index 9a53ad7eb..81b354d77 100644 --- a/quartz/components/RecentNotes.tsx +++ b/quartz/components/RecentNotes.tsx @@ -5,6 +5,7 @@ import { byDateAndAlphabetical } from "./PageList" import style from "./styles/recentNotes.scss" import { Date, getDate } from "./Date" import { GlobalConfiguration } from "../cfg" +import { classNames } from "../util/lang" interface Options { title: string @@ -28,7 +29,7 @@ export default ((userOpts?: Partial) => { const pages = allFiles.filter(opts.filter).sort(opts.sort) const remaining = Math.max(0, pages.length - opts.limit) return ( - + {opts.title} {pages.slice(0, opts.limit).map((page) => { diff --git a/quartz/components/Search.tsx b/quartz/components/Search.tsx index 9c1852dff..92684ae76 100644 --- a/quartz/components/Search.tsx +++ b/quartz/components/Search.tsx @@ -2,11 +2,12 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types" import style from "./styles/search.scss" // @ts-ignore import script from "./scripts/search.inline" +import { classNames } from "../util/lang" export default (() => { function Search({ displayClass }: QuartzComponentProps) { return ( - + Search diff --git a/quartz/components/Spacer.tsx b/quartz/components/Spacer.tsx index 8359111ef..5288752f7 100644 --- a/quartz/components/Spacer.tsx +++ b/quartz/components/Spacer.tsx @@ -1,7 +1,8 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types" +import { classNames } from "../util/lang" function Spacer({ displayClass }: QuartzComponentProps) { - return + return } export default (() => Spacer) satisfies QuartzComponentConstructor diff --git a/quartz/components/TableOfContents.tsx b/quartz/components/TableOfContents.tsx index 1c55f0740..167c837dd 100644 --- a/quartz/components/TableOfContents.tsx +++ b/quartz/components/TableOfContents.tsx @@ -1,6 +1,7 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types" import legacyStyle from "./styles/legacyToc.scss" import modernStyle from "./styles/toc.scss" +import { classNames } from "../util/lang" // @ts-ignore import script from "./scripts/toc.inline" @@ -19,7 +20,7 @@ function TableOfContents({ fileData, displayClass }: QuartzComponentProps) { } return ( - + Table of Contents 0) { return ( -
{segments.join(", ")}
${content}
Try another search term?
{content}
{pluralize(allPagesInFolder.length, "item")} under this folder.
{pluralize(pages.length, "item")} with this tag.
- +
- {pluralize(pages.length, "item")} with this tag.{" "} - {pages.length > numPages && `Showing first ${numPages}.`} -
+ {pluralize(pages.length, "item")} with this tag.{" "} + {pages.length > numPages && `Showing first ${numPages}.`} +
Transclude of ${url}${block}
Search