You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I initially suppose this is a nextra problem, since we don't have bunch of options to tweak flexsearch, so here are the things I gathered, after some testing, I found something interesting:
On nextra/loader#134:142 there's a pageNextRoute that is passed to nextraSearch, which is later used on nextra search plugin to map contents into static chunks on .next folder.
constpageNextRoute='/'+slash(path.relative(PAGES_DIR,mdxPath))// Remove the `mdx?` extension.replace(MARKDOWN_EXTENSION_REGEX,'')// Remove the `*/index` suffix.replace(/\/index$/,'')// Remove the only `index` route.replace(/^index$/,'')
Thanks to this, https://swr.vercel.app/ru/docs/prefetching.ru for example is a valid link, and all links with locale after domain name and at the end will work. If you change one of them, the link goes 404.
Since the link is just a interpolation of contents, would it make sense to just a new replace on the pageNextRoute chain to remove the locale?
This would require a PR on Nextra's repository but I got interested on trying out, so if there's space to me to do it, i would like to try @shuding
When you search in swr-site docs, the url contain
.<locale>
, which is not expected, the url should only contain the url without.<locale>
Current unexpected behavior
The text was updated successfully, but these errors were encountered: