From 317cce9314ad78d90714dc55aa82a2c3dfa75d1a Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 08 Jun 2023 05:27:32 +0000
Subject: [PATCH] generic quartz component for layout

---
 quartz/components/Head.tsx |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/quartz/components/Head.tsx b/quartz/components/Head.tsx
index 9e182c7..c56b8cb 100644
--- a/quartz/components/Head.tsx
+++ b/quartz/components/Head.tsx
@@ -1,18 +1,15 @@
 import { resolveToRoot } from "../path"
-import { StaticResources } from "../resources"
+import { QuartzComponentProps } from "./types"
 
-export interface HeadProps {
-  title: string
-  description: string
-  slug: string
-  externalResources: StaticResources
-}
-
-export default function Head({ title, description, slug, externalResources }: HeadProps) {
+export default function Head({ fileData, externalResources }: QuartzComponentProps) {
+  const slug = fileData.slug!
+  const title = fileData.frontmatter?.title ?? "Untitled"
+  const description = fileData.description ?? "No description provided"
   const { css, js } = externalResources
   const baseDir = resolveToRoot(slug)
   const iconPath = baseDir + "/static/icon.png"
   const ogImagePath = baseDir + "/static/og-image.png"
+
   return <head>
     <title>{title}</title>
     <meta charSet="utf-8" />

--
Gitblit v1.10.0