| | |
| | | import { QuartzComponentConstructor, QuartzComponentProps } from "./types" |
| | | import { classNames } from "../util/lang" |
| | | |
| | | function ArticleTitle({ fileData }: QuartzComponentProps) { |
| | | function ArticleTitle({ fileData, displayClass }: QuartzComponentProps) { |
| | | const title = fileData.frontmatter?.title |
| | | const displayTitle = fileData.slug === "index" ? undefined : title |
| | | if (displayTitle) { |
| | | return <h1 class="article-title">{displayTitle}</h1> |
| | | if (title) { |
| | | return <h1 class={classNames(displayClass, "article-title")}>{title}</h1> |
| | | } else { |
| | | return null |
| | | } |