From 8fd75ffbfda30edd5a134a1fbf9b81ac3cebb2ff Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 24 Jul 2023 00:42:00 +0000
Subject: [PATCH] support attachments folder

---
 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..f6319ef 100644
--- a/quartz/components/PageTitle.tsx
+++ b/quartz/components/PageTitle.tsx
@@ -1,11 +1,21 @@
-import { resolveToRoot } from "../path"
+import { canonicalizeServer, pathToRoot } from "../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 slug = canonicalizeServer(fileData.slug!)
+  const baseDir = pathToRoot(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