diff --git a/lib/config.ts b/lib/config.ts index 222bca1d4..f98e18412 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -268,7 +268,16 @@ const normalizeContentEntry = ( } } if (item.filename == null && item.type === "collection") { - item.filename = "{year}-{month}-{day}-{primary}.md"; + const formatExtensions: Record = { ++ json: "json", ++ toml: "toml", ++ yaml: "yaml", ++ "json-frontmatter": "md", ++ "toml-frontmatter": "md", ++ "yaml-frontmatter": "md", ++ }; ++ const ext = item.format != null ? formatExtensions[item.format] : undefined; ++ item.filename = `{year}-{month}-{day}-{primary}.${ext ?? "md"}`; } if (item.extension == null) { const filename = item.type === "file" ? item.path : item.filename;