mirror of
https://github.com/quartz-community/created-modified-date.git
synced 2026-11-16 23:53:31 +00:00
Quartz's default created modified date plugin.
- TypeScript 100%
| 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/created-modified-date
Extracts created, modified and published dates from frontmatter, git history, or filesystem metadata.
Frontmatter created, modified and published (and aliases such as date, lastmod and updated) are read. Git only provides the modified date; the filesystem provides created and modified dates. A source only fills dates that a higher-priority source has not set. Date-only values such as 2024-03-05 are read as local midnight.
Installation
npx quartz plugin add @quartz-community/created-modified-date
It is already included (and enabled) in the default quartz.config.yaml.
Usage
plugins:
- source: "@quartz-community/created-modified-date"
enabled: true
options:
defaultDateType: modified
priority:
- frontmatter
- git
- filesystem
order: 10
For advanced use cases, you can override in TypeScript:
import * as ExternalPlugin from "./.quartz/plugins";
ExternalPlugin.CreatedModifiedDate({
priority: ["frontmatter", "git", "filesystem"],
defaultDateType: "modified",
});
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
priority |
("frontmatter" | "git" | "filesystem")[] |
["frontmatter", "git", "filesystem"] |
The order of sources to check for created and modified dates. |
defaultDateType |
"created" | "modified" | "published" |
"modified" |
Which date to display (e.g. in content-meta, recent-notes and folder/tag listings). |
If you rely on git for dates, keep defaultDateType: modified.
Documentation
See the Quartz documentation for more information.
License
MIT