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