From 16adbd30114bfcc1aaefa851a5a1786787f97a10 Mon Sep 17 00:00:00 2001 From: Mara-Li Date: Mon, 29 Jan 2024 07:12:48 +0100 Subject: [PATCH] fix: `cssclasses` was not applied on folder note (index) (#749) * docs: improve first-time git setup * fix: cssClasses was not applied on index page * refactor: remove vscode files * fix: format * fix: cssClasses should be applied on the entire div, not only the article * feat: support cssClasses for tag-listing --------- Co-authored-by: Jacky Zhao --- quartz/components/pages/FolderContent.tsx | 5 +++-- quartz/components/pages/TagContent.tsx | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx index 67cfa8dd..436ed91f 100644 --- a/quartz/components/pages/FolderContent.tsx +++ b/quartz/components/pages/FolderContent.tsx @@ -33,7 +33,8 @@ export default ((opts?: Partial) => { const isDirectChild = fileParts.length === folderParts.length + 1 return prefixed && isDirectChild }) - + const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? [] + const classes = ["popover-hint", ...cssClasses].join(" ") const listProps = { ...props, allFiles: allPagesInFolder, @@ -45,7 +46,7 @@ export default ((opts?: Partial) => { : htmlToJsx(fileData.filePath!, tree) return ( -
+

{content}

diff --git a/quartz/components/pages/TagContent.tsx b/quartz/components/pages/TagContent.tsx index 890755bb..50507461 100644 --- a/quartz/components/pages/TagContent.tsx +++ b/quartz/components/pages/TagContent.tsx @@ -26,7 +26,8 @@ function TagContent(props: QuartzComponentProps) { (tree as Root).children.length === 0 ? fileData.description : htmlToJsx(fileData.filePath!, tree) - + const cssClasses: string[] = fileData.frontmatter?.cssclasses ?? [] + const classes = ["popover-hint", ...cssClasses].join(" ") if (tag === "/") { const tags = [ ...new Set( @@ -37,9 +38,8 @@ function TagContent(props: QuartzComponentProps) { for (const tag of tags) { tagItemMap.set(tag, allPagesWithTag(tag)) } - return ( -
+

{content}

@@ -81,7 +81,7 @@ function TagContent(props: QuartzComponentProps) { } return ( -
+
{content}

{pluralize(pages.length, "item")} with this tag.