Skip to content

prefixed collection index collides with root index in path helpers #423

@onmax

Description

@onmax

Problem

When one collection uses the root index.md and another uses a prefixed index.md, Studio collapses both back to the same filesystem path.

Reproduction

Minimal repro:
onmax/repros/tree/main/nuxt-studio-index-collision

pnpm i && pnpm diagnose

Expected

  • marketing/index.md resolves to index.md
  • guides/guides/index.md resolves to guides/index.md
  • getCollectionByFilePath('index.md') resolves marketing

Actual

marketing/index.md -> marketing/index.md -> index.md
guides/guides/index.md -> guides/guides/index.md -> index.md
getCollectionByFilePath('index.md') -> guides

This makes the prefixed collection win when Studio tries to recover a collection from index.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions