Skip to content

fix: collection filename default ignores explicit format, causing ent…#413

Open
RinatMadreiter wants to merge 1 commit into
hunvreus:developmentfrom
RinatMadreiter:patch-2
Open

fix: collection filename default ignores explicit format, causing ent…#413
RinatMadreiter wants to merge 1 commit into
hunvreus:developmentfrom
RinatMadreiter:patch-2

Conversation

@RinatMadreiter

Copy link
Copy Markdown

…ries to disappear

When a collection sets format: json (or yaml/toml) but doesn't set filename, normalizeContentEntry in lib/config.ts still defaults filename to "{year}-{month}-{day}-{primary}.md", so extension resolves to "md" regardless of the declared format. The collection listing endpoint then filters out every file that doesn't end in .md, returning an empty entry list with no error — entries silently vanish from the CMS UI even though the files exist in the repo. Reproduced with a format: json collection containing only .json files. Fix: derive the default filename's extension from format when it's explicitly set.

…ries to disappear

When a collection sets format: json (or yaml/toml) but doesn't set filename, normalizeContentEntry in lib/config.ts still defaults filename to "{year}-{month}-{day}-{primary}.md", so extension resolves to "md" regardless of the declared format. The collection listing endpoint then filters out every file that doesn't end in .md, returning an empty entry list with no error — entries silently vanish from the CMS UI even though the files exist in the repo. Reproduced with a format: json collection containing only .json files. Fix: derive the default filename's extension from format when it's explicitly set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant