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

Route name is cropped when it contains index in it #1332

Closed
Baroshem opened this issue Jul 5, 2022 · 2 comments · Fixed by #1334
Closed

Route name is cropped when it contains index in it #1332

Baroshem opened this issue Jul 5, 2022 · 2 comments · Fixed by #1334

Comments

@Baroshem
Copy link

Baroshem commented Jul 5, 2022

Environment

production

Reproduction

Access website here -> https://algolia.nuxtjs.org/advanced/er

The name of the file and the route is indexer.md. A screenshot shows the folder 2.advanced and 3.indexer.md

image

Describe the bug

Not sure if a bug is related to NuxtContent, Docus, or the Nuxt 3 so I decided to report it here. Can be transfered if needed :)

When naming a .md page in the documentation powered by Docus 3 with a name consisting of the keyword index will result in the route cropped.

In my case the file is called 3.indexer.md and the route created from it is er -> Like indexer without index

Additional context

No response

Logs

No response

@Tahul
Copy link
Contributor

Tahul commented Jul 5, 2022

Hey Baroshem!

Thanks for reporting the issue, I suspect this line to be the culprit:

*/
.replace(/^index/, '')

I guess we should maybe use a regex here instead.

In the meantime, as a workaround you can maybe use this:

# indexer.md
---
_path: /indexer
---

cc @farnabaz

@Baroshem
Copy link
Author

Baroshem commented Jul 5, 2022

Hi @Tahul

Thanks for the fast reply! It is not a big issue for me. Just reporting because one of the community members reached to me with it.

It should not break any place and it is a rather minor bug.

Happy coding!

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