dalfuss.net/quartz/components/PageTitle.tsx

12 lines
397 B
TypeScript
Raw Normal View History

2023-06-07 22:27:32 -07:00
import { resolveToRoot } from "../path"
2023-06-11 23:46:38 -07:00
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
2023-06-07 22:27:32 -07:00
2023-06-11 23:46:38 -07:00
function PageTitle({ cfg, fileData }: QuartzComponentProps) {
2023-06-07 22:27:32 -07:00
const title = cfg.siteTitle
const slug = fileData.slug!
const baseDir = resolveToRoot(slug)
return <h1><a href={baseDir}>{title}</a></h1>
}
2023-06-11 23:46:38 -07:00
export default (() => PageTitle) satisfies QuartzComponentConstructor