Skip to content

Commit

Permalink
Update ArticleTitle.tsx copy from quartz
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinkWithPbody authored Jun 5, 2024
1 parent 875649a commit e38e614
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions quartz/components/ArticleTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
import { FileTitleIcon,IconFolderOptions } from "../plugins/components/FileIcons";
import { classNames } from "../util/lang";
import { QuartzComponentConstructor, QuartzComponentProps } from "./types";
Expand Down Expand Up @@ -30,3 +31,25 @@ export default ((opts?: Partial<IconFolderOptions>) => {
`;
return ArticleTitle;
}) satisfies QuartzComponentConstructor;
*/

import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
import { classNames } from "../util/lang"

const ArticleTitle: QuartzComponent = ({ fileData, displayClass }: QuartzComponentProps) => {
const title = fileData.frontmatter?.title
if (title) {
return <h1 class={classNames(displayClass, "article-title")}>{title}</h1>
} else {
return null
}
}

ArticleTitle.css = `
.article-title {
margin: 2rem 0 0 0;
}
`

export default (() => ArticleTitle) satisfies QuartzComponentConstructor

0 comments on commit e38e614

Please sign in to comment.