mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-19 10:54:06 -06:00
21 lines
611 B
TypeScript
21 lines
611 B
TypeScript
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|
import { classNames } from "../util/lang"
|
|
|
|
const ArticleSubtitle: QuartzComponent = ({ fileData, displayClass }: QuartzComponentProps) => {
|
|
const subtitle = fileData.frontmatter?.subtitle
|
|
if (subtitle) {
|
|
return <h3 class={classNames(displayClass, "article-subtitle")}>{subtitle}</h3>
|
|
} else {
|
|
return null
|
|
}
|
|
}
|
|
|
|
ArticleSubtitle.css = `
|
|
.article-subtitle {
|
|
margin: 0.5rem 0 0 0;
|
|
color: var(--gray);
|
|
font-weight: normal;
|
|
}
|
|
`
|
|
|
|
export default (() => ArticleSubtitle) satisfies QuartzComponentConstructor |