Skip to content

Commit

Permalink
quartz
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinkWithPbody committed Jan 15, 2025
1 parent e7a1fb0 commit b781cc5
Show file tree
Hide file tree
Showing 135 changed files with 6,597 additions and 5,865 deletions.
4 changes: 4 additions & 0 deletions globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ export declare global {
type: K,
listener: (this: Document, ev: CustomEventMap[K]) => void,
): void
removeEventListener<K extends keyof CustomEventMap>(
type: K,
listener: (this: Document, ev: CustomEventMap[K]) => void,
): void
dispatchEvent<K extends keyof CustomEventMap>(ev: CustomEventMap[K] | UIEvent): void
}
interface Window {
Expand Down
4 changes: 2 additions & 2 deletions quartz.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ const config: QuartzConfig = {
Plugin.CreatedModifiedDate({
priority: ["frontmatter", "filesystem"],
}),
Plugin.Latex({ renderEngine: "katex" }),
Plugin.SyntaxHighlighting({
theme: {
light: "github-light",
dark: "github-dark",
},
keepBackground: false,
}),
Plugin.ObsidianFlavoredMarkdown({ comments: true }),
Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }),
Plugin.GitHubFlavoredMarkdown(),
Plugin.TableOfContents(),
Plugin.CrawlLinks({ markdownLinkResolution: "relative" }),// relative, absolute, shortest
Plugin.Description(),
Plugin.Latex({ renderEngine: "katex" }),
Plugin.HardLineBreaks(),
],
filters: [Plugin.RemoveDrafts()],
Expand Down
49 changes: 19 additions & 30 deletions quartz.layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,10 @@ const iconsOptions: IconFolderOptions = {
},
};


export const sharedPageComponents: SharedLayout = {
head: Component.Head(),
header: [
Component.MobileOnly(
Component.ExplorerBurger({
folderDefaultState: "open",
folderClickBehavior: "collapse",// link, collapse
iconSettings: iconsOptions,
}),
),
Component.MobileOnly(Component.PageTitle()),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
],
header: [],
afterBody: [],
footer: Component.Footer({
links: {
"Email": "mailto:[email protected]",
Expand All @@ -45,29 +33,30 @@ export const defaultContentPageLayout: PageLayout = {
Component.TagList(),
],
left: [
Component.DesktopOnly(Component.PageTitle()),
Component.DesktopOnly(
Component.ExplorerBurger({
folderClickBehavior: "collapse",// link, collapse
folderDefaultState: "collapsed",
useSavedState: true,
title: "",
iconSettings: iconsOptions,
}),
),
Component.PageTitle(),
Component.MobileOnly(Component.Spacer()),
Component.Search(),
Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()),
],
right: [
Component.DesktopOnly(Component.Graph()),
Component.TableOfContents(),
Component.DesktopOnly(Component.Backlinks()),
Component.Graph(),
Component.DesktopOnly(Component.TableOfContents()),
Component.Backlinks(),
],
}

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

// Graph
Expand Down
5 changes: 3 additions & 2 deletions quartz/bootstrap-worker.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env node
import workerpool from "workerpool"
const cacheFile = "./.quartz-cache/transpiled-worker.mjs"
const { parseFiles } = await import(cacheFile)
const { parseMarkdown, processHtml } = await import(cacheFile)
workerpool.worker({
parseFiles,
parseMarkdown,
processHtml,
})
Loading

0 comments on commit b781cc5

Please sign in to comment.