From 8a6ebd193933c2879c2a36e1b2f164889575d3bc Mon Sep 17 00:00:00 2001
From: Justin Fowler <justin.fowler@hey.com>
Date: Fri, 02 Feb 2024 04:17:21 +0000
Subject: [PATCH] docs: clarity for `RecentNotes` (#786)

---
 quartz/components/PageTitle.tsx |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/quartz/components/PageTitle.tsx b/quartz/components/PageTitle.tsx
index 080b74d..fb1660a 100644
--- a/quartz/components/PageTitle.tsx
+++ b/quartz/components/PageTitle.tsx
@@ -1,9 +1,21 @@
-import { resolveToRoot } from "../path"
-import { QuartzComponentProps } from "./types"
+import { pathToRoot } from "../util/path"
+import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
+import { classNames } from "../util/lang"
 
-export default function({ 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, 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>
+  )
 }
+
+PageTitle.css = `
+.page-title {
+  margin: 0;
+}
+`
+
+export default (() => PageTitle) satisfies QuartzComponentConstructor

--
Gitblit v1.10.0