* update article content to markdown ui component * decouple lunr indexing from class name * remove summary outline none rule, apply utility class instead * improve typing * scope more styles down to markdown-body/extended-markdown * move all markdown-body style overrides to MarkdownContent component * fix class targeting within css module * clean up MarkdownContent header style * rename data-lunr to data-search * fix: inline code color issue * fix: update article markdown to work with MarkdownContent
31 lines
806 B
TypeScript
31 lines
806 B
TypeScript
import React from 'react'
|
|
import cx from 'classnames'
|
|
import styles from './ArticleGridLayout.module.scss'
|
|
|
|
type Props = {
|
|
head?: React.ReactNode
|
|
toc?: React.ReactNode
|
|
children?: React.ReactNode
|
|
className?: string
|
|
}
|
|
export const ArticleGridLayout = ({ head, toc, children, className }: Props) => {
|
|
return (
|
|
<div className={cx(styles.container, className)}>
|
|
{/* head */}
|
|
{head && <div className={styles.head}>{head}</div>}
|
|
|
|
{/* toc */}
|
|
{toc && (
|
|
<div className={cx(styles.sidebar, 'border-bottom border-xl-0 pb-4 mb-5 pb-xl-0 mb-xl-0')}>
|
|
<div className={styles.sidebarContent}>{toc}</div>
|
|
</div>
|
|
)}
|
|
|
|
{/* content */}
|
|
<div data-search="article-body" className={styles.content}>
|
|
{children}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|