mirror of
https://github.com/quartz-community/folder-page.git
synced 2026-11-16 23:53:51 +00:00
Quartz's default folder page plugin.
- TypeScript 98.4%
- SCSS 1.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .changeset | ||
| .github/workflows | ||
| src | ||
| test | ||
| types | ||
| .eslintrc.json | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc | ||
| CHANGELOG.md | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| tsup.config.ts | ||
| vitest.config.ts | ||
@quartz-community/folder-page
Renders folder index pages showing a listing of all pages within that folder. Automatically generates virtual index pages for folders that don't have one.
Installation
npx quartz plugin add @quartz-community/folder-page
Usage
This plugin is already enabled in the default quartz.config.yaml:
plugins:
- source: "@quartz-community/folder-page"
enabled: true
options:
showFolderCount: true
showSubfolders: true
prefixFolders: false
sort is a function, so it needs a TypeScript override:
import * as ExternalPlugin from "./.quartz/plugins";
// Must be placed before loadQuartzConfig()
ExternalPlugin.FolderPage({
sort: (f1, f2) => (f1.frontmatter?.title ?? "").localeCompare(f2.frontmatter?.title ?? ""),
});
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
showFolderCount |
boolean |
true |
Whether to show the number of entries in the folder ("N items under this folder"). |
showSubfolders |
boolean |
true |
Whether to list each direct subfolder as an entry of its own (linking to the subfolder's page). When false, only pages directly inside the folder are listed. |
prefixFolders |
boolean |
false |
Whether to prefix generated folder page titles (and index notes without a title) with the localized "Folder" label (e.g. "Folder: notes"). |
sort |
SortFn |
folders first, then by date (newest first), then title | A function (f1, f2) => number to sort the entries. TS override only. |
Folders are listed even when they hold only pages generated by other page types, such as .base or .canvas pages. Pages hidden with unlisted-pages are left out.
Documentation
See the Quartz documentation for more information.
License
MIT