From b90590b9f487cdd49f019375fa5a09aad2e8ec1f Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 8 Jul 2023 14:36:02 -0700 Subject: [PATCH] polish --- content/philosophy.md | 2 +- content/showcase.md | 12 ++++++++++++ quartz.config.ts | 2 +- quartz/plugins/transformers/frontmatter.ts | 2 +- quartz/plugins/transformers/links.ts | 3 ++- quartz/plugins/transformers/ofm.ts | 2 +- quartz/styles/base.scss | 9 ++++++--- 7 files changed, 24 insertions(+), 8 deletions(-) diff --git a/content/philosophy.md b/content/philosophy.md index 05029694d..fe8e0103f 100644 --- a/content/philosophy.md +++ b/content/philosophy.md @@ -11,4 +11,4 @@ I've personally found that 2. Having a public digital garden invites open conversations 3. It makes keeping personal notes and knowledge *playful and fun* -**The goal of Quartz is to make sharing your digital garden free and simple.** Quartz exists as a tool to accomodate \ No newline at end of file +**The goal of Quartz is to make sharing your digital garden free and simple.** Quartz exists as a tool to accomodate diff --git a/content/showcase.md b/content/showcase.md index 8b7f1a869..4845f1587 100644 --- a/content/showcase.md +++ b/content/showcase.md @@ -17,3 +17,15 @@ Want to see what Quartz can do? Here are some cool community gardens :) - [Mike's AI Garden 🤖🪴](https://mwalton.me/) If you want to see your own on here, submit a [Pull Request adding yourself to this file](https://github.com/jackyzha0/quartz/blob/v4-alpha/content/showcase.md)! + +Left-aligned text | Center-aligned text | Right-aligned text +:-- | :--: | --: +Content | Content | Content + +```mermaid +sequenceDiagram + Alice->>+John: Hello John, how are you? + Alice->>+John: John, can you hear me? + John-->>-Alice: Hi Alice, I can hear you! + John-->>-Alice: I feel great! +``` \ No newline at end of file diff --git a/quartz.config.ts b/quartz.config.ts index 4f17bd92c..a07a4f2e7 100644 --- a/quartz.config.ts +++ b/quartz.config.ts @@ -95,7 +95,7 @@ const config: QuartzConfig = { }), Plugin.ObsidianFlavoredMarkdown(), Plugin.GitHubFlavoredMarkdown(), - Plugin.CrawlLinks(), + Plugin.CrawlLinks({ markdownLinkResolution: 'absolute' }), Plugin.SyntaxHighlighting(), Plugin.Katex(), Plugin.Description(), diff --git a/quartz/plugins/transformers/frontmatter.ts b/quartz/plugins/transformers/frontmatter.ts index 660523b2d..8dd0a4518 100644 --- a/quartz/plugins/transformers/frontmatter.ts +++ b/quartz/plugins/transformers/frontmatter.ts @@ -30,7 +30,7 @@ export const FrontMatter: QuartzTransformerPlugin | undefined> }) if (data.tags && !Array.isArray(data.tags)) { - data.tags = data.tags.toString().split(" ") + data.tags = data.tags.toString().split(",").map((tag: string) => tag.trim()) } // fill in frontmatter diff --git a/quartz/plugins/transformers/links.ts b/quartz/plugins/transformers/links.ts index 03c8d4334..17e30f547 100644 --- a/quartz/plugins/transformers/links.ts +++ b/quartz/plugins/transformers/links.ts @@ -6,7 +6,7 @@ import isAbsoluteUrl from "is-absolute-url" interface Options { /** How to resolve Markdown paths */ - markdownLinkResolution: 'absolute' | 'relative' + markdownLinkResolution: 'absolute' | 'relative' | 'shortest' /** Strips folders from a link so that it looks nice */ prettyLinks: boolean indexAnchorLinks: boolean @@ -35,6 +35,7 @@ export const CrawlLinks: QuartzTransformerPlugin | undefined> = } else { return './' + relativeToRoot(curSlug, targetSlug) } + // todo: handle shortest path } const outgoing: Set = new Set() diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 0e694d3fc..3bbb693e6 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -22,7 +22,7 @@ const defaultOptions: Options = { highlight: true, wikilinks: true, callouts: true, - mermaid: false, + mermaid: true, } const icons = { diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 4eb674231..33eae9c31 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -216,6 +216,10 @@ pre { overflow-x: auto; border: 1px solid var(--lightgray); + &:has(> code.mermaid) { + border: none; + } + & > code { background: none; padding: 0; @@ -261,15 +265,14 @@ tbody, li, p { } table { - border: 2px solid var(--gray); - width: 100%; + border: 1px solid var(--gray); padding: 1.5rem; border-collapse: collapse; } td, th { padding: 0.2rem 1rem; - border: 2px solid var(--gray); + border: 1px solid var(--gray); } img {