From 6d5491fdcbccfad7af6c6dcc63ce2f67abd3850c Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 17 Jun 2023 19:07:40 +0000
Subject: [PATCH] collapsible toc
---
quartz/components/Header.tsx | 31 +++++++++++++++++++++----------
1 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/quartz/components/Header.tsx b/quartz/components/Header.tsx
index 7da4a8e..197c4e5 100644
--- a/quartz/components/Header.tsx
+++ b/quartz/components/Header.tsx
@@ -1,14 +1,25 @@
-import { resolveToRoot } from "../path"
+import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
-export interface HeaderProps {
- title: string
- slug: string
-}
-
-export default function({ title, slug }: HeaderProps) {
- const baseDir = resolveToRoot(slug)
+function Header({ children }: QuartzComponentProps) {
return <header>
- <h1><a href={baseDir}>{title}</a></h1>
+ {children}
</header>
-
}
+
+Header.css = `
+header {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ margin: 1em 0 2em 0;
+ & > h1 {
+ }
+}
+
+header > h1 {
+ margin: 0;
+ flex: auto;
+}
+`
+
+export default (() => Header) satisfies QuartzComponentConstructor
--
Gitblit v1.10.0