From 2d6dc176c3e1fbb520a5da1beb60bbb1d8e948ba Mon Sep 17 00:00:00 2001
From: Pelayo Arbués <gonzalezpelayo@gmail.com>
Date: Thu, 31 Aug 2023 19:12:06 +0000
Subject: [PATCH] Adds Pelayo Arbues to showcase (#435)

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

diff --git a/quartz/components/PageTitle.tsx b/quartz/components/PageTitle.tsx
index e8377ee..c327547 100644
--- a/quartz/components/PageTitle.tsx
+++ b/quartz/components/PageTitle.tsx
@@ -1,22 +1,20 @@
-import { resolveToRoot } from "../path"
+import { pathToRoot } from "../util/path"
 import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
 
-interface Options {
-  title: string
+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>
+  )
 }
 
-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