This repository has been archived on 2024-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
quartz-wiki/quartz.layout.ts

60 lines
1.7 KiB
TypeScript
Raw Permalink Normal View History

2024-01-10 14:39:54 +08:00
import { PageLayout, SharedLayout, } from "./quartz/cfg"
import * as Component from "./quartz/components"
import { QuartzPluginData } from "./quartz/plugins/vfile";
// components shared across all pages
export const sharedPageComponents: SharedLayout = {
head: Component.Head(),
header: [],
footer: Component.Footer({
links: {
2024-01-11 09:20:44 +08:00
"Home": "https://www.7wate.com",
2024-01-10 14:39:54 +08:00
"Blog": "https://blog.7wate.com",
GitHub: "https://github.com/7wate",
},
}),
}
// components for pages that display a single page (e.g. a single note)
export const defaultContentPageLayout: PageLayout = {
beforeBody: [
Component.Breadcrumbs(),
Component.ArticleTitle(),
Component.ContentMeta(),
Component.TagList(),
],
left: [
Component.PageTitle(),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()),
Component.DesktopOnly(Component.RecentNotes({
filter:(data: QuartzPluginData) => {
// 是否以 'Blog/' 开头
// console.log('Current file path:', data.filePath);
return data.filePath ? data.filePath.startsWith('content/Blog') : false;
}
}
)),
],
right: [
Component.Graph(),
Component.DesktopOnly(Component.TableOfContents()),
Component.Backlinks(),
2024-01-11 09:20:44 +08:00
Component.MobileOnly(Component.Explorer()),
2024-01-10 14:39:54 +08:00
],
}
// components for pages that display lists of pages (e.g. tags or folders)
export const defaultListPageLayout: PageLayout = {
beforeBody: [Component.ArticleTitle()],
left: [
Component.PageTitle(),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
],
right: [],
}