From 407fad384cdb473184100347a8f71bdce4643e64 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 06 Aug 2024 02:18:48 +0000
Subject: [PATCH] fix: only one h1 on a page (closes #1269)
---
quartz/components/Explorer.tsx | 2 +-
quartz/components/PageTitle.tsx | 5 +++--
quartz/components/styles/explorer.scss | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/quartz/components/Explorer.tsx b/quartz/components/Explorer.tsx
index cffc079..24583a1 100644
--- a/quartz/components/Explorer.tsx
+++ b/quartz/components/Explorer.tsx
@@ -92,7 +92,7 @@
data-savestate={opts.useSavedState}
data-tree={jsonTree}
>
- <h1>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h1>
+ <h2>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h2>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
diff --git a/quartz/components/PageTitle.tsx b/quartz/components/PageTitle.tsx
index 2362f10..046dc52 100644
--- a/quartz/components/PageTitle.tsx
+++ b/quartz/components/PageTitle.tsx
@@ -7,14 +7,15 @@
const title = cfg?.pageTitle ?? i18n(cfg.locale).propertyDefaults.title
const baseDir = pathToRoot(fileData.slug!)
return (
- <h1 class={classNames(displayClass, "page-title")}>
+ <h2 class={classNames(displayClass, "page-title")}>
<a href={baseDir}>{title}</a>
- </h1>
+ </h2>
)
}
PageTitle.css = `
.page-title {
+ font-size: 1.75rem;
margin: 0;
}
`
diff --git a/quartz/components/styles/explorer.scss b/quartz/components/styles/explorer.scss
index 55ea8aa..d4875e7 100644
--- a/quartz/components/styles/explorer.scss
+++ b/quartz/components/styles/explorer.scss
@@ -11,7 +11,7 @@
display: flex;
align-items: center;
- & h1 {
+ & h2 {
font-size: 1rem;
display: inline-block;
margin: 0;
--
Gitblit v1.10.0