From 9c6046a1f831f6caf3c7bfecfcaa6f89a3e671a9 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 12 Jun 2023 22:41:42 -0700 Subject: [PATCH] taglist, mermaid --- quartz.config.ts | 2 +- quartz/components/Head.tsx | 3 +- quartz/components/TableOfContents.tsx | 45 +++++++++++++++++-------- quartz/components/TagList.tsx | 42 +++++++++++++++++++++++ quartz/components/index.ts | 4 ++- quartz/path.ts | 6 ++-- quartz/plugins/emitters/contentPage.tsx | 8 ++--- quartz/plugins/transformers/latex.ts | 3 +- quartz/plugins/transformers/ofm.ts | 35 +++++++++++++++++-- quartz/plugins/transformers/toc.ts | 4 +-- quartz/resources.ts | 10 ------ quartz/resources.tsx | 28 +++++++++++++++ 12 files changed, 149 insertions(+), 41 deletions(-) create mode 100644 quartz/components/TagList.tsx delete mode 100644 quartz/resources.ts create mode 100644 quartz/resources.tsx diff --git a/quartz.config.ts b/quartz.config.ts index d1fe1841..5868449e 100644 --- a/quartz.config.ts +++ b/quartz.config.ts @@ -58,7 +58,7 @@ const config: QuartzConfig = { Plugin.ContentPage({ head: Component.Head(), header: [Component.PageTitle(), Component.Spacer(), Component.Darkmode()], - body: [Component.ArticleTitle(), Component.ReadingTime(), Component.TableOfContents(), Component.Content()] + body: [Component.ArticleTitle(), Component.ReadingTime(), Component.TagList(), Component.TableOfContents(), Component.Content()] }) ] }, diff --git a/quartz/components/Head.tsx b/quartz/components/Head.tsx index 16125da3..cc9dd77d 100644 --- a/quartz/components/Head.tsx +++ b/quartz/components/Head.tsx @@ -1,4 +1,5 @@ import { resolveToRoot } from "../path" +import { JSResourceToScriptElement } from "../resources" import { QuartzComponentConstructor, QuartzComponentProps } from "./types" function Head({ fileData, externalResources }: QuartzComponentProps) { @@ -25,7 +26,7 @@ function Head({ fileData, externalResources }: QuartzComponentProps) { {css.map(href => )} - {js.filter(resource => resource.loadTime === "beforeDOMReady").map(resource => + } +} + +export interface StaticResources { + css: string[], + js: JSResource[] +}