diff --git a/docs/configuration.md b/docs/configuration.md index 64968fbb4..1408f71e6 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -29,6 +29,7 @@ This part of the configuration concerns anything that can affect the whole site. - `{ provider: 'plausible' }` (managed) or `{ provider: 'plausible', host: '' }` (self-hosted): use [Plausible](https://plausible.io/); - `{ provider: 'umami', host: '', websiteId: '' }`: use [Umami](https://umami.is/); - `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id' }` (managed) or `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id', host: 'my-goatcounter-domain.com', scriptSrc: 'https://my-url.to/counter.js' }` (self-hosted) use [GoatCounter](https://goatcounter.com) + - `{ provider: 'posthog', apiKey: '', host: '' }`: use [Posthog](https://posthog.com/); - `locale`: used for [[i18n]] and date formatting - `baseUrl`: this is used for sitemaps and RSS feeds that require an absolute URL to know where the canonical 'home' of your site lives. This is normally the deployed URL of your site (e.g. `quartz.jzhao.xyz` for this site). Do not include the protocol (i.e. `https://`) or any leading or trailing slashes. - This should also include the subpath if you are [[hosting]] on GitHub pages without a custom domain. For example, if my repository is `jackyzha0/quartz`, GitHub pages would deploy to `https://jackyzha0.github.io/quartz` and the `baseUrl` would be `jackyzha0.github.io/quartz`. diff --git a/docs/features/Latex.md b/docs/features/Latex.md index b2bdb2dfb..fdc9d277b 100644 --- a/docs/features/Latex.md +++ b/docs/features/Latex.md @@ -39,6 +39,17 @@ a & b & c \end{bmatrix} $$ +$$ +\begin{array}{rll} +E \psi &= H\psi & \text{Expanding the Hamiltonian Operator} \\ +&= -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2} \psi + \frac{1}{2}m\omega x^2 \psi & \text{Using the ansatz $\psi(x) = e^{-kx^2}f(x)$, hoping to cancel the $x^2$ term} \\ +&= -\frac{\hbar^2}{2m} [4k^2x^2f(x)+2(-2kx)f'(x) + f''(x)]e^{-kx^2} + \frac{1}{2}m\omega x^2 f(x)e^{-kx^2} &\text{Removing the $e^{-kx^2}$ term from both sides} \\ +& \Downarrow \\ +Ef(x) &= -\frac{\hbar^2}{2m} [4k^2x^2f(x)-4kxf'(x) + f''(x)] + \frac{1}{2}m\omega x^2 f(x) & \text{Choosing $k=\frac{im}{2}\sqrt{\frac{\omega}{\hbar}}$ to cancel the $x^2$ term, via $-\frac{\hbar^2}{2m}4k^2=\frac{1}{2}m \omega$} \\ +&= -\frac{\hbar^2}{2m} [-4kxf'(x) + f''(x)] \\ +\end{array} +$$ + > [!warn] > Due to limitations in the [underlying parsing library](https://github.com/remarkjs/remark-math), block math in Quartz requires the `$$` delimiters to be on newlines like above. diff --git a/docs/plugins/AliasRedirects.md b/docs/plugins/AliasRedirects.md index 3a33ce649..8c0365377 100644 --- a/docs/plugins/AliasRedirects.md +++ b/docs/plugins/AliasRedirects.md @@ -26,7 +26,7 @@ The emitter supports the following aliases: - `alias` > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/Assets.md b/docs/plugins/Assets.md index eb03994e1..47589b2c3 100644 --- a/docs/plugins/Assets.md +++ b/docs/plugins/Assets.md @@ -9,7 +9,7 @@ This plugin emits all non-Markdown static assets in your content folder (like im Note that all static assets will then be accessible through its path on your generated site, i.e: `host.me/path/to/static.pdf` > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/CNAME.md b/docs/plugins/CNAME.md index 1cc0b5ccf..bc12b5acc 100644 --- a/docs/plugins/CNAME.md +++ b/docs/plugins/CNAME.md @@ -8,10 +8,10 @@ This plugin emits a `CNAME` record that points your subdomain to the default dom If you want to use a custom domain name like `quartz.example.com` for the site, then this is needed. -See [[Hosting]] for more information. +See [[hosting|Hosting]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/ComponentResources.md b/docs/plugins/ComponentResources.md index 739c17070..6e8c82ef8 100644 --- a/docs/plugins/ComponentResources.md +++ b/docs/plugins/ComponentResources.md @@ -7,7 +7,7 @@ tags: This plugin manages and emits the static resources required for the Quartz framework. This includes CSS stylesheets and JavaScript scripts that enhance the functionality and aesthetics of the generated site. See also the `cdnCaching` option in the `theme` section of the [[configuration]]. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/ContentIndex.md b/docs/plugins/ContentIndex.md index af235b057..eb7265d47 100644 --- a/docs/plugins/ContentIndex.md +++ b/docs/plugins/ContentIndex.md @@ -9,7 +9,7 @@ This plugin emits both RSS and an XML sitemap for your site. The [[RSS Feed]] al This plugin emits a comprehensive index of the site's content, generating additional resources such as a sitemap, an RSS feed, and a > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/ContentPage.md b/docs/plugins/ContentPage.md index 5d9016f3c..bd33e4ee1 100644 --- a/docs/plugins/ContentPage.md +++ b/docs/plugins/ContentPage.md @@ -7,7 +7,7 @@ tags: This plugin is a core component of the Quartz framework. It generates the HTML pages for each piece of Markdown content. It emits the full-page [[layout]], including headers, footers, and body content, among others. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/CrawlLinks.md b/docs/plugins/CrawlLinks.md index 15a0d6607..47b7bdd77 100644 --- a/docs/plugins/CrawlLinks.md +++ b/docs/plugins/CrawlLinks.md @@ -7,7 +7,7 @@ tags: This plugin parses links and processes them to point to the right places. It is also needed for embedded links (like images). See [[Obsidian compatibility]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/CreatedModifiedDate.md b/docs/plugins/CreatedModifiedDate.md index 6a0f1371a..5d772aaa0 100644 --- a/docs/plugins/CreatedModifiedDate.md +++ b/docs/plugins/CreatedModifiedDate.md @@ -7,7 +7,7 @@ tags: This plugin determines the created, modified, and published dates for a document using three potential data sources: frontmatter metadata, Git history, and the filesystem. See [[authoring content#Syntax]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/Description.md b/docs/plugins/Description.md index 526bb0175..af1c8b7c2 100644 --- a/docs/plugins/Description.md +++ b/docs/plugins/Description.md @@ -9,7 +9,7 @@ This plugin generates descriptions that are used as metadata for the HTML `head` If the frontmatter contains a `description` property, it is used (see [[authoring content#Syntax]]). Otherwise, the plugin will do its best to use the first few sentences of the content to reach the target description length. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/ExplicitPublish.md b/docs/plugins/ExplicitPublish.md index 7c7aceb65..2fd929b92 100644 --- a/docs/plugins/ExplicitPublish.md +++ b/docs/plugins/ExplicitPublish.md @@ -7,7 +7,7 @@ tags: This plugin filters content based on an explicit `publish` flag in the frontmatter, allowing only content that is explicitly marked for publication to pass through. It's the opt-in version of [[RemoveDrafts]]. See [[private pages]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/FolderPage.md b/docs/plugins/FolderPage.md index 92a700ae9..ead8e75ff 100644 --- a/docs/plugins/FolderPage.md +++ b/docs/plugins/FolderPage.md @@ -9,7 +9,7 @@ This plugin generates index pages for folders, creating a listing page for each Example: [[advanced/|Advanced]] > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/Frontmatter.md b/docs/plugins/Frontmatter.md index 960417a80..879d087db 100644 --- a/docs/plugins/Frontmatter.md +++ b/docs/plugins/Frontmatter.md @@ -7,7 +7,7 @@ tags: This plugin parses the frontmatter of the page using the [gray-matter](https://github.com/jonschlinkert/gray-matter) library. See [[authoring content#Syntax]], [[Obsidian compatibility]] and [[OxHugo compatibility]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/GitHubFlavoredMarkdown.md b/docs/plugins/GitHubFlavoredMarkdown.md index 2ea8f8d38..41fab6b23 100644 --- a/docs/plugins/GitHubFlavoredMarkdown.md +++ b/docs/plugins/GitHubFlavoredMarkdown.md @@ -9,7 +9,7 @@ This plugin enhances Markdown processing to support GitHub Flavored Markdown (GF In addition, this plugin adds optional features for typographic refinement (such as converting straight quotes to curly quotes, dashes to en-dashes/em-dashes, and ellipses) and automatic heading links as a symbol that appears next to the heading on hover. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/HardLineBreaks.md b/docs/plugins/HardLineBreaks.md index d35d74cf9..e24f7e129 100644 --- a/docs/plugins/HardLineBreaks.md +++ b/docs/plugins/HardLineBreaks.md @@ -7,7 +7,7 @@ tags: This plugin automatically converts single line breaks in Markdown text into hard line breaks in the HTML output. This plugin is not enabled by default as this doesn't follow the semantics of actual Markdown but you may enable it if you'd like parity with [[Obsidian compatibility|Obsidian]]. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/Latex.md b/docs/plugins/Latex.md index 8a8999e86..ac4367841 100644 --- a/docs/plugins/Latex.md +++ b/docs/plugins/Latex.md @@ -7,7 +7,7 @@ tags: This plugin adds LaTeX support to Quartz. See [[features/Latex|Latex]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/NotFoundPage.md b/docs/plugins/NotFoundPage.md index 082f86425..b67994329 100644 --- a/docs/plugins/NotFoundPage.md +++ b/docs/plugins/NotFoundPage.md @@ -7,7 +7,7 @@ tags: This plugin emits a 404 (Not Found) page for broken or non-existent URLs. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/ObsidianFlavoredMarkdown.md b/docs/plugins/ObsidianFlavoredMarkdown.md index c4240865f..30d1f7179 100644 --- a/docs/plugins/ObsidianFlavoredMarkdown.md +++ b/docs/plugins/ObsidianFlavoredMarkdown.md @@ -7,7 +7,7 @@ tags: This plugin provides support for [[Obsidian compatibility]]. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/OxHugoFlavoredMarkdown.md b/docs/plugins/OxHugoFlavoredMarkdown.md index 523a21589..5c2afeea6 100644 --- a/docs/plugins/OxHugoFlavoredMarkdown.md +++ b/docs/plugins/OxHugoFlavoredMarkdown.md @@ -7,7 +7,7 @@ tags: This plugin provides support for [ox-hugo](https://github.com/kaushalmodi/ox-hugo) compatibility. See [[OxHugo compatibility]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/RemoveDrafts.md b/docs/plugins/RemoveDrafts.md index 729ac86a7..07fb4d0e4 100644 --- a/docs/plugins/RemoveDrafts.md +++ b/docs/plugins/RemoveDrafts.md @@ -7,7 +7,7 @@ tags: This plugin filters out content from your vault, so that only finalized content is made available. This prevents [[private pages]] from being published. By default, it filters out all pages with `draft: true` in the frontmatter and leaves all other pages intact. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/Static.md b/docs/plugins/Static.md index c660eabf4..80bf5a158 100644 --- a/docs/plugins/Static.md +++ b/docs/plugins/Static.md @@ -10,7 +10,7 @@ This plugin emits all static resources needed by Quartz. This is used, for examp > This is different from [[Assets]]. The resources from the [[Static]] plugin are located under `quartz/static`, whereas [[Assets]] renders all static resources under `content` and is used for images, videos, audio, etc. that are directly referenced by your markdown content. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/plugins/SyntaxHighlighting.md b/docs/plugins/SyntaxHighlighting.md index 8bf581eb4..6fb67dba0 100644 --- a/docs/plugins/SyntaxHighlighting.md +++ b/docs/plugins/SyntaxHighlighting.md @@ -7,7 +7,7 @@ tags: This plugin is used to add syntax highlighting to code blocks in Quartz. See [[syntax highlighting]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/TableOfContents.md b/docs/plugins/TableOfContents.md index d443d0eaa..0e9e4ea73 100644 --- a/docs/plugins/TableOfContents.md +++ b/docs/plugins/TableOfContents.md @@ -7,7 +7,7 @@ tags: This plugin generates a table of contents (TOC) for Markdown documents. See [[table of contents]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin accepts the following configuration options: diff --git a/docs/plugins/TagPage.md b/docs/plugins/TagPage.md index cd7dee609..9c704b380 100644 --- a/docs/plugins/TagPage.md +++ b/docs/plugins/TagPage.md @@ -7,7 +7,7 @@ tags: This plugin emits dedicated pages for each tag used in the content. See [[folder and tag listings]] for more information. > [!note] -> For information on how to add, remove or configure plugins, see the [[Configuration#Plugins|Configuration]] page. +> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page. This plugin has no configuration options. diff --git a/docs/showcase.md b/docs/showcase.md index 0509e93ab..4860e0be1 100644 --- a/docs/showcase.md +++ b/docs/showcase.md @@ -26,5 +26,6 @@ Want to see what Quartz can do? Here are some cool community gardens: - [Data Dictionary 🧠](https://glossary.airbyte.com/) - [sspaeti.com's Second Brain](https://brain.sspaeti.com/) - [🪴Aster's notebook](https://notes.asterhu.com) +- [🥷🏻🌳🍃 Computer Science & Thinkering Garden](https://notes.yxy.ninja) 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)! diff --git a/package-lock.json b/package-lock.json index 8ef3e9f0a..b8c9e16c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "chalk": "^5.3.0", "chokidar": "^3.6.0", "cli-spinner": "^0.2.10", - "d3": "^7.8.5", + "d3": "^7.9.0", "esbuild-sass-plugin": "^2.16.1", "flexsearch": "0.7.43", "github-slugger": "^2.0.0", @@ -32,8 +32,8 @@ "mdast-util-to-hast": "^13.1.0", "mdast-util-to-string": "^4.0.0", "micromorph": "^0.4.5", - "preact": "^10.19.6", - "preact-render-to-string": "^6.4.0", + "preact": "^10.20.1", + "preact-render-to-string": "^6.4.2", "pretty-bytes": "^6.1.1", "pretty-time": "^1.1.0", "reading-time": "^1.5.0", @@ -55,14 +55,14 @@ "rfdc": "^1.3.1", "rimraf": "^5.0.5", "serve-handler": "^6.1.5", - "shiki": "^1.2.0", + "shiki": "^1.2.3", "source-map-support": "^0.5.21", "to-vfile": "^8.0.0", "toml": "^3.0.0", "unified": "^11.0.4", "unist-util-visit": "^5.0.0", "vfile": "^6.0.1", - "workerpool": "^9.1.0", + "workerpool": "^9.1.1", "ws": "^8.15.1", "yargs": "^17.7.2" }, @@ -74,7 +74,7 @@ "@types/d3": "^7.4.3", "@types/hast": "^3.0.4", "@types/js-yaml": "^4.0.9", - "@types/node": "^20.11.29", + "@types/node": "^20.12.5", "@types/pretty-time": "^1.1.5", "@types/source-map-support": "^0.5.10", "@types/ws": "^8.5.10", @@ -82,7 +82,7 @@ "esbuild": "^0.19.9", "prettier": "^3.2.4", "tsx": "^4.7.1", - "typescript": "^5.4.2" + "typescript": "^5.4.3" }, "engines": { "node": ">=18.14", @@ -820,9 +820,9 @@ } }, "node_modules/@shikijs/core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.2.0.tgz", - "integrity": "sha512-OlFvx+nyr5C8zpcMBnSGir0YPD6K11uYhouqhNmm1qLiis4GA7SsGtu07r9gKS9omks8RtQqHrJL4S+lqWK01A==" + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.2.3.tgz", + "integrity": "sha512-SM+aiQVaEK2P53dEcsvhq9+LJPr0rzwezHbMQhHaSrPN4OlOB4vp1qTdhVEKfMg6atdq8s9ZotWW/CSCzWftwg==" }, "node_modules/@sindresorhus/merge-streams": { "version": "2.3.0", @@ -1170,9 +1170,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.29.tgz", - "integrity": "sha512-P99thMkD/1YkCvAtOd6/zGedKNA0p2fj4ZpjCzcNiSCBWgm3cNRTBfa/qjFnsKkkojxu4vVLtWpesnZ9+ap+gA==", + "version": "20.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.5.tgz", + "integrity": "sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1666,9 +1666,9 @@ } }, "node_modules/d3": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/d3/-/d3-7.8.5.tgz", - "integrity": "sha512-JgoahDG51ncUfJu6wX/1vWQEqOflgXyl4MaHqlcSruTez7yhaRKR9i8VjjcQGeS2en/jnFivXuaIMnseMMt0XA==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", + "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", "dependencies": { "d3-array": "3", "d3-axis": "3", @@ -4696,18 +4696,18 @@ } }, "node_modules/preact": { - "version": "10.19.6", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.19.6.tgz", - "integrity": "sha512-gympg+T2Z1fG1unB8NH29yHJwnEaCH37Z32diPDku316OTnRPeMbiRV9kTrfZpocXjdfnWuFUl/Mj4BHaf6gnw==", + "version": "10.20.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.20.1.tgz", + "integrity": "sha512-JIFjgFg9B2qnOoGiYMVBtrcFxHqn+dNXbq76bVmcaHYJFYR4lW67AOcXgAYQQTDYXDOg/kTZrKPNCdRgJ2UJmw==", "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" } }, "node_modules/preact-render-to-string": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-6.4.0.tgz", - "integrity": "sha512-pzDwezZaLbK371OiJjXDsZJwVOALzFX5M1wEh2Kr0pEApq5AV6bRH/DFbA/zNA7Lck/duyREPQLLvzu2G6hEQQ==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-6.4.2.tgz", + "integrity": "sha512-Sio5SvlyZSAXHuvnMgYzVQd67lNIuQe4uSjJ+2gfpJNC6L8zoHQR5xV7B/EjIqrAYWVyJ2eACkTCxVrIzZi6Vw==", "dependencies": { "pretty-format": "^3.8.0" }, @@ -5571,11 +5571,11 @@ } }, "node_modules/shiki": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.2.0.tgz", - "integrity": "sha512-xLhiTMOIUXCv5DqJ4I70GgQCtdlzsTqFLZWcMHHG3TAieBUbvEGthdrlPDlX4mL/Wszx9C6rEcxU6kMlg4YlxA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.2.3.tgz", + "integrity": "sha512-+v7lO5cJMeV2N2ySK4l+51YX3wTh5I49SLjAOs1ch1DbUfeEytU1Ac9KaZPoZJCVBGycDZ09OBQN5nbcPFc5FQ==", "dependencies": { - "@shikijs/core": "1.2.0" + "@shikijs/core": "1.2.3" } }, "node_modules/signal-exit": { @@ -5922,9 +5922,9 @@ } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", + "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -6325,9 +6325,9 @@ "integrity": "sha512-Gd9+TUn5nXdwj/hFsPVx5cuHHiF5Bwuc30jZ4+ronF1qHK5O7HD0sgmXWSEgwKquT3ClLoKPVbO6qGwVwLzvAw==" }, "node_modules/workerpool": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.1.0.tgz", - "integrity": "sha512-+wRWfm9yyJghvXLSHMQj3WXDxHbibHAQmRrWbqKBfy0RjftZNeQaW+Std5bSYc83ydkrxoPTPOWVlXUR9RWJdQ==" + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.1.1.tgz", + "integrity": "sha512-EFoFTSEo9m4V4wNrwzVRjxnf/E/oBpOzcI/R5CIugJhl9RsCiq525rszo4AtqcjQQoqFdu2E3H82AnbtpaQHvg==" }, "node_modules/wrap-ansi": { "version": "8.1.0", diff --git a/package.json b/package.json index f785b4b33..7cf279856 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "url": "https://github.com/jackyzha0/quartz.git" }, "scripts": { + "quartz": "./quartz/bootstrap-cli.mjs", "docs": "npx quartz build --serve -d docs", "check": "tsc --noEmit && npx prettier . --check", "format": "npx prettier . --write", @@ -41,7 +42,7 @@ "chalk": "^5.3.0", "chokidar": "^3.6.0", "cli-spinner": "^0.2.10", - "d3": "^7.8.5", + "d3": "^7.9.0", "esbuild-sass-plugin": "^2.16.1", "flexsearch": "0.7.43", "github-slugger": "^2.0.0", @@ -57,8 +58,8 @@ "mdast-util-to-hast": "^13.1.0", "mdast-util-to-string": "^4.0.0", "micromorph": "^0.4.5", - "preact": "^10.19.6", - "preact-render-to-string": "^6.4.0", + "preact": "^10.20.1", + "preact-render-to-string": "^6.4.2", "pretty-bytes": "^6.1.1", "pretty-time": "^1.1.0", "reading-time": "^1.5.0", @@ -80,14 +81,14 @@ "rfdc": "^1.3.1", "rimraf": "^5.0.5", "serve-handler": "^6.1.5", - "shiki": "^1.2.0", + "shiki": "^1.2.3", "source-map-support": "^0.5.21", "to-vfile": "^8.0.0", "toml": "^3.0.0", "unified": "^11.0.4", "unist-util-visit": "^5.0.0", "vfile": "^6.0.1", - "workerpool": "^9.1.0", + "workerpool": "^9.1.1", "ws": "^8.15.1", "yargs": "^17.7.2" }, @@ -96,7 +97,7 @@ "@types/d3": "^7.4.3", "@types/hast": "^3.0.4", "@types/js-yaml": "^4.0.9", - "@types/node": "^20.11.29", + "@types/node": "^20.12.5", "@types/pretty-time": "^1.1.5", "@types/source-map-support": "^0.5.10", "@types/ws": "^8.5.10", @@ -104,6 +105,6 @@ "esbuild": "^0.19.9", "prettier": "^3.2.4", "tsx": "^4.7.1", - "typescript": "^5.4.2" + "typescript": "^5.4.3" } } diff --git a/quartz/cfg.ts b/quartz/cfg.ts index 2e32b1f80..09905e9f0 100644 --- a/quartz/cfg.ts +++ b/quartz/cfg.ts @@ -25,6 +25,11 @@ export type Analytics = host?: string scriptSrc?: string } + | { + provider: "posthog" + apiKey: string + host?: string + } export interface GlobalConfiguration { pageTitle: string diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx index 55f1e427d..a13f135f8 100644 --- a/quartz/components/pages/FolderContent.tsx +++ b/quartz/components/pages/FolderContent.tsx @@ -47,9 +47,7 @@ export default ((opts?: Partial) => { return (
-
-

{content}

-
+
{content}
{options.showFolderCount && (

diff --git a/quartz/i18n/index.ts b/quartz/i18n/index.ts index b97368d96..6707ea35d 100644 --- a/quartz/i18n/index.ts +++ b/quartz/i18n/index.ts @@ -13,6 +13,8 @@ import ru from "./locales/ru-RU" import ko from "./locales/ko-KR" import zh from "./locales/zh-CN" import vi from "./locales/vi-VN" +import pt from "./locales/pt-BR" +import hu from "./locales/hu-HU" export const TRANSLATIONS = { "en-US": en, @@ -50,6 +52,8 @@ export const TRANSLATIONS = { "ko-KR": ko, "zh-CN": zh, "vi-VN": vi, + "pt-BR": pt, + "hu-HU": hu, } as const export const defaultTranslation = "en-US" diff --git a/quartz/i18n/locales/hu-HU.ts b/quartz/i18n/locales/hu-HU.ts new file mode 100644 index 000000000..6397309b7 --- /dev/null +++ b/quartz/i18n/locales/hu-HU.ts @@ -0,0 +1,81 @@ +import { Translation } from "./definition" + +export default { + propertyDefaults: { + title: "Névtelen", + description: "Nincs leírás", + }, + components: { + callout: { + note: "Jegyzet", + abstract: "Abstract", + info: "Információ", + todo: "Tennivaló", + tip: "Tipp", + success: "Siker", + question: "Kérdés", + warning: "Figyelmeztetés", + failure: "Hiba", + danger: "Veszély", + bug: "Bug", + example: "Példa", + quote: "Idézet", + }, + backlinks: { + title: "Visszautalások", + noBacklinksFound: "Nincs visszautalás", + }, + themeToggle: { + lightMode: "Világos mód", + darkMode: "Sötét mód", + }, + explorer: { + title: "Fájlböngésző", + }, + footer: { + createdWith: "Készítve ezzel:", + }, + graph: { + title: "Grafikonnézet", + }, + recentNotes: { + title: "Legutóbbi jegyzetek", + seeRemainingMore: ({ remaining }) => `${remaining} további megtekintése →`, + }, + transcludes: { + transcludeOf: ({ targetSlug }) => `${targetSlug} áthivatkozása`, + linkToOriginal: "Hivatkozás az eredetire", + }, + search: { + title: "Keresés", + searchBarPlaceholder: "Keress valamire", + }, + tableOfContents: { + title: "Tartalomjegyzék", + }, + contentMeta: { + readingTime: ({ minutes }) => `${minutes} perces olvasás`, + }, + }, + pages: { + rss: { + recentNotes: "Legutóbbi jegyzetek", + lastFewNotes: ({ count }) => `Legutóbbi ${count} jegyzet`, + }, + error: { + title: "Nem található", + notFound: "Ez a lap vagy privát vagy nem létezik.", + }, + folderContent: { + folder: "Mappa", + itemsUnderFolder: ({ count }) => `Ebben a mappában ${count} elem található.`, + }, + tagContent: { + tag: "Címke", + tagIndex: "Címke index", + itemsUnderTag: ({ count }) => `${count} elem található ezzel a címkével.`, + showingFirst: ({ count }) => `Első ${count} címke megjelenítve.`, + totalTags: ({ count }) => `Összesen ${count} címke található.`, + }, + }, +} as const satisfies Translation diff --git a/quartz/i18n/locales/pt-BR.ts b/quartz/i18n/locales/pt-BR.ts new file mode 100644 index 000000000..489d64220 --- /dev/null +++ b/quartz/i18n/locales/pt-BR.ts @@ -0,0 +1,83 @@ +import { Translation } from "./definition" + +export default { + propertyDefaults: { + title: "Sem título", + description: "Sem descrição", + }, + components: { + callout: { + note: "Nota", + abstract: "Abstrato", + info: "Info", + todo: "Pendência", + tip: "Dica", + success: "Sucesso", + question: "Pergunta", + warning: "Aviso", + failure: "Falha", + danger: "Perigo", + bug: "Bug", + example: "Exemplo", + quote: "Citação", + }, + backlinks: { + title: "Backlinks", + noBacklinksFound: "Sem backlinks encontrados", + }, + themeToggle: { + lightMode: "Tema claro", + darkMode: "Tema escuro", + }, + explorer: { + title: "Explorador", + }, + footer: { + createdWith: "Criado com", + }, + graph: { + title: "Visão de gráfico", + }, + recentNotes: { + title: "Notas recentes", + seeRemainingMore: ({ remaining }) => `Veja mais ${remaining} →`, + }, + transcludes: { + transcludeOf: ({ targetSlug }) => `Transcrever de ${targetSlug}`, + linkToOriginal: "Link ao original", + }, + search: { + title: "Pesquisar", + searchBarPlaceholder: "Pesquisar por algo", + }, + tableOfContents: { + title: "Sumário", + }, + contentMeta: { + readingTime: ({ minutes }) => `Leitura de ${minutes} min`, + }, + }, + pages: { + rss: { + recentNotes: "Notas recentes", + lastFewNotes: ({ count }) => `Últimas ${count} notas`, + }, + error: { + title: "Não encontrado", + notFound: "Esta página é privada ou não existe.", + }, + folderContent: { + folder: "Arquivo", + itemsUnderFolder: ({ count }) => + count === 1 ? "1 item neste arquivo." : `${count} items neste arquivo.`, + }, + tagContent: { + tag: "Tag", + tagIndex: "Sumário de Tags", + itemsUnderTag: ({ count }) => + count === 1 ? "1 item com esta tag." : `${count} items com esta tag.`, + showingFirst: ({ count }) => `Mostrando as ${count} primeiras tags.`, + totalTags: ({ count }) => `Encontradas ${count} tags.`, + }, + }, +} as const satisfies Translation diff --git a/quartz/plugins/emitters/componentResources.ts b/quartz/plugins/emitters/componentResources.ts index 0bccb6075..81d3af2e8 100644 --- a/quartz/plugins/emitters/componentResources.ts +++ b/quartz/plugins/emitters/componentResources.ts @@ -129,6 +129,13 @@ function addGlobalPageResources(ctx: BuildCtx, componentResources: ComponentReso "https://${cfg.analytics.websiteId}.${cfg.analytics.host ?? "goatcounter.com"}/count") document.head.appendChild(goatcounterScript) `) + } else if (cfg.analytics?.provider === "posthog") { + componentResources.afterDOMLoaded.push(` + const posthogScript = document.createElement("script") + posthogScript.innerHTML= \`!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys onSessionId".split(" "),n=0;n const [raw]: (string | undefined)[] = capture let escaped = raw ?? "" escaped = escaped.replace("#", "\\#") - escaped = escaped.replace("|", "\\|") + // escape pipe characters if they are not already escaped + escaped = escaped.replace(/((^|[^\\])(\\\\)*)\|/g, "$1\\|") return escaped }) diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 868dfdc79..859bb433e 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -513,3 +513,8 @@ ol.overflow { padding-left: 1rem; } } + +.katex-display { + overflow-x: auto; + overflow-y: hidden; +} diff --git a/quartz/util/path.ts b/quartz/util/path.ts index dceb89bfa..c02bfb12d 100644 --- a/quartz/util/path.ts +++ b/quartz/util/path.ts @@ -168,6 +168,9 @@ export function resolveRelative(current: FullSlug, target: FullSlug | SimpleSlug export function splitAnchor(link: string): [string, string] { let [fp, anchor] = link.split("#", 2) + if (fp.endsWith(".pdf")) { + return [fp, anchor === undefined ? "" : `#${anchor}`] + } anchor = anchor === undefined ? "" : "#" + slugAnchor(anchor) return [fp, anchor] }