From 340e3ef5116cd99c8ddfdbb3d9e0bbd914e07825 Mon Sep 17 00:00:00 2001
From: Ben Schlegel <31989404+benschlegel@users.noreply.github.com>
Date: Fri, 25 Aug 2023 16:03:49 +0000
Subject: [PATCH] feat(consistency): Add `.obsidian` to ignorePatterns (#420)
---
quartz/components/PageTitle.tsx | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/quartz/components/PageTitle.tsx b/quartz/components/PageTitle.tsx
index 080b74d..c327547 100644
--- a/quartz/components/PageTitle.tsx
+++ b/quartz/components/PageTitle.tsx
@@ -1,9 +1,20 @@
-import { resolveToRoot } from "../path"
-import { QuartzComponentProps } from "./types"
+import { pathToRoot } from "../util/path"
+import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
-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 }: 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