Skip to content

Bug in calculation of "_raw.flattenedPath" #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Oleksandr-Kei opened this issue Jun 14, 2023 · 1 comment
Closed

Bug in calculation of "_raw.flattenedPath" #487

Oleksandr-Kei opened this issue Jun 14, 2023 · 1 comment
Milestone

Comments

@Oleksandr-Kei
Copy link

There is a problem with _raw.flattenedPath in generated JSON schemas for content files.
If there is a file with "index" in the end of filename then this part will be erased in resulted value of _raw.flattenedPath
For example:

  • “search-by-index.mdx” will be resulted into “search-by-” in generated JSON schema;
  • “find-element-by-index.md” will be resulted into “find-element-by-“
  • “solution-documents/search-by-index.mdx” will be resulted into “solution-documents/search-by-“
  • “solution-documents/find-element-by-index.md” will be resulted into “solution-documents/find-element-by-”

Screenshot (889)

Here is a repo to reproduce the issue: https://github.com/Oleksandr-Kei/contentlayer-project

Actual problem could be in this line
Because /\/?index$/ covers not only cases of "something/index" and "index". But also cases like "something-index", "somethingindex", etc.

@schickling schickling added this to the 0.3.4 milestone Jun 14, 2023
@schickling
Copy link
Collaborator

This should be addressed with the 0.3.4 release. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants