From f861a7c160a0b3be76a16c5bf2ea1a8d076a9662 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 16 Nov 2023 03:31:18 +0000
Subject: [PATCH] fix: regression where clicking anchors on the same page wouldn't set the anchor in the url
---
quartz/components/PageTitle.tsx | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/quartz/components/PageTitle.tsx b/quartz/components/PageTitle.tsx
index 00b2300..81d80d1 100644
--- a/quartz/components/PageTitle.tsx
+++ b/quartz/components/PageTitle.tsx
@@ -1,11 +1,14 @@
-import { canonicalizeServer, pathToRoot } from "../path"
+import { pathToRoot } from "../util/path"
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
-function PageTitle({ fileData, cfg }: QuartzComponentProps) {
+function PageTitle({ fileData, cfg, displayClass }: 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>
+ const baseDir = pathToRoot(fileData.slug!)
+ return (
+ <h1 class={`page-title ${displayClass ?? ""}`}>
+ <a href={baseDir}>{title}</a>
+ </h1>
+ )
}
PageTitle.css = `
--
Gitblit v1.10.0