quartz-research-note/quartz/components/ArticleTitle.tsx
Jacky Zhao b8c011410d toc
2023-06-09 23:06:02 -07:00

12 lines
326 B
TypeScript

import { QuartzComponentProps } from "./types"
export default function ArticleTitle({ fileData }: QuartzComponentProps) {
const title = fileData.frontmatter?.title
const displayTitle = fileData.slug === "index" ? undefined : title
if (displayTitle) {
return <h1>{displayTitle}</h1>
} else {
return null
}
}