Skip to content

Commit 3cc06f9

Browse files
committed
chore: Update quartz.layout.ts to improve graph options and layout
1 parent c4b9b88 commit 3cc06f9

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

quartz.layout.ts

+27-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PageLayout, SharedLayout } from "./quartz/cfg";
22
import * as Component from "./quartz/components";
3-
import { GraphOptions, defaultOptions } from "./quartz/components/Graph";
3+
import { defaultOptions } from "./quartz/components/Graph";
44

55
// components shared across all pages
66
export const sharedPageComponents: SharedLayout = {
@@ -12,17 +12,8 @@ export const sharedPageComponents: SharedLayout = {
1212
// "Discord Community": "https://discord.gg/cRFFHYye7t",
1313
},
1414
}),
15-
}
15+
};
1616

17-
const graphOptions: GraphOptions = {
18-
localGraph: {
19-
...defaultOptions.localGraph,
20-
depth: 2
21-
},
22-
globalGraph: {
23-
...defaultOptions.globalGraph,
24-
},
25-
}
2617
// components for pages that display a single page (e.g. a single note)
2718
export const defaultContentPageLayout: PageLayout = {
2819
beforeBody: [
@@ -39,21 +30,41 @@ export const defaultContentPageLayout: PageLayout = {
3930
Component.DesktopOnly(Component.Explorer()),
4031
],
4132
right: [
42-
Component.Graph(graphOptions),
33+
Component.Graph({
34+
localGraph: {
35+
...defaultOptions.localGraph,
36+
},
37+
globalGraph: {
38+
...defaultOptions.globalGraph,
39+
},
40+
}),
4341
Component.DesktopOnly(Component.TableOfContents()),
4442
Component.Backlinks(),
4543
],
46-
}
44+
};
4745

4846
// components for pages that display lists of pages (e.g. tags or folders)
4947
export const defaultListPageLayout: PageLayout = {
50-
beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()],
48+
beforeBody: [
49+
Component.Breadcrumbs(),
50+
Component.ArticleTitle(),
51+
Component.ContentMeta(),
52+
Component.Graph({
53+
localGraph: {
54+
...defaultOptions.localGraph,
55+
depth: 2,
56+
},
57+
globalGraph: {
58+
...defaultOptions.globalGraph,
59+
},
60+
}),
61+
],
5162
left: [
5263
Component.PageTitle(),
5364
Component.MobileOnly(Component.Spacer()),
5465
Component.Search(),
5566
Component.Darkmode(),
5667
Component.DesktopOnly(Component.Explorer()),
5768
],
58-
right: [],
59-
}
69+
right: [Component.Backlinks()],
70+
};

0 commit comments

Comments
 (0)