Skip to content

Commit 3051c92

Browse files
committed
Quartz sync: May 18, 2025, 12:12 PM
1 parent 6fb04e5 commit 3051c92

File tree

6 files changed

+200
-187
lines changed

6 files changed

+200
-187
lines changed

quartz.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const config: QuartzConfig = {
3535
darkgray: "#4e4e4e",
3636
dark: "#2b2b2b",
3737
secondary: "#284b63",
38-
tertiary: "#84a59d",
38+
tertiary: "#c27ba0",
3939
highlight: "rgba(143, 159, 169, 0.15)",
4040
textHighlight: "#fff23688",
4141
},
@@ -46,7 +46,7 @@ const config: QuartzConfig = {
4646
darkgray: "#d4d4d4",
4747
dark: "#ebebec",
4848
secondary: "#7b97aa",
49-
tertiary: "#84a59d",
49+
tertiary: "#c27ba0",
5050
highlight: "rgba(143, 159, 169, 0.15)",
5151
textHighlight: "#b3aa0288",
5252
},

quartz.layout.ts

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import * as Component from "./quartz/components"
44
// components shared across all pages
55
export const sharedPageComponents: SharedLayout = {
66
head: Component.Head(),
7-
header: [],
7+
header: [
8+
],
89
afterBody: [
910
Component.Comments({
1011
provider: 'giscus',
@@ -47,10 +48,20 @@ export const defaultContentPageLayout: PageLayout = {
4748
grow: true,
4849
},
4950
{ Component: Component.Darkmode() },
50-
{ Component: Component.ReaderMode() },
51+
// { Component: Component.ReaderMode() },
5152
],
5253
}),
53-
Component.Explorer(),
54+
// Component.Explorer(),
55+
Component.Explorer({
56+
mapFn: (node) => {
57+
if (node.isFolder) {
58+
node.displayName = "📁 " + node.displayName
59+
}
60+
},
61+
}),
62+
// Component.RecentNotes({
63+
// limit: 5,
64+
// }),
5465
],
5566
right: [
5667
Component.Graph(),
@@ -74,14 +85,15 @@ export const defaultListPageLayout: PageLayout = {
7485
{ Component: Component.Darkmode() },
7586
],
7687
}),
77-
Component.Explorer(),
78-
// Component.Explorer({
79-
// mapFn: (node) => {
80-
// if (node.isFolder) {
81-
// node.displayName = "📁 " + node.displayName
82-
// }
83-
// },
84-
// })
88+
// Component.Explorer(),
89+
Component.Explorer({
90+
mapFn: (node) => {
91+
if (node.isFolder) {
92+
node.displayName = "📁 " + node.displayName
93+
}
94+
},
95+
}),
96+
// Component.RecentNotes({ limit: 5 }),
8597
],
8698
right: [],
8799
}

quartz/components/Graph.tsx

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -6,81 +6,81 @@ import { i18n } from "../i18n"
66
import { classNames } from "../util/lang"
77

88
export interface D3Config {
9-
drag: boolean
10-
zoom: boolean
11-
depth: number
12-
scale: number
13-
repelForce: number
14-
centerForce: number
15-
linkDistance: number
16-
fontSize: number
17-
opacityScale: number
18-
removeTags: string[]
19-
showTags: boolean
20-
focusOnHover?: boolean
21-
enableRadial?: boolean
9+
drag: boolean
10+
zoom: boolean
11+
depth: number
12+
scale: number
13+
repelForce: number
14+
centerForce: number
15+
linkDistance: number
16+
fontSize: number
17+
opacityScale: number
18+
removeTags: string[]
19+
showTags: boolean
20+
focusOnHover?: boolean
21+
enableRadial?: boolean
2222
}
2323

2424
interface GraphOptions {
25-
localGraph: Partial<D3Config> | undefined
26-
globalGraph: Partial<D3Config> | undefined
25+
localGraph: Partial<D3Config> | undefined
26+
globalGraph: Partial<D3Config> | undefined
2727
}
2828

2929
const defaultOptions: GraphOptions = {
30-
localGraph: {
31-
drag: true,
32-
zoom: true,
33-
depth: 1,
34-
scale: 1.1,
35-
repelForce: 0.5,
36-
centerForce: 0.3,
37-
linkDistance: 30,
38-
fontSize: 0.6,
39-
opacityScale: 1,
40-
showTags: true,
41-
removeTags: [],
42-
focusOnHover: false,
43-
enableRadial: false,
44-
},
45-
globalGraph: {
46-
drag: true,
47-
zoom: true,
48-
depth: -1,
49-
scale: 0.9,
50-
repelForce: 0.5,
51-
centerForce: 0.2,
52-
linkDistance: 30,
53-
fontSize: 0.6,
54-
opacityScale: 1,
55-
showTags: true,
56-
removeTags: [],
57-
focusOnHover: true,
58-
enableRadial: true,
59-
},
30+
localGraph: {
31+
drag: true,
32+
zoom: true,
33+
depth: 1,
34+
scale: 1.1,
35+
repelForce: 0.5,
36+
centerForce: 0.3,
37+
linkDistance: 30,
38+
fontSize: 0.6,
39+
opacityScale: 1,
40+
showTags: true,
41+
removeTags: [],
42+
focusOnHover: true,
43+
enableRadial: false,
44+
},
45+
globalGraph: {
46+
drag: true,
47+
zoom: true,
48+
depth: -1,
49+
scale: 0.9,
50+
repelForce: 0.5,
51+
centerForce: 0.2,
52+
linkDistance: 30,
53+
fontSize: 0.6,
54+
opacityScale: 3,
55+
showTags: true,
56+
removeTags: [],
57+
focusOnHover: true,
58+
enableRadial: true,
59+
},
6060
}
6161

6262
export default ((opts?: Partial<GraphOptions>) => {
63-
const Graph: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
64-
const localGraph = { ...defaultOptions.localGraph, ...opts?.localGraph }
65-
const globalGraph = { ...defaultOptions.globalGraph, ...opts?.globalGraph }
66-
return (
67-
<div class={classNames(displayClass, "graph")}>
68-
<h3>{i18n(cfg.locale).components.graph.title}</h3>
69-
<div class="graph-outer">
70-
<div class="graph-container" data-cfg={JSON.stringify(localGraph)}></div>
71-
<button class="global-graph-icon" aria-label="Global Graph">
72-
<svg
73-
version="1.1"
74-
xmlns="http://www.w3.org/2000/svg"
75-
xmlnsXlink="http://www.w3.org/1999/xlink"
76-
x="0px"
77-
y="0px"
78-
viewBox="0 0 55 55"
79-
fill="currentColor"
80-
xmlSpace="preserve"
81-
>
82-
<path
83-
d="M49,0c-3.309,0-6,2.691-6,6c0,1.035,0.263,2.009,0.726,2.86l-9.829,9.829C32.542,17.634,30.846,17,29,17
63+
const Graph: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
64+
const localGraph = { ...defaultOptions.localGraph, ...opts?.localGraph }
65+
const globalGraph = { ...defaultOptions.globalGraph, ...opts?.globalGraph }
66+
return (
67+
<div class={classNames(displayClass, "graph")}>
68+
<h3>{i18n(cfg.locale).components.graph.title}</h3>
69+
<div class="graph-outer">
70+
<div class="graph-container" data-cfg={JSON.stringify(localGraph)}></div>
71+
<button class="global-graph-icon" aria-label="Global Graph">
72+
<svg
73+
version="1.1"
74+
xmlns="http://www.w3.org/2000/svg"
75+
xmlnsXlink="http://www.w3.org/1999/xlink"
76+
x="0px"
77+
y="0px"
78+
viewBox="0 0 55 55"
79+
fill="currentColor"
80+
xmlSpace="preserve"
81+
>
82+
<path
83+
d="M49,0c-3.309,0-6,2.691-6,6c0,1.035,0.263,2.009,0.726,2.86l-9.829,9.829C32.542,17.634,30.846,17,29,17
8484
s-3.542,0.634-4.898,1.688l-7.669-7.669C16.785,10.424,17,9.74,17,9c0-2.206-1.794-4-4-4S9,6.794,9,9s1.794,4,4,4
8585
c0.74,0,1.424-0.215,2.019-0.567l7.669,7.669C21.634,21.458,21,23.154,21,25s0.634,3.542,1.688,4.897L10.024,42.562
8686
C8.958,41.595,7.549,41,6,41c-3.309,0-6,2.691-6,6s2.691,6,6,6s6-2.691,6-6c0-1.035-0.263-2.009-0.726-2.86l12.829-12.829
@@ -91,19 +91,19 @@ export default ((opts?: Partial<GraphOptions>) => {
9191
S11,10.103,11,9z M6,51c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S8.206,51,6,51z M33,49c0,2.206-1.794,4-4,4s-4-1.794-4-4
9292
s1.794-4,4-4S33,46.794,33,49z M29,31c-3.309,0-6-2.691-6-6s2.691-6,6-6s6,2.691,6,6S32.309,31,29,31z M47,41c0,1.103-0.897,2-2,2
9393
s-2-0.897-2-2s0.897-2,2-2S47,39.897,47,41z M49,10c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S51.206,10,49,10z"
94-
/>
95-
</svg>
96-
</button>
97-
</div>
98-
<div class="global-graph-outer">
99-
<div class="global-graph-container" data-cfg={JSON.stringify(globalGraph)}></div>
100-
</div>
101-
</div>
102-
)
103-
}
94+
/>
95+
</svg>
96+
</button>
97+
</div>
98+
<div class="global-graph-outer">
99+
<div class="global-graph-container" data-cfg={JSON.stringify(globalGraph)}></div>
100+
</div>
101+
</div>
102+
)
103+
}
104104

105-
Graph.css = style
106-
Graph.afterDOMLoaded = script
105+
Graph.css = style
106+
Graph.afterDOMLoaded = script
107107

108-
return Graph
108+
return Graph
109109
}) satisfies QuartzComponentConstructor

quartz/plugins/emitters/404.tsx

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,53 +11,54 @@ import { write } from "./helpers"
1111
import { i18n } from "../../i18n"
1212

1313
export const NotFoundPage: QuartzEmitterPlugin = () => {
14-
const opts: FullPageLayout = {
15-
...sharedPageComponents,
16-
pageBody: NotFound(),
17-
beforeBody: [],
18-
left: [],
19-
right: [],
20-
}
14+
const opts: FullPageLayout = {
15+
...sharedPageComponents,
16+
pageBody: NotFound(),
17+
beforeBody: [],
18+
afterBody: [],
19+
left: [],
20+
right: [],
21+
}
2122

22-
const { head: Head, pageBody, footer: Footer } = opts
23-
const Body = BodyConstructor()
23+
const { head: Head, pageBody, footer: Footer } = opts
24+
const Body = BodyConstructor()
2425

25-
return {
26-
name: "404Page",
27-
getQuartzComponents() {
28-
return [Head, Body, pageBody, Footer]
29-
},
30-
async *emit(ctx, _content, resources) {
31-
const cfg = ctx.cfg.configuration
32-
const slug = "404" as FullSlug
26+
return {
27+
name: "404Page",
28+
getQuartzComponents() {
29+
return [Head, Body, pageBody, Footer]
30+
},
31+
async *emit(ctx, _content, resources) {
32+
const cfg = ctx.cfg.configuration
33+
const slug = "404" as FullSlug
3334

34-
const url = new URL(`https://${cfg.baseUrl ?? "example.com"}`)
35-
const path = url.pathname as FullSlug
36-
const notFound = i18n(cfg.locale).pages.error.title
37-
const [tree, vfile] = defaultProcessedContent({
38-
slug,
39-
text: notFound,
40-
description: notFound,
41-
frontmatter: { title: notFound, tags: [] },
42-
})
43-
const externalResources = pageResources(path, resources)
44-
const componentData: QuartzComponentProps = {
45-
ctx,
46-
fileData: vfile.data,
47-
externalResources,
48-
cfg,
49-
children: [],
50-
tree,
51-
allFiles: [],
52-
}
35+
const url = new URL(`https://${cfg.baseUrl ?? "example.com"}`)
36+
const path = url.pathname as FullSlug
37+
const notFound = i18n(cfg.locale).pages.error.title
38+
const [tree, vfile] = defaultProcessedContent({
39+
slug,
40+
text: notFound,
41+
description: notFound,
42+
frontmatter: { title: notFound, tags: [] },
43+
})
44+
const externalResources = pageResources(path, resources)
45+
const componentData: QuartzComponentProps = {
46+
ctx,
47+
fileData: vfile.data,
48+
externalResources,
49+
cfg,
50+
children: [],
51+
tree,
52+
allFiles: [],
53+
}
5354

54-
yield write({
55-
ctx,
56-
content: renderPage(cfg, slug, componentData, opts, externalResources),
57-
slug,
58-
ext: ".html",
59-
})
60-
},
61-
async *partialEmit() {},
62-
}
55+
yield write({
56+
ctx,
57+
content: renderPage(cfg, slug, componentData, opts, externalResources),
58+
slug,
59+
ext: ".html",
60+
})
61+
},
62+
async *partialEmit() { },
63+
}
6364
}

0 commit comments

Comments
 (0)