Skip to content

Commit 97c3890

Browse files
committed
2 parents af71966 + e7d2a57 commit 97c3890

File tree

13 files changed

+288
-141
lines changed

13 files changed

+288
-141
lines changed

docs/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ This part of the configuration concerns anything that can affect the whole site.
3636
- `{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.
3737
- `{ provider: 'matomo', siteId: '<your-matomo-id-code', host: 'matomo.example.com' }`: use [Matomo](https://matomo.org/), without protocol.
3838
- `{ provider: 'vercel' }`: use [Vercel Web Analytics](https://vercel.com/docs/concepts/analytics).
39+
- `{ provider: 'rybbit', siteId: 'my-rybbit-id' }` (managed) or `{ provider: 'rybbit', siteId: 'my-rybbit-id', host: 'my-rybbit-domain.com' }` (self-hosted) use [Rybbit](https://rybbit.com);
3940
- `locale`: used for [[i18n]] and date formatting
4041
- `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.
4142
- 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`.

docs/features/explorer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ You can access the tags of a file by `node.data.tags`.
162162
Component.Explorer({
163163
filterFn: (node) => {
164164
// exclude files with the tag "explorerexclude"
165-
return node.data.tags?.includes("explorerexclude") !== true
165+
return node.data?.tags?.includes("explorerexclude") !== true
166166
},
167167
})
168168
```

package-lock.json

Lines changed: 117 additions & 117 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"mdast-util-to-hast": "^13.2.0",
6161
"mdast-util-to-string": "^4.0.0",
6262
"micromorph": "^0.4.5",
63-
"minimatch": "^10.0.3",
63+
"minimatch": "^10.1.1",
6464
"pixi.js": "^8.14.0",
6565
"preact": "^10.27.2",
6666
"preact-render-to-string": "^6.6.3",
@@ -101,12 +101,12 @@
101101
"@types/d3": "^7.4.3",
102102
"@types/hast": "^3.0.4",
103103
"@types/js-yaml": "^4.0.9",
104-
"@types/node": "^24.9.1",
104+
"@types/node": "^24.10.0",
105105
"@types/pretty-time": "^1.1.5",
106106
"@types/source-map-support": "^0.5.10",
107107
"@types/ws": "^8.18.1",
108108
"@types/yargs": "^17.0.34",
109-
"esbuild": "^0.25.11",
109+
"esbuild": "^0.25.12",
110110
"prettier": "^3.6.2",
111111
"tsx": "^4.20.6",
112112
"typescript": "^5.9.3"

quartz/cfg.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ export type Analytics =
5050
| {
5151
provider: "vercel"
5252
}
53+
| {
54+
provider: "rybbit"
55+
siteId: string
56+
host?: string
57+
}
5358

5459
export interface GlobalConfiguration {
5560
pageTitle: string

quartz/components/renderPage.tsx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { visit } from "unist-util-visit"
99
import { Root, Element, ElementContent } from "hast"
1010
import { GlobalConfiguration } from "../cfg"
1111
import { i18n } from "../i18n"
12+
import { styleText } from "util"
1213

1314
interface RenderComponents {
1415
head: QuartzComponent
@@ -68,6 +69,7 @@ function renderTranscludes(
6869
cfg: GlobalConfiguration,
6970
slug: FullSlug,
7071
componentData: QuartzComponentProps,
72+
visited: Set<FullSlug>,
7173
) {
7274
// process transcludes in componentData
7375
visit(root, "element", (node, _index, _parent) => {
@@ -76,6 +78,30 @@ function renderTranscludes(
7678
if (classNames.includes("transclude")) {
7779
const inner = node.children[0] as Element
7880
const transcludeTarget = (inner.properties["data-slug"] ?? slug) as FullSlug
81+
if (visited.has(transcludeTarget)) {
82+
console.warn(
83+
styleText(
84+
"yellow",
85+
`Warning: Skipping circular transclusion: ${slug} -> ${transcludeTarget}`,
86+
),
87+
)
88+
node.children = [
89+
{
90+
type: "element",
91+
tagName: "p",
92+
properties: { style: "color: var(--secondary);" },
93+
children: [
94+
{
95+
type: "text",
96+
value: `Circular transclusion detected: ${transcludeTarget}`,
97+
},
98+
],
99+
},
100+
]
101+
return
102+
}
103+
visited.add(transcludeTarget)
104+
79105
const page = componentData.allFiles.find((f) => f.slug === transcludeTarget)
80106
if (!page) {
81107
return
@@ -196,7 +222,8 @@ export function renderPage(
196222
// make a deep copy of the tree so we don't remove the transclusion references
197223
// for the file cached in contentMap in build.ts
198224
const root = clone(componentData.tree) as Root
199-
renderTranscludes(root, cfg, slug, componentData)
225+
const visited = new Set<FullSlug>([slug])
226+
renderTranscludes(root, cfg, slug, componentData, visited)
200227

201228
// set componentData.tree to the edited html that has transclusions rendered
202229
componentData.tree = root

quartz/components/styles/search.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
& > p {
2626
display: inline;
2727
color: var(--gray);
28+
text-wrap: unset;
2829
}
2930

3031
& svg {

quartz/i18n/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import fi from "./locales/fi-FI"
2828
import no from "./locales/nb-NO"
2929
import id from "./locales/id-ID"
3030
import kk from "./locales/kk-KZ"
31+
import he from "./locales/he-IL"
3132

3233
export const TRANSLATIONS = {
3334
"en-US": enUs,
@@ -80,6 +81,7 @@ export const TRANSLATIONS = {
8081
"nb-NO": no,
8182
"id-ID": id,
8283
"kk-KZ": kk,
84+
"he-IL": he,
8385
} as const
8486

8587
export const defaultTranslation = "en-US"

quartz/i18n/locales/he-IL.ts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import { Translation } from "./definition"
2+
3+
export default {
4+
propertyDefaults: {
5+
title: "ללא כותרת",
6+
description: "לא סופק תיאור",
7+
},
8+
direction: "rtl" as const,
9+
components: {
10+
callout: {
11+
note: "הערה",
12+
abstract: "תקציר",
13+
info: "מידע",
14+
todo: "לעשות",
15+
tip: "טיפ",
16+
success: "הצלחה",
17+
question: "שאלה",
18+
warning: "אזהרה",
19+
failure: "כשלון",
20+
danger: "סכנה",
21+
bug: "באג",
22+
example: "דוגמה",
23+
quote: "ציטוט",
24+
},
25+
backlinks: {
26+
title: "קישורים חוזרים",
27+
noBacklinksFound: "לא נמצאו קישורים חוזרים",
28+
},
29+
themeToggle: {
30+
lightMode: "מצב בהיר",
31+
darkMode: "מצב כהה",
32+
},
33+
readerMode: {
34+
title: "מצב קריאה",
35+
},
36+
explorer: {
37+
title: "סייר",
38+
},
39+
footer: {
40+
createdWith: "נוצר באמצעות",
41+
},
42+
graph: {
43+
title: "מבט גרף",
44+
},
45+
recentNotes: {
46+
title: "הערות אחרונות",
47+
seeRemainingMore: ({ remaining }) => `עיין ב ${remaining} נוספים →`,
48+
},
49+
transcludes: {
50+
transcludeOf: ({ targetSlug }) => `מצוטט מ ${targetSlug}`,
51+
linkToOriginal: "קישור למקורי",
52+
},
53+
search: {
54+
title: "חיפוש",
55+
searchBarPlaceholder: "חפשו משהו",
56+
},
57+
tableOfContents: {
58+
title: "תוכן עניינים",
59+
},
60+
contentMeta: {
61+
readingTime: ({ minutes }) => `${minutes} דקות קריאה`,
62+
},
63+
},
64+
pages: {
65+
rss: {
66+
recentNotes: "הערות אחרונות",
67+
lastFewNotes: ({ count }) => `${count} הערות אחרונות`,
68+
},
69+
error: {
70+
title: "לא נמצא",
71+
notFound: "העמוד הזה פרטי או לא קיים.",
72+
home: "חזרה לעמוד הבית",
73+
},
74+
folderContent: {
75+
folder: "תיקייה",
76+
itemsUnderFolder: ({ count }) =>
77+
count === 1 ? "פריט אחד תחת תיקייה זו." : `${count} פריטים תחת תיקייה זו.`,
78+
},
79+
tagContent: {
80+
tag: "תגית",
81+
tagIndex: "מפתח התגיות",
82+
itemsUnderTag: ({ count }) =>
83+
count === 1 ? "פריט אחד עם תגית זו." : `${count} פריטים עם תגית זו.`,
84+
showingFirst: ({ count }) => `מראה את ה-${count} תגיות הראשונות.`,
85+
totalTags: ({ count }) => `${count} תגיות נמצאו סך הכל.`,
86+
},
87+
},
88+
} as const satisfies Translation

quartz/i18n/locales/it-IT.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
components: {
99
callout: {
1010
note: "Nota",
11-
abstract: "Astratto",
11+
abstract: "Abstract",
1212
info: "Info",
1313
todo: "Da fare",
1414
tip: "Consiglio",
@@ -17,7 +17,7 @@ export default {
1717
warning: "Attenzione",
1818
failure: "Errore",
1919
danger: "Pericolo",
20-
bug: "Bug",
20+
bug: "Problema",
2121
example: "Esempio",
2222
quote: "Citazione",
2323
},
@@ -43,27 +43,28 @@ export default {
4343
},
4444
recentNotes: {
4545
title: "Note recenti",
46-
seeRemainingMore: ({ remaining }) => `Vedi ${remaining} altro →`,
46+
seeRemainingMore: ({ remaining }) =>
47+
remaining === 1 ? "Vedi 1 altra →" : `Vedi altre ${remaining} →`,
4748
},
4849
transcludes: {
49-
transcludeOf: ({ targetSlug }) => `Transclusione di ${targetSlug}`,
50+
transcludeOf: ({ targetSlug }) => `Inclusione di ${targetSlug}`,
5051
linkToOriginal: "Link all'originale",
5152
},
5253
search: {
5354
title: "Cerca",
5455
searchBarPlaceholder: "Cerca qualcosa",
5556
},
5657
tableOfContents: {
57-
title: "Tabella dei contenuti",
58+
title: "Indice",
5859
},
5960
contentMeta: {
60-
readingTime: ({ minutes }) => `${minutes} minuti`,
61+
readingTime: ({ minutes }) => (minutes === 1 ? "1 minuto" : `${minutes} minuti`),
6162
},
6263
},
6364
pages: {
6465
rss: {
6566
recentNotes: "Note recenti",
66-
lastFewNotes: ({ count }) => `Ultime ${count} note`,
67+
lastFewNotes: ({ count }) => (count === 1 ? "Ultima nota" : `Ultime ${count} note`),
6768
},
6869
error: {
6970
title: "Non trovato",
@@ -80,8 +81,9 @@ export default {
8081
tagIndex: "Indice etichette",
8182
itemsUnderTag: ({ count }) =>
8283
count === 1 ? "1 oggetto con questa etichetta." : `${count} oggetti con questa etichetta.`,
83-
showingFirst: ({ count }) => `Prime ${count} etichette.`,
84-
totalTags: ({ count }) => `Trovate ${count} etichette totali.`,
84+
showingFirst: ({ count }) => (count === 1 ? "Prima etichetta." : `Prime ${count} etichette.`),
85+
totalTags: ({ count }) =>
86+
count === 1 ? "Trovata 1 etichetta in totale." : `Trovate ${count} etichette totali.`,
8587
},
8688
},
8789
} as const satisfies Translation

0 commit comments

Comments
 (0)