| | |
| | | FilePath, |
| | | FullSlug, |
| | | SimpleSlug, |
| | | _stripSlashes, |
| | | stripSlashes, |
| | | joinSegments, |
| | | pathToRoot, |
| | | simplifySlug, |
| | |
| | | import { FolderContent } from "../../components" |
| | | import { write } from "./helpers" |
| | | import { i18n } from "../../i18n" |
| | | import DepGraph from "../../depgraph" |
| | | |
| | | export const FolderPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOpts) => { |
| | | const opts: FullPageLayout = { |
| | |
| | | getQuartzComponents() { |
| | | return [Head, Header, Body, ...header, ...beforeBody, pageBody, ...left, ...right, Footer] |
| | | }, |
| | | async getDependencyGraph(_ctx, _content, _resources) { |
| | | // Example graph: |
| | | // nested/file.md --> nested/file.html |
| | | // \-------> nested/index.html |
| | | // TODO implement |
| | | return new DepGraph<FilePath>() |
| | | }, |
| | | async emit(ctx, content, resources): Promise<FilePath[]> { |
| | | const fps: FilePath[] = [] |
| | | const allFiles = content.map((c) => c[1].data) |
| | |
| | | ) |
| | | |
| | | for (const [tree, file] of content) { |
| | | const slug = _stripSlashes(simplifySlug(file.data.slug!)) as SimpleSlug |
| | | const slug = stripSlashes(simplifySlug(file.data.slug!)) as SimpleSlug |
| | | if (folders.has(slug)) { |
| | | folderDescriptions[slug] = [tree, file] |
| | | } |