feat: Handling cssclasses properties in Quartz (#711)

* Add cssclasses to article

* Prettier

* Update quartz/components/pages/Content.tsx

* Update quartz/components/pages/Content.tsx

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
This commit is contained in:
LUCASTUCIOUS 2024-01-28 03:34:21 +01:00 committed by GitHub
parent af3a4ff9cd
commit b211d49922
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,9 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "../types"
function Content({ fileData, tree }: QuartzComponentProps) {
const content = htmlToJsx(fileData.filePath!, tree)
return <article class="popover-hint">{content}</article>
const classes: string[] = fileData.frontmatter?.cssclasses ?? []
const classString = ["popover-hint", ...classes].join(" ")
return <article class={classString}>{content}</article>
}
export default (() => Content) satisfies QuartzComponentConstructor