From 7e42be8e46501c752dda9bd174fb93ea9dccec22 Mon Sep 17 00:00:00 2001
From: Ben Schlegel <31989404+benschlegel@users.noreply.github.com>
Date: Sun, 03 Sep 2023 16:32:46 +0000
Subject: [PATCH] feat(search): add arrow key navigation (#442)

---
 quartz/components/PageTitle.tsx |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/quartz/components/PageTitle.tsx b/quartz/components/PageTitle.tsx
index fe6ec3d..c327547 100644
--- a/quartz/components/PageTitle.tsx
+++ b/quartz/components/PageTitle.tsx
@@ -1,11 +1,20 @@
-import { resolveToRoot } from "../path"
+import { pathToRoot } from "../util/path"
 import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
 
-function PageTitle({ cfg, fileData }: QuartzComponentProps) {
-  const title = cfg.siteTitle
-  const slug = fileData.slug!
-  const baseDir = resolveToRoot(slug)
-  return <h1><a href={baseDir}>{title}</a></h1>
+function PageTitle({ fileData, cfg }: QuartzComponentProps) {
+  const title = cfg?.pageTitle ?? "Untitled Quartz"
+  const baseDir = pathToRoot(fileData.slug!)
+  return (
+    <h1 class="page-title">
+      <a href={baseDir}>{title}</a>
+    </h1>
+  )
 }
 
+PageTitle.css = `
+.page-title {
+  margin: 0;
+}
+`
+
 export default (() => PageTitle) satisfies QuartzComponentConstructor

--
Gitblit v1.10.0