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 |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/quartz/components/PageTitle.tsx b/quartz/components/PageTitle.tsx
index fe6ec3d..fb1660a 100644
--- a/quartz/components/PageTitle.tsx
+++ b/quartz/components/PageTitle.tsx
@@ -1,11 +1,21 @@
-import { resolveToRoot } from "../path"
+import { pathToRoot } from "../util/path"
 import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
+import { classNames } from "../util/lang"
 
-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, 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