Skip to content

Commit f7f54a1

Browse files
Update quartz.layout.ts
- Adds MobileOnly components for Explorer and Table of Contents to display on mobile. - Graph made DesktopOnly so its position in the layout can be replaced by the Explorer in Mobile view Closes #23
1 parent 6f2aa3d commit f7f54a1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

quartz.layout.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const defaultContentPageLayout: PageLayout = {
3535
Component.ArticleTitle(),
3636
Component.ContentMeta(),
3737
Component.TagList(),
38+
Component.MobileOnly(Component.TableOfContents()),
3839
],
3940
left: [
4041
Component.PageTitle(),
@@ -47,15 +48,19 @@ export const defaultContentPageLayout: PageLayout = {
4748
})),
4849
],
4950
right: [
50-
Component.Graph(),
51+
Component.MobileOnly(Component.Explorer({
52+
folderClickBehavior: "link",
53+
filterFn: (node) => node.name !== "Templates",
54+
})),
55+
Component.DesktopOnly(Component.Graph()),
5156
Component.DesktopOnly(Component.TableOfContents()),
5257
Component.Backlinks(),
5358
],
5459
}
5560

5661
// components for pages that display lists of pages (e.g. tags or folders)
5762
export const defaultListPageLayout: PageLayout = {
58-
beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()],
63+
beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta(), Component.MobileOnly(Component.TableOfContents())],
5964
left: [
6065
Component.PageTitle(),
6166
Component.MobileOnly(Component.Spacer()),
@@ -67,7 +72,11 @@ export const defaultListPageLayout: PageLayout = {
6772
})),
6873
],
6974
right: [
70-
Component.Graph(),
75+
Component.MobileOnly(Component.Explorer({
76+
folderClickBehavior: "link",
77+
filterFn: (node) => node.name !== "Templates",
78+
})),
79+
Component.DesktopOnly(Component.Graph()),
7180
Component.DesktopOnly(Component.TableOfContents()),
7281
Component.Backlinks(),
7382
],

0 commit comments

Comments
 (0)