20 lines
538 B
TypeScript
Raw Normal View History

import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
import { classNames } from "../util/lang"
2023-06-09 23:06:02 -07:00
const ArticleTitle: QuartzComponent = ({ fileData, displayClass }: QuartzComponentProps) => {
2023-06-09 23:06:02 -07:00
const title = fileData.frontmatter?.title
2023-07-02 13:08:29 -07:00
if (title) {
return <h1 class={classNames(displayClass, "article-title")}>{title}</h1>
2023-06-09 23:06:02 -07:00
} else {
return null
}
}
2023-06-18 10:47:07 -07:00
ArticleTitle.css = `
.article-title {
margin: 2rem 0 0 0;
}
`
2023-06-11 23:46:38 -07:00
export default (() => ArticleTitle) satisfies QuartzComponentConstructor