Skip to content

Commit c6f35d5

Browse files
Merge remote-tracking branch 'origin/main'
2 parents 2b5e803 + 8551f69 commit c6f35d5

28 files changed

+694
-53
lines changed

package-lock.json

+440-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"github-slugger": "^2.0.0",
4949
"globby": "^14.0.1",
5050
"gray-matter": "^4.0.3",
51-
"hast-util-to-html": "^9.0.0",
51+
"hast-util-to-html": "^9.0.1",
5252
"hast-util-to-jsx-runtime": "^2.3.0",
5353
"hast-util-to-string": "^3.0.0",
5454
"is-absolute-url": "^4.0.1",
@@ -79,17 +79,17 @@
7979
"remark-rehype": "^11.1.0",
8080
"remark-smartypants": "^2.1.0",
8181
"rfdc": "^1.3.1",
82-
"rimraf": "^5.0.5",
82+
"rimraf": "^5.0.7",
8383
"serve-handler": "^6.1.5",
84-
"shiki": "^1.2.3",
84+
"shiki": "^1.6.0",
8585
"source-map-support": "^0.5.21",
8686
"to-vfile": "^8.0.0",
8787
"toml": "^3.0.0",
8888
"unified": "^11.0.4",
8989
"unist-util-visit": "^5.0.0",
9090
"vfile": "^6.0.1",
9191
"workerpool": "^9.1.1",
92-
"ws": "^8.15.1",
92+
"ws": "^8.17.0",
9393
"yargs": "^17.7.2"
9494
},
9595
"devDependencies": {
@@ -104,7 +104,7 @@
104104
"@types/yargs": "^17.0.32",
105105
"esbuild": "^0.19.9",
106106
"prettier": "^3.2.4",
107-
"tsx": "^4.7.1",
108-
"typescript": "^5.4.3"
107+
"tsx": "^4.11.0",
108+
"typescript": "^5.4.5"
109109
}
110110
}

quartz.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ const config: QuartzConfig = {
5656
Plugin.CreatedModifiedDate({
5757
priority: ["frontmatter", "filesystem"],
5858
}),
59-
Plugin.Latex({ renderEngine: "katex" }),
6059
Plugin.SyntaxHighlighting({
6160
theme: {
6261
light: "github-light",
@@ -69,6 +68,7 @@ const config: QuartzConfig = {
6968
Plugin.TableOfContents(),
7069
Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }),
7170
Plugin.Description(),
71+
Plugin.Latex({ renderEngine: "katex" }),
7272
],
7373
filters: [Plugin.RemoveDrafts()],
7474
emitters: [

quartz/cfg.ts

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export type Analytics =
3030
apiKey: string
3131
host?: string
3232
}
33+
| {
34+
provider: "tinylytics"
35+
siteId: string
36+
}
3337

3438
export interface GlobalConfiguration {
3539
pageTitle: string

quartz/components/RecentNotes.tsx

+16-12
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ interface Options {
1212
title?: string
1313
limit: number
1414
linkToMore: SimpleSlug | false
15+
showTags: boolean
1516
filter: (f: QuartzPluginData) => boolean
1617
sort: (f1: QuartzPluginData, f2: QuartzPluginData) => number
1718
}
1819

1920
const defaultOptions = (cfg: GlobalConfiguration): Options => ({
2021
limit: 3,
2122
linkToMore: false,
23+
showTags: true,
2224
filter: () => true,
2325
sort: byDateAndAlphabetical(cfg),
2426
})
@@ -56,18 +58,20 @@ export default ((userOpts?: Partial<Options>) => {
5658
<Date date={getDate(cfg, page)!} locale={cfg.locale} />
5759
</p>
5860
)}
59-
<ul class="tags">
60-
{tags.map((tag) => (
61-
<li>
62-
<a
63-
class="internal tag-link"
64-
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
65-
>
66-
{tag}
67-
</a>
68-
</li>
69-
))}
70-
</ul>
61+
{opts.showTags && (
62+
<ul class="tags">
63+
{tags.map((tag) => (
64+
<li>
65+
<a
66+
class="internal tag-link"
67+
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
68+
>
69+
{tag}
70+
</a>
71+
</li>
72+
))}
73+
</ul>
74+
)}
7175
</div>
7276
</li>
7377
)

quartz/components/pages/404.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ import { i18n } from "../../i18n"
22
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types"
33

44
const NotFound: QuartzComponent = ({ cfg }: QuartzComponentProps) => {
5+
// If baseUrl contains a pathname after the domain, use this as the home link
6+
const url = new URL(`https://${cfg.baseUrl ?? "example.com"}`)
7+
const baseDir = url.pathname
8+
59
return (
610
<article class="popover-hint">
711
<h1>404</h1>
812
<p>{i18n(cfg.locale).pages.error.notFound}</p>
13+
<a href={baseDir}>{i18n(cfg.locale).pages.error.home}</a>
914
</article>
1015
)
1116
}

quartz/components/scripts/graph.inline.ts

+25
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,18 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
223223
.transition()
224224
.duration(200)
225225
.style("opacity", 0.2)
226+
227+
d3.selectAll<HTMLElement, NodeData>(".node")
228+
.filter((d) => !connectedNodes.includes(d.id))
229+
.nodes()
230+
.map((it) => d3.select(it.parentNode as HTMLElement).select("text"))
231+
.forEach((it) => {
232+
let opacity = parseFloat(it.style("opacity"))
233+
it.transition()
234+
.duration(200)
235+
.attr("opacityOld", opacity)
236+
.style("opacity", Math.min(opacity, 0.2))
237+
})
226238
}
227239

228240
// highlight links
@@ -245,6 +257,12 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
245257
if (focusOnHover) {
246258
d3.selectAll<HTMLElement, NodeData>(".link").transition().duration(200).style("opacity", 1)
247259
d3.selectAll<HTMLElement, NodeData>(".node").transition().duration(200).style("opacity", 1)
260+
261+
d3.selectAll<HTMLElement, NodeData>(".node")
262+
.filter((d) => !connectedNodes.includes(d.id))
263+
.nodes()
264+
.map((it) => d3.select(it.parentNode as HTMLElement).select("text"))
265+
.forEach((it) => it.transition().duration(200).style("opacity", it.attr("opacityOld")))
248266
}
249267
const currentId = d.id
250268
const linkNodes = d3
@@ -264,6 +282,13 @@ async function renderGraph(container: string, fullSlug: FullSlug) {
264282
// @ts-ignore
265283
.call(drag(simulation))
266284

285+
// make tags hollow circles
286+
node
287+
.filter((d) => d.id.startsWith("tags/"))
288+
.attr("stroke", color)
289+
.attr("stroke-width", 2)
290+
.attr("fill", "var(--light)")
291+
267292
// draw labels
268293
const labels = graphNode
269294
.append("text")

quartz/i18n/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import zh from "./locales/zh-CN"
1515
import vi from "./locales/vi-VN"
1616
import pt from "./locales/pt-BR"
1717
import hu from "./locales/hu-HU"
18+
import fa from "./locales/fa-IR"
19+
import pl from "./locales/pl-PL"
1820

1921
export const TRANSLATIONS = {
2022
"en-US": en,
@@ -54,6 +56,8 @@ export const TRANSLATIONS = {
5456
"vi-VN": vi,
5557
"pt-BR": pt,
5658
"hu-HU": hu,
59+
"fa-IR": fa,
60+
"pl-PL": pl,
5761
} as const
5862

5963
export const defaultTranslation = "en-US"

quartz/i18n/locales/ar-SA.ts

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export default {
7070
error: {
7171
title: "غير موجود",
7272
notFound: "إما أن هذه الصفحة خاصة أو غير موجودة.",
73+
home: "العوده للصفحة الرئيسية",
7374
},
7475
folderContent: {
7576
folder: "مجلد",

quartz/i18n/locales/de-DE.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
error: {
6666
title: "Nicht gefunden",
6767
notFound: "Diese Seite ist entweder nicht öffentlich oder existiert nicht.",
68+
home: "Return to Homepage",
6869
},
6970
folderContent: {
7071
folder: "Ordner",

quartz/i18n/locales/definition.ts

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export interface Translation {
6767
error: {
6868
title: string
6969
notFound: string
70+
home: string
7071
}
7172
folderContent: {
7273
folder: string

quartz/i18n/locales/en-US.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
error: {
6666
title: "Not Found",
6767
notFound: "Either this page is private or doesn't exist.",
68+
home: "Return to Homepage",
6869
},
6970
folderContent: {
7071
folder: "Folder",

quartz/i18n/locales/es-ES.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
error: {
6666
title: "No se encontró.",
6767
notFound: "Esta página es privada o no existe.",
68+
home: "Regresar a la página principal",
6869
},
6970
folderContent: {
7071
folder: "Carpeta",

quartz/i18n/locales/fa-IR.ts

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { Translation } from "./definition"
2+
3+
export default {
4+
propertyDefaults: {
5+
title: "بدون عنوان",
6+
description: "توضیح خاصی اضافه نشده است",
7+
},
8+
components: {
9+
callout: {
10+
note: "یادداشت",
11+
abstract: "چکیده",
12+
info: "اطلاعات",
13+
todo: "اقدام",
14+
tip: "نکته",
15+
success: "تیک",
16+
question: "سؤال",
17+
warning: "هشدار",
18+
failure: "شکست",
19+
danger: "خطر",
20+
bug: "باگ",
21+
example: "مثال",
22+
quote: "نقل قول",
23+
},
24+
backlinks: {
25+
title: "بک‌لینک‌ها",
26+
noBacklinksFound: "بدون بک‌لینک",
27+
},
28+
themeToggle: {
29+
lightMode: "حالت روشن",
30+
darkMode: "حالت تاریک",
31+
},
32+
explorer: {
33+
title: "مطالب",
34+
},
35+
footer: {
36+
createdWith: "ساخته شده با",
37+
},
38+
graph: {
39+
title: "نمای گراف",
40+
},
41+
recentNotes: {
42+
title: "یادداشت‌های اخیر",
43+
seeRemainingMore: ({ remaining }) => `${remaining} یادداشت دیگر →`,
44+
},
45+
transcludes: {
46+
transcludeOf: ({ targetSlug }) => `از ${targetSlug}`,
47+
linkToOriginal: "پیوند به اصلی",
48+
},
49+
search: {
50+
title: "جستجو",
51+
searchBarPlaceholder: "مطلبی را جستجو کنید",
52+
},
53+
tableOfContents: {
54+
title: "فهرست",
55+
},
56+
contentMeta: {
57+
readingTime: ({ minutes }) => `زمان تقریبی مطالعه: ${minutes} دقیقه`,
58+
},
59+
},
60+
pages: {
61+
rss: {
62+
recentNotes: "یادداشت‌های اخیر",
63+
lastFewNotes: ({ count }) => `${count} یادداشت اخیر`,
64+
},
65+
error: {
66+
title: "یافت نشد",
67+
notFound: "این صفحه یا خصوصی است یا وجود ندارد",
68+
home: "بازگشت به صفحه اصلی",
69+
},
70+
folderContent: {
71+
folder: "پوشه",
72+
itemsUnderFolder: ({ count }) =>
73+
count === 1 ? ".یک مطلب در این پوشه است" : `${count} مطلب در این پوشه است.`,
74+
},
75+
tagContent: {
76+
tag: "برچسب",
77+
tagIndex: "فهرست برچسب‌ها",
78+
itemsUnderTag: ({ count }) =>
79+
count === 1 ? "یک مطلب با این برچسب" : `${count} مطلب با این برچسب.`,
80+
showingFirst: ({ count }) => `در حال نمایش ${count} برچسب.`,
81+
totalTags: ({ count }) => `${count} برچسب یافت شد.`,
82+
},
83+
},
84+
} as const satisfies Translation

quartz/i18n/locales/fr-FR.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
error: {
6666
title: "Introuvable",
6767
notFound: "Cette page est soit privée, soit elle n'existe pas.",
68+
home: "Retour à la page d'accueil",
6869
},
6970
folderContent: {
7071
folder: "Dossier",

quartz/i18n/locales/hu-HU.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
error: {
6666
title: "Nem található",
6767
notFound: "Ez a lap vagy privát vagy nem létezik.",
68+
home: "Vissza a kezdőlapra",
6869
},
6970
folderContent: {
7071
folder: "Mappa",

quartz/i18n/locales/it-IT.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
error: {
6666
title: "Non trovato",
6767
notFound: "Questa pagina è privata o non esiste.",
68+
home: "Ritorna alla home page",
6869
},
6970
folderContent: {
7071
folder: "Cartella",

quartz/i18n/locales/ja-JP.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
error: {
6666
title: "Not Found",
6767
notFound: "ページが存在しないか、非公開設定になっています。",
68+
home: "ホームページに戻る",
6869
},
6970
folderContent: {
7071
folder: "フォルダ",

quartz/i18n/locales/ko-KR.ts

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
error: {
6666
title: "Not Found",
6767
notFound: "페이지가 존재하지 않거나 비공개 설정이 되어 있습니다.",
68+
home: "홈페이지로 돌아가기",
6869
},
6970
folderContent: {
7071
folder: "폴더",

quartz/i18n/locales/nl-NL.ts

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export default {
6666
error: {
6767
title: "Niet gevonden",
6868
notFound: "Deze pagina is niet zichtbaar of bestaat niet.",
69+
home: "Keer terug naar de start pagina",
6970
},
7071
folderContent: {
7172
folder: "Map",

0 commit comments

Comments
 (0)