LUCASTUCIOUS
2024-01-28 b211d49922cef3910b78cf61c27c1285406c6c5d
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>
1 files modified
4 ■■■ changed files
quartz/components/pages/Content.tsx 4 ●●● patch | view | raw | blame | history
quartz/components/pages/Content.tsx
@@ -3,7 +3,9 @@
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