Compare commits

..

26 Commits

Author SHA1 Message Date
851e05a571
Merge remote-tracking branch 'origin/v4' into drone-v4
All checks were successful
continuous-integration/drone/push Build is passing
# Conflicts:
#	quartz/components/styles/backlinks.scss
2024-10-11 20:56:51 +03:00
Pierre Lairez
0d1f15d37c
feat(ofm): Allow for dashes in custom callout label (#1493)
* [OFM] Allow for dashes in custom callout label

For compatibility with Obsidian's behavior, a custom callout like
[!see-also] is possible. Previously, this was parsed by Quartz as a
callout “see” with metadata “-also”. Instead, this is should be a
callout “see-also” with title “See also” (capitalization + replace
dashes by spaces).

* prettier
2024-10-10 07:15:23 -04:00
dependabot[bot]
11c23a137a
chore(deps): bump the production-dependencies group with 9 updates (#1495)
Bumps the production-dependencies group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [chokidar](https://github.com/paulmillr/chokidar) | `3.6.0` | `4.0.1` |
| [esbuild-sass-plugin](https://github.com/glromeo/esbuild-sass-plugin) | `2.16.1` | `3.3.1` |
| [lightningcss](https://github.com/parcel-bundler/lightningcss) | `1.26.0` | `1.27.0` |
| [preact](https://github.com/preactjs/preact) | `10.24.1` | `10.24.2` |
| [rehype-citation](https://github.com/timlrx/rehype-citation) | `2.1.1` | `2.1.2` |
| [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki) | `1.18.0` | `1.22.0` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `22.7.4` | `22.7.5` |
| [esbuild](https://github.com/evanw/esbuild) | `0.19.12` | `0.24.0` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.6.2` | `5.6.3` |


Updates `chokidar` from 3.6.0 to 4.0.1
- [Release notes](https://github.com/paulmillr/chokidar/releases)
- [Commits](https://github.com/paulmillr/chokidar/compare/3.6.0...4.0.1)

Updates `esbuild-sass-plugin` from 2.16.1 to 3.3.1
- [Release notes](https://github.com/glromeo/esbuild-sass-plugin/releases)
- [Commits](https://github.com/glromeo/esbuild-sass-plugin/compare/v2.16.1...v3.3.1)

Updates `lightningcss` from 1.26.0 to 1.27.0
- [Release notes](https://github.com/parcel-bundler/lightningcss/releases)
- [Commits](https://github.com/parcel-bundler/lightningcss/compare/v1.26.0...v1.27.0)

Updates `preact` from 10.24.1 to 10.24.2
- [Release notes](https://github.com/preactjs/preact/releases)
- [Commits](https://github.com/preactjs/preact/compare/10.24.1...10.24.2)

Updates `rehype-citation` from 2.1.1 to 2.1.2
- [Release notes](https://github.com/timlrx/rehype-citation/releases)
- [Commits](https://github.com/timlrx/rehype-citation/compare/v2.1.1...v2.1.2)

Updates `shiki` from 1.18.0 to 1.22.0
- [Release notes](https://github.com/shikijs/shiki/releases)
- [Changelog](https://github.com/shikijs/shiki/blob/main/CHANGELOG.md)
- [Commits](https://github.com/shikijs/shiki/commits/v1.22.0/packages/shiki)

Updates `@types/node` from 22.7.4 to 22.7.5
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `esbuild` from 0.19.12 to 0.24.0
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.19.12...v0.24.0)

Updates `typescript` from 5.6.2 to 5.6.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.2...v5.6.3)

---
updated-dependencies:
- dependency-name: chokidar
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: production-dependencies
- dependency-name: esbuild-sass-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: production-dependencies
- dependency-name: lightningcss
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
- dependency-name: preact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: rehype-citation
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: shiki
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 14:57:33 -07:00
Aaron Pham
8a95c865c8
chore(citations): passthrough options (#1429) 2024-10-09 14:14:44 -04:00
Aaron Pham
fe4b039b60
chore(ci): group dependabot upgrade (#1491)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-10-09 09:52:49 -07:00
Aaron Pham
497d51973a
chore(ci): remove signing and vuln (#1484)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-10-07 02:52:14 -04:00
Aaron Pham
66d7dd8677
fix(ci): run build on tags (#1483)
* fix(ci): run build on tags

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

* chore: update docker warning and not push on PR

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

---------

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2024-10-06 22:34:31 -04:00
Julia van der Kris
313cef60ee
infra: build quartz docker image to GHCR (#1192)
* Add GitHub action to build & push Docker image to GHCR

* Use double quotes to keep `prettier` happy :)

* Don't run Docker build & push on forks

* -1 char commit lmao

* Add git metadata to Docker image

* Apply Aaron's patch

* chore: run prettier

---------

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Co-authored-by: Aaron Pham <contact@aarnphm.xyz>
2024-10-06 22:15:19 -04:00
KurekMartin
af14ca7c4f
i18n: add Czech translation (#1477)
* add Czech translation

* fix formatting
2024-10-04 09:10:40 -07:00
dependabot[bot]
e06f681ce7
chore(deps): bump preact from 10.24.0 to 10.24.1 (#1464)
Bumps [preact](https://github.com/preactjs/preact) from 10.24.0 to 10.24.1.
- [Release notes](https://github.com/preactjs/preact/releases)
- [Commits](https://github.com/preactjs/preact/compare/10.24.0...10.24.1)

---
updated-dependencies:
- dependency-name: preact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 04:42:14 -04:00
dependabot[bot]
62906eebd3
chore(deps-dev): bump @types/node from 22.5.5 to 22.7.4 (#1465)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.5.5 to 22.7.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 04:42:02 -04:00
dependabot[bot]
9cd072bfc3
chore(deps): bump hast-util-to-string from 3.0.0 to 3.0.1 (#1466)
Bumps [hast-util-to-string](https://github.com/rehypejs/rehype-minify) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/rehypejs/rehype-minify/releases)
- [Changelog](https://github.com/rehypejs/rehype-minify/blob/main/changelog.md)
- [Commits](https://github.com/rehypejs/rehype-minify/commits)

---
updated-dependencies:
- dependency-name: hast-util-to-string
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 04:41:50 -04:00
dependabot[bot]
319b4497bc
chore(deps-dev): bump tsx from 4.19.0 to 4.19.1 (#1467)
Bumps [tsx](https://github.com/privatenumber/tsx) from 4.19.0 to 4.19.1.
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.19.0...v4.19.1)

---
updated-dependencies:
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 04:41:36 -04:00
Emile Bangma
b0c079f24a
fix(layout): restore footer to the proper position (#1470)
* fix(layout): restore footer to the proper position

* align ToC scrollbar properly on short headers
2024-10-01 08:49:13 -07:00
dependabot[bot]
1b122a1da0
chore(deps): bump @floating-ui/dom from 1.6.10 to 1.6.11 (#1463)
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.6.10 to 1.6.11.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Changelog](https://github.com/floating-ui/floating-ui/blob/master/packages/dom/CHANGELOG.md)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.6.11/packages/dom)

---
updated-dependencies:
- dependency-name: "@floating-ui/dom"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 20:10:05 -04:00
Malcolm Mielle
b8c46ba81a
feat(analytics): clarity (#1446)
Add the code necessary for support of Microsoft clarity
2024-09-30 10:06:37 -07:00
Emile Bangma
1416f62a47
fix(layout): backlinks grid triage (#1447)
* fix: mobile backlinks orientation

* temp: hide broken list gradient

* fix: backlinks overflow
2024-09-29 22:24:15 -04:00
Jacky Zhao
8889ab63eb fix: provide default pageTitleSuffix (closes #1452) 2024-09-28 09:38:19 -07:00
Emile Bangma
5eec1e98e6
fix(layout): grid triage with backlinks (#1442) 2024-09-25 18:15:07 -04:00
Emile Bangma
a7a0dcad22
fix(layout): grid triage and regression (#1440)
* fix(table of contents): multiple scrollbars (https://github.com/jackyzha0/quartz/issues/1388)

* fix(center): Main content mininum width (https://github.com/jackyzha0/quartz/issues/1439)

* fix(code block): Horizontal overflow fix (https://github.com/jackyzha0/quartz/issues/1438, https://github.com/jackyzha0/quartz/issues/1353)

* WIP fix for ul/ol .overflow

* Fix: restore former scrollbar behavior for overflow lists (https://github.com/jackyzha0/quartz/issues/1437)

* Fix: code block overflow-x

* fix: Table of Content overflow (https://github.com/jackyzha0/quartz/issues/1437)

* Address feedback

* Move max-height toggle from js to css
2024-09-25 17:20:58 -04:00
threehymns
921f45cf70
feat: add a config option for a pageTitleSuffix (#1320)
* feat: add a config option for a pageTitleSuffix

* Run Prettier on Head.tsx

* Make pageTitleSuffix optional

Co-authored-by: Aaron Pham <Aaronpham0103@gmail.com>

---------

Co-authored-by: Aaron Pham <Aaronpham0103@gmail.com>
2024-09-24 20:20:36 -04:00
dependabot[bot]
90c187587f
chore(deps): bump pixi.js from 8.3.4 to 8.4.1 (#1432)
Bumps [pixi.js](https://github.com/pixijs/pixijs) from 8.3.4 to 8.4.1.
- [Release notes](https://github.com/pixijs/pixijs/releases)
- [Commits](https://github.com/pixijs/pixijs/compare/v8.3.4...v8.4.1)

---
updated-dependencies:
- dependency-name: pixi.js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-24 20:19:48 -04:00
dependabot[bot]
08e20a7006
chore(deps): bump remark-rehype from 11.1.0 to 11.1.1 (#1435)
Bumps [remark-rehype](https://github.com/remarkjs/remark-rehype) from 11.1.0 to 11.1.1.
- [Release notes](https://github.com/remarkjs/remark-rehype/releases)
- [Commits](https://github.com/remarkjs/remark-rehype/compare/11.1.0...11.1.1)

---
updated-dependencies:
- dependency-name: remark-rehype
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-24 20:19:37 -04:00
dependabot[bot]
9e32016508
chore(deps): bump rehype-pretty-code from 0.13.2 to 0.14.0 (#1433)
Bumps [rehype-pretty-code](https://github.com/rehype-pretty/rehype-pretty-code/tree/HEAD/packages/core) from 0.13.2 to 0.14.0.
- [Release notes](https://github.com/rehype-pretty/rehype-pretty-code/releases)
- [Changelog](https://github.com/rehype-pretty/rehype-pretty-code/blob/master/packages/core/CHANGELOG.md)
- [Commits](https://github.com/rehype-pretty/rehype-pretty-code/commits/rehype-pretty-code@0.14.0/packages/core)

---
updated-dependencies:
- dependency-name: rehype-pretty-code
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-24 20:19:25 -04:00
dependabot[bot]
8a050c0be0
chore(deps): bump hast-util-to-html from 9.0.2 to 9.0.3 (#1434)
Bumps [hast-util-to-html](https://github.com/syntax-tree/hast-util-to-html) from 9.0.2 to 9.0.3.
- [Release notes](https://github.com/syntax-tree/hast-util-to-html/releases)
- [Commits](https://github.com/syntax-tree/hast-util-to-html/compare/9.0.2...9.0.3)

---
updated-dependencies:
- dependency-name: hast-util-to-html
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-24 20:19:12 -04:00
dependabot[bot]
0aacd8ed2e
chore(deps): bump shiki from 1.12.1 to 1.18.0 (#1436)
Bumps [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki) from 1.12.1 to 1.18.0.
- [Release notes](https://github.com/shikijs/shiki/releases)
- [Changelog](https://github.com/shikijs/shiki/blob/main/CHANGELOG.md)
- [Commits](https://github.com/shikijs/shiki/commits/v1.18.0/packages/shiki)

---
updated-dependencies:
- dependency-name: shiki
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-24 20:18:55 -04:00
20 changed files with 1046 additions and 383 deletions

View File

@ -1,11 +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 version: 2
updates: updates:
- package-ecosystem: "npm" - package-ecosystem: "npm"
directory: "/" directory: "/"
schedule: schedule:
interval: "weekly" interval: "weekly"
groups:
production-dependencies:
applies-to: "version-updates"
patterns:
- "*"

View File

@ -0,0 +1,88 @@
name: Docker build & push image
on:
push:
branches: [v4]
tags: ["v*"]
pull_request:
branches: [v4]
paths:
- .github/workflows/docker-build-push.yaml
- quartz/**
workflow_dispatch:
jobs:
build:
if: ${{ github.repository == 'jackyzha0/quartz' }} # Comment this out if you want to publish your own images on a fork!
runs-on: ubuntu-latest
steps:
- name: Set lowercase repository owner environment variable
run: |
echo "OWNER_LOWERCASE=${OWNER,,}" >> ${GITHUB_ENV}
env:
OWNER: "${{ github.repository_owner }}"
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4.4.1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
driver-opts: |
image=moby/buildkit:master
network=host
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.7.0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata tags and labels on PRs
if: github.event_name == 'pull_request'
id: meta-pr
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz
tags: |
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}
labels: |
org.opencontainers.image.source="https://github.com/${{ github.repository_owner }}/quartz"
- name: Extract metadata tags and labels for main, release or tag
if: github.event_name != 'pull_request'
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=auto
images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}
labels: |
maintainer=${{ github.repository_owner }}
org.opencontainers.image.source="https://github.com/${{ github.repository_owner }}/quartz"
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
build-args: |
GIT_SHA=${{ env.GITHUB_SHA }}
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
tags: ${{ steps.meta.outputs.tags || steps.meta-pr.outputs.tags }}
labels: ${{ steps.meta.outputs.labels || steps.meta-pr.outputs.labels }}
cache-from: type=gha
cache-to: type=gha

View File

@ -21,6 +21,7 @@ const config: QuartzConfig = {
This part of the configuration concerns anything that can affect the whole site. The following is a list breaking down all the things you can configure: This part of the configuration concerns anything that can affect the whole site. The following is a list breaking down all the things you can configure:
- `pageTitle`: title of the site. This is also used when generating the [[RSS Feed]] for your site. - `pageTitle`: title of the site. This is also used when generating the [[RSS Feed]] for your site.
- `pageTitleSuffix`: a string added to the end of the page title. This only applies to the browser tab title, not the title shown at the top of the page.
- `enableSPA`: whether to enable [[SPA Routing]] on your site. - `enableSPA`: whether to enable [[SPA Routing]] on your site.
- `enablePopovers`: whether to enable [[popover previews]] on your site. - `enablePopovers`: whether to enable [[popover previews]] on your site.
- `analytics`: what to use for analytics on your site. Values can be - `analytics`: what to use for analytics on your site. Values can be
@ -32,6 +33,7 @@ This part of the configuration concerns anything that can affect the whole site.
- `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>', host: '<your-posthog-host>' }`: use [Posthog](https://posthog.com/); - `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>', host: '<your-posthog-host>' }`: use [Posthog](https://posthog.com/);
- `{ provider: 'tinylytics', siteId: '<your-site-id>' }`: use [Tinylytics](https://tinylytics.app/); - `{ provider: 'tinylytics', siteId: '<your-site-id>' }`: use [Tinylytics](https://tinylytics.app/);
- `{ provider: 'cabin' }` or `{ provider: 'cabin', host: 'https://cabin.example.com' }` (custom domain): use [Cabin](https://withcabin.com); - `{ provider: 'cabin' }` or `{ provider: 'cabin', host: 'https://cabin.example.com' }` (custom domain): use [Cabin](https://withcabin.com);
- `{provider: 'clarity', projectId: '<your-clarity-id-code' }`: use [Microsoft clarity](https://clarity.microsoft.com/). The project id can be found on top of the overview page.
- `locale`: used for [[i18n]] and date formatting - `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. - `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`. - 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`.
@ -101,7 +103,7 @@ transformers: [
] ]
``` ```
Some plugins are included by default in the[ `quartz.config.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz.config.ts), but there are more available. Some plugins are included by default in the [`quartz.config.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz.config.ts), but there are more available.
You can see a list of all plugins and their configuration options [[tags/plugin|here]]. You can see a list of all plugins and their configuration options [[tags/plugin|here]].

1043
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -36,40 +36,40 @@
}, },
"dependencies": { "dependencies": {
"@clack/prompts": "^0.7.0", "@clack/prompts": "^0.7.0",
"@floating-ui/dom": "^1.6.10", "@floating-ui/dom": "^1.6.11",
"@napi-rs/simple-git": "0.1.19", "@napi-rs/simple-git": "0.1.19",
"@tweenjs/tween.js": "^25.0.0", "@tweenjs/tween.js": "^25.0.0",
"async-mutex": "^0.5.0", "async-mutex": "^0.5.0",
"chalk": "^5.3.0", "chalk": "^5.3.0",
"chokidar": "^3.6.0", "chokidar": "^4.0.1",
"cli-spinner": "^0.2.10", "cli-spinner": "^0.2.10",
"d3": "^7.9.0", "d3": "^7.9.0",
"esbuild-sass-plugin": "^2.16.1", "esbuild-sass-plugin": "^3.3.1",
"flexsearch": "0.7.43", "flexsearch": "0.7.43",
"github-slugger": "^2.0.0", "github-slugger": "^2.0.0",
"globby": "^14.0.2", "globby": "^14.0.2",
"gray-matter": "^4.0.3", "gray-matter": "^4.0.3",
"hast-util-to-html": "^9.0.2", "hast-util-to-html": "^9.0.3",
"hast-util-to-jsx-runtime": "^2.3.0", "hast-util-to-jsx-runtime": "^2.3.0",
"hast-util-to-string": "^3.0.0", "hast-util-to-string": "^3.0.1",
"is-absolute-url": "^4.0.1", "is-absolute-url": "^4.0.1",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"lightningcss": "^1.26.0", "lightningcss": "^1.27.0",
"mdast-util-find-and-replace": "^3.0.1", "mdast-util-find-and-replace": "^3.0.1",
"mdast-util-to-hast": "^13.2.0", "mdast-util-to-hast": "^13.2.0",
"mdast-util-to-string": "^4.0.0", "mdast-util-to-string": "^4.0.0",
"micromorph": "^0.4.5", "micromorph": "^0.4.5",
"pixi.js": "^8.3.4", "pixi.js": "^8.4.1",
"preact": "^10.24.0", "preact": "^10.24.2",
"preact-render-to-string": "^6.5.11", "preact-render-to-string": "^6.5.11",
"pretty-bytes": "^6.1.1", "pretty-bytes": "^6.1.1",
"pretty-time": "^1.1.0", "pretty-time": "^1.1.0",
"reading-time": "^1.5.0", "reading-time": "^1.5.0",
"rehype-autolink-headings": "^7.1.0", "rehype-autolink-headings": "^7.1.0",
"rehype-citation": "^2.1.1", "rehype-citation": "^2.1.2",
"rehype-katex": "^7.0.1", "rehype-katex": "^7.0.1",
"rehype-mathjax": "^6.0.0", "rehype-mathjax": "^6.0.0",
"rehype-pretty-code": "^0.13.2", "rehype-pretty-code": "^0.14.0",
"rehype-raw": "^7.0.0", "rehype-raw": "^7.0.0",
"rehype-slug": "^6.0.0", "rehype-slug": "^6.0.0",
"remark": "^15.0.1", "remark": "^15.0.1",
@ -78,12 +78,12 @@
"remark-gfm": "^4.0.0", "remark-gfm": "^4.0.0",
"remark-math": "^6.0.0", "remark-math": "^6.0.0",
"remark-parse": "^11.0.0", "remark-parse": "^11.0.0",
"remark-rehype": "^11.1.0", "remark-rehype": "^11.1.1",
"remark-smartypants": "^3.0.2", "remark-smartypants": "^3.0.2",
"rfdc": "^1.4.1", "rfdc": "^1.4.1",
"rimraf": "^6.0.1", "rimraf": "^6.0.1",
"serve-handler": "^6.1.5", "serve-handler": "^6.1.5",
"shiki": "^1.12.1", "shiki": "^1.22.0",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"to-vfile": "^8.0.0", "to-vfile": "^8.0.0",
"toml": "^3.0.0", "toml": "^3.0.0",
@ -99,14 +99,14 @@
"@types/d3": "^7.4.3", "@types/d3": "^7.4.3",
"@types/hast": "^3.0.4", "@types/hast": "^3.0.4",
"@types/js-yaml": "^4.0.9", "@types/js-yaml": "^4.0.9",
"@types/node": "^22.5.5", "@types/node": "^22.7.5",
"@types/pretty-time": "^1.1.5", "@types/pretty-time": "^1.1.5",
"@types/source-map-support": "^0.5.10", "@types/source-map-support": "^0.5.10",
"@types/ws": "^8.5.12", "@types/ws": "^8.5.12",
"@types/yargs": "^17.0.33", "@types/yargs": "^17.0.33",
"esbuild": "^0.19.9", "esbuild": "^0.24.0",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"tsx": "^4.19.0", "tsx": "^4.19.1",
"typescript": "^5.6.2" "typescript": "^5.6.3"
} }
} }

View File

@ -9,6 +9,7 @@ import * as Plugin from "./quartz/plugins"
const config: QuartzConfig = { const config: QuartzConfig = {
configuration: { configuration: {
pageTitle: "🪴 Quartz 4.0", pageTitle: "🪴 Quartz 4.0",
pageTitleSuffix: "",
enableSPA: true, enableSPA: true,
enablePopovers: true, enablePopovers: true,
analytics: { analytics: {

View File

@ -38,9 +38,14 @@ export type Analytics =
provider: "cabin" provider: "cabin"
host?: string host?: string
} }
| {
provider: "clarity"
projectId?: string
}
export interface GlobalConfiguration { export interface GlobalConfiguration {
pageTitle: string pageTitle: string
pageTitleSuffix?: string
/** Whether to enable single-page-app style rendering. this prevents flashes of unstyled content and improves smoothness of Quartz */ /** Whether to enable single-page-app style rendering. this prevents flashes of unstyled content and improves smoothness of Quartz */
enableSPA: boolean enableSPA: boolean
/** Whether to display Wikipedia-style popovers when hovering over links */ /** Whether to display Wikipedia-style popovers when hovering over links */

View File

@ -6,7 +6,9 @@ import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } fro
export default (() => { export default (() => {
const Head: QuartzComponent = ({ cfg, fileData, externalResources }: QuartzComponentProps) => { const Head: QuartzComponent = ({ cfg, fileData, externalResources }: QuartzComponentProps) => {
const title = fileData.frontmatter?.title ?? i18n(cfg.locale).propertyDefaults.title const titleSuffix = cfg.pageTitleSuffix ?? ""
const title =
(fileData.frontmatter?.title ?? i18n(cfg.locale).propertyDefaults.title) + titleSuffix
const description = const description =
fileData.description?.trim() ?? i18n(cfg.locale).propertyDefaults.description fileData.description?.trim() ?? i18n(cfg.locale).propertyDefaults.description
const { css, js } = externalResources const { css, js } = externalResources

View File

@ -25,7 +25,6 @@ function toggleExplorer(this: HTMLElement) {
if (!content) return if (!content) return
content.classList.toggle("collapsed") content.classList.toggle("collapsed")
content.style.maxHeight = content.style.maxHeight === "0px" ? content.scrollHeight + "px" : "0px"
} }
function toggleFolder(evt: MouseEvent) { function toggleFolder(evt: MouseEvent) {

View File

@ -23,7 +23,6 @@ function toggleToc(this: HTMLElement) {
const content = this.nextElementSibling as HTMLElement | undefined const content = this.nextElementSibling as HTMLElement | undefined
if (!content) return if (!content) return
content.classList.toggle("collapsed") content.classList.toggle("collapsed")
content.style.maxHeight = content.style.maxHeight === "0px" ? content.scrollHeight + "px" : "0px"
} }
function setupToc() { function setupToc() {
@ -32,7 +31,6 @@ function setupToc() {
const collapsed = toc.classList.contains("collapsed") const collapsed = toc.classList.contains("collapsed")
const content = toc.nextElementSibling as HTMLElement | undefined const content = toc.nextElementSibling as HTMLElement | undefined
if (!content) return if (!content) return
content.style.maxHeight = collapsed ? "0px" : content.scrollHeight + "px"
toc.addEventListener("click", toggleToc) toc.addEventListener("click", toggleToc)
window.addCleanup(() => toc.removeEventListener("click", toggleToc)) window.addCleanup(() => toc.removeEventListener("click", toggleToc))
} }

View File

@ -1,10 +1,8 @@
@use "../../styles/variables.scss" as *; @use "../../styles/variables.scss" as *;
.backlinks { .backlinks {
@media all and not ($desktop) { flex-direction: column;
overflow-y: auto; /*&:after {
display: initial;
&:after {
pointer-events: none; pointer-events: none;
content: ""; content: "";
width: 100%; width: 100%;
@ -15,36 +13,31 @@
opacity: 1; opacity: 1;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
background: linear-gradient(transparent 0px, var(--light)); background: linear-gradient(transparent 0px, var(--light));
} }*/
&:has(> .overflow) { & > h3 {
position: unset; font-size: 1rem;
} margin: 0;
}
& > h3 {
font-size: 1rem;
margin: 0;
}
& > ul { & > ul {
list-style: none; list-style: none;
margin: 0.5rem 0; margin: 0.5rem 0;
& > li { & > li {
& > a { & > a {
background-color: transparent; background-color: transparent;
}
}
}
& > .overflow {
max-height: unset;
& > li:last-of-type {
margin-bottom: 0;
}
&:after {
display: none;
} }
} }
} }
& > .overflow {
&:after {
display: none;
}
height: auto;
@media all and ($desktop) {
height: 250px;
}
}
} }

View File

@ -1,10 +1,15 @@
@use "../../styles/variables.scss" as *; @use "../../styles/variables.scss" as *;
.explorer { .explorer {
display: flex;
flex-direction: column;
overflow-y: hidden;
&.desktop-only { &.desktop-only {
overflow-y: auto; @media all and not ($mobile) {
display: flex;
}
} }
&:after { /*&:after {
pointer-events: none; pointer-events: none;
content: ""; content: "";
width: 100%; width: 100%;
@ -15,7 +20,7 @@
opacity: 1; opacity: 1;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
background: linear-gradient(transparent 0px, var(--light)); background: linear-gradient(transparent 0px, var(--light));
} }*/
} }
button#explorer { button#explorer {
@ -62,7 +67,8 @@ button#explorer {
#explorer-content { #explorer-content {
list-style: none; list-style: none;
overflow: hidden; overflow: hidden;
max-height: none; overflow-y: auto;
max-height: 100%;
transition: transition:
max-height 0.35s ease, max-height 0.35s ease,
visibility 0s linear 0s; visibility 0s linear 0s;
@ -70,6 +76,7 @@ button#explorer {
visibility: visible; visibility: visible;
&.collapsed { &.collapsed {
max-height: 0;
transition: transition:
max-height 0.35s ease, max-height 0.35s ease,
visibility 0s linear 0.35s; visibility 0s linear 0.35s;

View File

@ -1,5 +1,10 @@
.toc { .toc {
overflow-y: auto; display: flex;
flex-direction: column;
&.desktop-only {
display: flex;
max-height: 40%;
}
} }
button#toc { button#toc {
@ -32,17 +37,19 @@ button#toc {
#toc-content { #toc-content {
list-style: none; list-style: none;
overflow: hidden; overflow: hidden;
max-height: none; overflow-y: auto;
max-height: 100%;
transition: transition:
max-height 0.5s ease, max-height 0.35s ease,
visibility 0s linear 0s; visibility 0s linear 0s;
position: relative; position: relative;
visibility: visible; visibility: visible;
&.collapsed { &.collapsed {
max-height: 0;
transition: transition:
max-height 0.5s ease, max-height 0.35s ease,
visibility 0s linear 0.5s; visibility 0s linear 0.35s;
visibility: hidden; visibility: hidden;
} }
@ -65,6 +72,10 @@ button#toc {
} }
} }
} }
> ul.overflow {
max-height: none;
width: 100%;
}
@for $i from 0 through 6 { @for $i from 0 through 6 {
& .depth-#{$i} { & .depth-#{$i} {

View File

@ -19,6 +19,7 @@ import pt from "./locales/pt-BR"
import hu from "./locales/hu-HU" import hu from "./locales/hu-HU"
import fa from "./locales/fa-IR" import fa from "./locales/fa-IR"
import pl from "./locales/pl-PL" import pl from "./locales/pl-PL"
import cs from "./locales/cs-CZ"
export const TRANSLATIONS = { export const TRANSLATIONS = {
"en-US": enUs, "en-US": enUs,
@ -62,6 +63,7 @@ export const TRANSLATIONS = {
"hu-HU": hu, "hu-HU": hu,
"fa-IR": fa, "fa-IR": fa,
"pl-PL": pl, "pl-PL": pl,
"cs-CZ": cs,
} as const } as const
export const defaultTranslation = "en-US" export const defaultTranslation = "en-US"

View File

@ -0,0 +1,84 @@
import { Translation } from "./definition"
export default {
propertyDefaults: {
title: "Bez názvu",
description: "Nebyl uveden žádný popis",
},
components: {
callout: {
note: "Poznámka",
abstract: "Abstract",
info: "Info",
todo: "Todo",
tip: "Tip",
success: "Úspěch",
question: "Otázka",
warning: "Upozornění",
failure: "Chyba",
danger: "Nebezpečí",
bug: "Bug",
example: "Příklad",
quote: "Citace",
},
backlinks: {
title: "Příchozí odkazy",
noBacklinksFound: "Nenalezeny žádné příchozí odkazy",
},
themeToggle: {
lightMode: "Světlý režim",
darkMode: "Tmavý režim",
},
explorer: {
title: "Procházet",
},
footer: {
createdWith: "Vytvořeno pomocí",
},
graph: {
title: "Graf",
},
recentNotes: {
title: "Nejnovější poznámky",
seeRemainingMore: ({ remaining }) => `Zobraz ${remaining} dalších →`,
},
transcludes: {
transcludeOf: ({ targetSlug }) => `Zobrazení ${targetSlug}`,
linkToOriginal: "Odkaz na původní dokument",
},
search: {
title: "Hledat",
searchBarPlaceholder: "Hledejte něco",
},
tableOfContents: {
title: "Obsah",
},
contentMeta: {
readingTime: ({ minutes }) => `${minutes} min čtení`,
},
},
pages: {
rss: {
recentNotes: "Nejnovější poznámky",
lastFewNotes: ({ count }) => `Posledních ${count} poznámek`,
},
error: {
title: "Nenalezeno",
notFound: "Tato stránka je buď soukromá, nebo neexistuje.",
home: "Návrat na domovskou stránku",
},
folderContent: {
folder: "Složka",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 položka v této složce." : `${count} položek v této složce.`,
},
tagContent: {
tag: "Tag",
tagIndex: "Rejstřík tagů",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 položka s tímto tagem." : `${count} položek s tímto tagem.`,
showingFirst: ({ count }) => `Zobrazují se první ${count} tagy.`,
totalTags: ({ count }) => `Nalezeno celkem ${count} tagů.`,
},
},
} as const satisfies Translation

View File

@ -152,6 +152,15 @@ function addGlobalPageResources(ctx: BuildCtx, componentResources: ComponentReso
cabinScript.async = true cabinScript.async = true
document.head.appendChild(cabinScript) document.head.appendChild(cabinScript)
`) `)
} else if (cfg.analytics?.provider === "clarity") {
componentResources.afterDOMLoaded.push(`
const clarityScript = document.createElement("script")
clarityScript.innerHTML= \`(function(c,l,a,r,i,t,y){c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "${cfg.analytics.projectId}");\`
document.head.appendChild(clarityScript)
`)
} }
if (cfg.enableSPA) { if (cfg.enableSPA) {

View File

@ -21,7 +21,7 @@ export const Citations: QuartzTransformerPlugin<Partial<Options>> = (userOpts) =
const opts = { ...defaultOptions, ...userOpts } const opts = { ...defaultOptions, ...userOpts }
return { return {
name: "Citations", name: "Citations",
htmlPlugins() { htmlPlugins(ctx) {
const plugins: PluggableList = [] const plugins: PluggableList = []
// Add rehype-citation to the list of plugins // Add rehype-citation to the list of plugins
@ -31,6 +31,8 @@ export const Citations: QuartzTransformerPlugin<Partial<Options>> = (userOpts) =
bibliography: opts.bibliographyFile, bibliography: opts.bibliographyFile,
suppressBibliography: opts.suppressBibliography, suppressBibliography: opts.suppressBibliography,
linkCitations: opts.linkCitations, linkCitations: opts.linkCitations,
csl: opts.csl,
lang: ctx.cfg.configuration.locale ?? "en-US",
}, },
]) ])

View File

@ -119,7 +119,7 @@ export const tableWikilinkRegex = new RegExp(/(!?\[\[[^\]]*?\]\])/g)
const highlightRegex = new RegExp(/==([^=]+)==/g) const highlightRegex = new RegExp(/==([^=]+)==/g)
const commentRegex = new RegExp(/%%[\s\S]*?%%/g) const commentRegex = new RegExp(/%%[\s\S]*?%%/g)
// from https://github.com/escwxyz/remark-obsidian-callout/blob/main/src/index.ts // from https://github.com/escwxyz/remark-obsidian-callout/blob/main/src/index.ts
const calloutRegex = new RegExp(/^\[\!(\w+)\|?(.+?)?\]([+-]?)/) const calloutRegex = new RegExp(/^\[\!([\w-]+)\|?(.+?)?\]([+-]?)/)
const calloutLineRegex = new RegExp(/^> *\[\!\w+\|?.*?\][+-]?.*$/gm) const calloutLineRegex = new RegExp(/^> *\[\!\w+\|?.*?\][+-]?.*$/gm)
// (?:^| ) -> non-capturing group, tag should start be separated by a space or be the start of the line // (?:^| ) -> non-capturing group, tag should start be separated by a space or be the start of the line
// #(...) -> capturing group, tag itself must start with # // #(...) -> capturing group, tag itself must start with #
@ -430,7 +430,9 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
children: [ children: [
{ {
type: "text", type: "text",
value: useDefaultTitle ? capitalize(typeString) : titleContent + " ", value: useDefaultTitle
? capitalize(typeString).replace(/-/g, " ")
: titleContent + " ",
}, },
...restOfTitle, ...restOfTitle,
], ],

View File

@ -182,7 +182,7 @@ a {
& .sidebar.left { & .sidebar.left {
z-index: 1; z-index: 1;
grid-area: sidebar-left; grid-area: grid-sidebar-left;
flex-direction: column; flex-direction: column;
@media all and ($mobile) { @media all and ($mobile) {
gap: 0; gap: 0;
@ -197,7 +197,7 @@ a {
} }
& .sidebar.right { & .sidebar.right {
grid-area: sidebar-right; grid-area: grid-sidebar-right;
margin-right: 0; margin-right: 0;
flex-direction: column; flex-direction: column;
@media all and ($mobile) { @media all and ($mobile) {
@ -224,7 +224,7 @@ a {
} }
& .page-header { & .page-header {
grid-area: page-header; grid-area: grid-header;
margin: $topSpacing 0 0 0; margin: $topSpacing 0 0 0;
@media all and ($mobile) { @media all and ($mobile) {
margin-top: 0; margin-top: 0;
@ -233,15 +233,17 @@ a {
} }
& .center > article { & .center > article {
grid-area: page-center; grid-area: grid-center;
} }
& .page-footer { & footer {
grid-area: page-footer; grid-area: grid-footer;
} }
& .center, & .center,
& footer { & footer {
max-width: 100%;
min-width: 100%;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
@media all and ($desktop) { @media all and ($desktop) {
@ -408,7 +410,7 @@ pre {
counter-increment: line 0; counter-increment: line 0;
display: grid; display: grid;
padding: 0.5rem 0; padding: 0.5rem 0;
overflow-x: scroll; overflow-x: auto;
& [data-highlighted-chars] { & [data-highlighted-chars] {
background-color: var(--highlight); background-color: var(--highlight);
@ -527,12 +529,14 @@ video {
} }
div:has(> .overflow) { div:has(> .overflow) {
position: relative; display: flex;
overflow-y: auto;
max-height: 100%;
} }
ul.overflow, ul.overflow,
ol.overflow { ol.overflow {
max-height: 400; max-height: 100%;
overflow-y: auto; overflow-y: auto;
// clearfix // clearfix
@ -542,8 +546,7 @@ ol.overflow {
& > li:last-of-type { & > li:last-of-type {
margin-bottom: 30px; margin-bottom: 30px;
} }
/*&:after {
&:after {
pointer-events: none; pointer-events: none;
content: ""; content: "";
width: 100%; width: 100%;
@ -554,7 +557,7 @@ ol.overflow {
opacity: 1; opacity: 1;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
background: linear-gradient(transparent 0px, var(--light)); background: linear-gradient(transparent 0px, var(--light));
} }*/
} }
.transclude { .transclude {

View File

@ -27,11 +27,11 @@ $mobileGrid: (
rowGap: "5px", rowGap: "5px",
columnGap: "5px", columnGap: "5px",
templateAreas: templateAreas:
'"sidebar-left"\ '"grid-sidebar-left"\
"page-header"\ "grid-header"\
"page-center"\ "grid-center"\
"sidebar-right"\ "grid-sidebar-right"\
"page-footer"', "grid-footer"',
); );
$tabletGrid: ( $tabletGrid: (
templateRows: "auto auto auto auto", templateRows: "auto auto auto auto",
@ -39,10 +39,10 @@ $tabletGrid: (
rowGap: "5px", rowGap: "5px",
columnGap: "5px", columnGap: "5px",
templateAreas: templateAreas:
'"sidebar-left page-header"\ '"grid-sidebar-left grid-header"\
"sidebar-left page-center"\ "grid-sidebar-left grid-center"\
"sidebar-left sidebar-right"\ "grid-sidebar-left grid-sidebar-right"\
"sidebar-left page-footer"', "grid-sidebar-left grid-footer"',
); );
$desktopGrid: ( $desktopGrid: (
templateRows: "auto auto auto", templateRows: "auto auto auto",
@ -50,7 +50,7 @@ $desktopGrid: (
rowGap: "5px", rowGap: "5px",
columnGap: "5px", columnGap: "5px",
templateAreas: templateAreas:
'"sidebar-left page-header sidebar-right"\ '"grid-sidebar-left grid-header grid-sidebar-right"\
"sidebar-left page-center sidebar-right"\ "grid-sidebar-left grid-center grid-sidebar-right"\
"sidebar-left page-footer sidebar-right"', "grid-sidebar-left grid-footer grid-sidebar-right"',
); );