Jacky Zhao
2023-07-16 3ac6b42e16dca5a44ed3fec2c0314f1dbbc2322b
quartz/components/pages/FolderContent.tsx
@@ -5,10 +5,11 @@
import style from '../styles/listPage.scss'
import { PageList } from "../PageList"
import { canonicalizeServer } from "../../path"
function FolderContent(props: QuartzComponentProps) {
  const { tree, fileData, allFiles } = props
  const folderSlug = fileData.slug!
  const folderSlug = canonicalizeServer(fileData.slug!)
  const allPagesInFolder = allFiles.filter(file => {
    const fileSlug = file.slug ?? ""
    const prefixed = fileSlug.startsWith(folderSlug)
@@ -22,13 +23,10 @@
    ...props,
    allFiles: allPagesInFolder
  }
  const desc = props.fileData.description
  // @ts-ignore
  const content = toJsxRuntime(tree, { Fragment, jsx, jsxs, elementAttributeNameCase: 'html' })
  return <div class="popover-hint">
    {desc && <p>{desc}</p>}
    <article>{content}</article>
    <p>{allPagesInFolder.length} items under this folder.</p>
    <div>