From e9fb0ecb96a2de53cf5f060c4e151f539ca4b089 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Fri, 02 Feb 2024 05:19:51 +0000
Subject: [PATCH] fix: border radius on search preview
---
quartz/components/PageTitle.tsx | 33 ++++++++++++++++-----------------
1 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/quartz/components/PageTitle.tsx b/quartz/components/PageTitle.tsx
index e8377ee..fb1660a 100644
--- a/quartz/components/PageTitle.tsx
+++ b/quartz/components/PageTitle.tsx
@@ -1,22 +1,21 @@
-import { resolveToRoot } from "../path"
+import { pathToRoot } from "../util/path"
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
+import { classNames } from "../util/lang"
-interface Options {
- title: string
+function PageTitle({ fileData, cfg, displayClass }: QuartzComponentProps) {
+ const title = cfg?.pageTitle ?? "Untitled Quartz"
+ const baseDir = pathToRoot(fileData.slug!)
+ return (
+ <h1 class={classNames(displayClass, "page-title")}>
+ <a href={baseDir}>{title}</a>
+ </h1>
+ )
}
-export default ((opts?: Options) => {
- const title = opts?.title ?? "Untitled Quartz"
- function PageTitle({ fileData }: QuartzComponentProps) {
- const slug = fileData.slug!
- const baseDir = resolveToRoot(slug)
- return <h1 class="page-title"><a href={baseDir}>{title}</a></h1>
- }
- PageTitle.css = `
- .page-title {
- margin: 0;
- }
- `
+PageTitle.css = `
+.page-title {
+ margin: 0;
+}
+`
- return PageTitle
-}) satisfies QuartzComponentConstructor
+export default (() => PageTitle) satisfies QuartzComponentConstructor
--
Gitblit v1.10.0