Jacky Zhao
2024-08-06 407fad384cdb473184100347a8f71bdce4643e64
fix: only one h1 on a page (closes #1269)
3 files modified
9 ■■■■■ changed files
quartz/components/Explorer.tsx 2 ●●● patch | view | raw | blame | history
quartz/components/PageTitle.tsx 5 ●●●●● patch | view | raw | blame | history
quartz/components/styles/explorer.scss 2 ●●● patch | view | raw | blame | history
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"
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;
}
`
quartz/components/styles/explorer.scss
@@ -11,7 +11,7 @@
  display: flex;
  align-items: center;
  & h1 {
  & h2 {
    font-size: 1rem;
    display: inline-block;
    margin: 0;