| | |
| | | import { Root } from "hast" |
| | | import { pluralize } from "../../util/lang" |
| | | import { htmlToJsx } from "../../util/jsx" |
| | | import { i18n } from "../../i18n/i18next" |
| | | |
| | | interface FolderContentOptions { |
| | | /** |
| | |
| | | const options: FolderContentOptions = { ...defaultOptions, ...opts } |
| | | |
| | | function FolderContent(props: QuartzComponentProps) { |
| | | const { tree, fileData, allFiles } = props |
| | | const { tree, fileData, allFiles, cfg } = props |
| | | const folderSlug = _stripSlashes(simplifySlug(fileData.slug!)) |
| | | const allPagesInFolder = allFiles.filter((file) => { |
| | | const fileSlug = _stripSlashes(simplifySlug(file.slug!)) |
| | |
| | | </article> |
| | | <div class="page-listing"> |
| | | {options.showFolderCount && ( |
| | | <p>{pluralize(allPagesInFolder.length, "item")} under this folder.</p> |
| | | <p> |
| | | {pluralize(allPagesInFolder.length, i18n(cfg.locale, "common.item"))}{" "} |
| | | {i18n(cfg.locale, "folderContent.underThisFolder")}. |
| | | </p> |
| | | )} |
| | | <div> |
| | | <PageList {...listProps} /> |