mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-02 23:08:14 +00:00
generic quartz component for layout
This commit is contained in:
parent
dde36fa558
commit
317cce9314
11 changed files with 77 additions and 58 deletions
quartz/components
|
@ -1,15 +1,14 @@
|
|||
import { ComponentChildren } from "preact"
|
||||
import clipboardScript from './scripts/clipboard.inline'
|
||||
import clipboardStyle from './styles/clipboard.scss'
|
||||
import { QuartzComponentProps } from "./types"
|
||||
|
||||
export interface BodyProps {
|
||||
title?: string
|
||||
children: ComponentChildren
|
||||
}
|
||||
|
||||
export default function Body({ title, children }: BodyProps) {
|
||||
export default function Body({ fileData, children }: QuartzComponentProps) {
|
||||
const title = fileData.frontmatter?.title
|
||||
const displayTitle = fileData.slug === "index" ? undefined : title
|
||||
return <article>
|
||||
{title && <h1>{title}</h1>}
|
||||
<div class="top-section">
|
||||
{displayTitle && <h1>{displayTitle}</h1>}
|
||||
</div>
|
||||
{children}
|
||||
</article>
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue