From cee2883c0889a65e2786d70eb81932f5ed017e59 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Tue, 25 Jul 2023 21:10:37 -0700 Subject: [PATCH] nested tag support and tag index page --- content/features/Latex.md | 5 ++ content/features/syntax highlighting.md | 2 + content/features/upcoming features.md | 2 - quartz/components/PageList.tsx | 13 +++- quartz/components/TagList.tsx | 5 +- quartz/components/pages/TagContent.tsx | 66 +++++++++++++++---- quartz/components/styles/popover.scss | 2 +- quartz/path.ts | 22 ++++++- quartz/plugins/emitters/componentResources.ts | 2 +- quartz/plugins/emitters/tagPage.tsx | 34 +++++++--- quartz/plugins/transformers/frontmatter.ts | 4 +- quartz/plugins/transformers/ofm.ts | 4 +- quartz/theme.ts | 1 - 13 files changed, 125 insertions(+), 37 deletions(-) diff --git a/content/features/Latex.md b/content/features/Latex.md index 3f523d6..0dbc113 100644 --- a/content/features/Latex.md +++ b/content/features/Latex.md @@ -1,3 +1,8 @@ +--- +tags: + - plugin/transformer +--- + Quartz uses [Katex](https://katex.org/) by default to typeset both inline and block math expressions at build time. ## Formatting diff --git a/content/features/syntax highlighting.md b/content/features/syntax highlighting.md index 16d3fa9..68436c2 100644 --- a/content/features/syntax highlighting.md +++ b/content/features/syntax highlighting.md @@ -1,5 +1,7 @@ --- title: Syntax Highlighting +tags: + - plugin/transformer --- Syntax highlighting in Quartz is completely done at build-time. This means that Quartz only ships pre-calculated CSS to highlight the right words so there is no heavy client-side bundle that does the syntax highlighting. diff --git a/content/features/upcoming features.md b/content/features/upcoming features.md index 676bb71..dab75c6 100644 --- a/content/features/upcoming features.md +++ b/content/features/upcoming features.md @@ -4,9 +4,7 @@ draft: true ## high priority -- local fonts - images in same folder are broken on shortest path mode -- https://help.obsidian.md/Editing+and+formatting/Tags#Nested+tags nested tags?? and big tag listing - watch mode for config/source code - https://help.obsidian.md/Editing+and+formatting/Basic+formatting+syntax#Task+lists task list styling - publish metadata https://help.obsidian.md/Editing+and+formatting/Metadata#Metadata+for+Obsidian+Publish diff --git a/quartz/components/PageList.tsx b/quartz/components/PageList.tsx index 8ef40c5..7183acb 100644 --- a/quartz/components/PageList.tsx +++ b/quartz/components/PageList.tsx @@ -20,11 +20,20 @@ function byDateAndAlphabetical(f1: QuartzPluginData, f2: QuartzPluginData): numb return f1Title.localeCompare(f2Title) } -export function PageList({ fileData, allFiles }: QuartzComponentProps) { +type Props = { + limit?: number +} & QuartzComponentProps + +export function PageList({ fileData, allFiles, limit }: Props) { const slug = canonicalizeServer(fileData.slug!) + let list = allFiles.sort(byDateAndAlphabetical) + if (limit) { + list = list.slice(0, limit) + } + return (