Skip to content
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

[v3] Issue with Navigation API Response #2958

Open
maximepvrt opened this issue Jan 8, 2025 · 2 comments · May be fixed by #2959
Open

[v3] Issue with Navigation API Response #2958

maximepvrt opened this issue Jan 8, 2025 · 2 comments · May be fixed by #2959

Comments

@maximepvrt
Copy link
Contributor

Environment



Reproduction

Create content with an index.md file in a nested directory structure. For example:

  • /devenir-benevole/france/ain/index.md
  • /devenir-benevole/france/ain/bourg-en-bresse.md

Describe the bug

It seems there is an issue with the stem field generation for parent files in the Nuxt Content 3 navigation API. The stem field for parent files currently matches the stem of the first child, which seems inconsistent. Additionally, there is a duplication of children at the same navigation level.

Example API Response

[
   {
      "title":"Devenir Benevole",
      "path":"/devenir-benevole",
      "stem":"devenir-benevole/france/ain/bourg-en-bresse",
      "children":[
         {
            "title":"France",
            "path":"/devenir-benevole/france",
            "stem":"devenir-benevole/france/ain/bourg-en-bresse",
            "children":[
               {
                  "title":"Ain",
                  "path":"/devenir-benevole/france/ain",
                  "stem":"devenir-benevole/france/ain/bourg-en-bresse",
                  "children":[
                     {
                        "title":"Devenir bénévole à Bourg-en-Bresse",
                        "path":"/devenir-benevole/france/ain/bourg-en-bresse",
                        "stem":"devenir-benevole/france/ain/bourg-en-bresse",
                        "name":"Bourg-en-Bresse"
                     }
                  ],
                  "page":false
               },
               {
                  "title":"Faire du bénévolat dans l'Ain",
                  "path":"/devenir-benevole/france/ain",
                  "stem":"devenir-benevole/france/ain/index",
                  "children":[
                     {
                        "title":"Faire du bénévolat dans l'Ain",
                        "path":"/devenir-benevole/france/ain",
                        "stem":"devenir-benevole/france/ain/index",
                        "name":"Ain"
                     }
                  ],
                  "name":"Ain"
               }
            ],
            "page":false
         }
      ],
      "page":false
   }
]

Identified Issues

  1. Inconsistent stem field:

    • For example, the element with title: "France" has a stem value of "devenir-benevole/france/ain/bourg-en-bresse", whereas it should match its own path ("devenir-benevole/france").
  2. Duplicate children:

    • The "Ain" node appears twice with slightly different titles:
      • "Ain" (linked to /devenir-benevole/france/ain)
      • "Faire du bénévolat dans l'Ain" (also linked to /devenir-benevole/france/ain).

Additional context

No response

Logs

@maximepvrt
Copy link
Contributor Author

@farnabaz

@farnabaz farnabaz linked a pull request Jan 9, 2025 that will close this issue
7 tasks
@farnabaz
Copy link
Member

farnabaz commented Jan 9, 2025

Thanks for the report @maximepvrt
It should be fixed in #2959. you can check with PR release npm i https://pkg.pr.new/@nuxt/content@2959

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

Successfully merging a pull request may close this issue.

2 participants