Skip to content

Commit

Permalink
feat(layout): Layout for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li authored Feb 13, 2024
1 parent bfe9a36 commit b50e4aa
Showing 1 changed file with 40 additions and 19 deletions.
59 changes: 40 additions & 19 deletions quartz.layout.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
import { PageLayout, SharedLayout } from "./quartz/cfg"
import * as Component from "./quartz/components"
import { IconFolderOptions } from "./quartz/plugins/components/FileIcons";

// components shared across all pages

const iconsOptions: IconFolderOptions = {
rootIconFolder: "quartz/static/icons",
default: {
file: "file",
},
};


export const sharedPageComponents: SharedLayout = {
head: Component.Head(),
header: [],
header: [
Component.MobileOnly(
Component.ExplorerBurger({
folderDefaultState: "open",
folderClickBehavior: "link",
iconSettings: iconsOptions,
}),
),
Component.MobileOnly(Component.PageTitle()),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
],
footer: Component.Footer({
links: {
GitHub: "https://github.com/jackyzha0/quartz",
Expand All @@ -17,33 +39,32 @@ export const sharedPageComponents: SharedLayout = {
export const defaultContentPageLayout: PageLayout = {
beforeBody: [
Component.Breadcrumbs(),
Component.ArticleTitle(),
Component.ContentMeta(),
Component.ArticleTitle(iconsOptions),
Component.ContentMeta({ showReadingTime: false }),
Component.TagList(),
],
left: [
Component.PageTitle(),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()),
Component.DesktopOnly(Component.PageTitle()),
Component.DesktopOnly(
Component.ExplorerBurger({
folderClickBehavior: "link",
folderDefaultState: "collapsed",
useSavedState: true,
title: "",
iconSettings: iconsOptions,
}),
),
],
right: [
Component.Graph(),
Component.DesktopOnly(Component.TableOfContents()),
Component.Backlinks(),
Component.DesktopOnly(Component.Graph()),
Component.TableOfContents(),
Component.DesktopOnly(Component.Backlinks()),
],
}

// components for pages that display lists of pages (e.g. tags or folders)
export const defaultListPageLayout: PageLayout = {
beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()],
left: [
Component.PageTitle(),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()),
],
beforeBody: defaultContentPageLayout.beforeBody,
left: defaultContentPageLayout.left,
right: [],
}

0 comments on commit b50e4aa

Please sign in to comment.