Closed neicore closed 1 week ago
same here, should be fixed before stable release!
Also there are several l18n related:
Also markdown.container.*Label
can only be set in root, but cannot in locales
Tooltip for toggle dark mode is hardcoded. https://github.com/vuejs/vitepress/blob/c343d938fccd878134c8b9dbf2b12dce226a1c19/src/client/theme-default/components/VPSwitchAppearance.vue#L16-L21
404 page didn't respect locale
: logo and navbar links
Tooltip for the "Copy Code" button is hardcoded too.
@brc-dd
I faced at this issue with the latest VitePress.
As far as I investigated, what's happening is like below:
notFoundPageData.relativePath
is always an empty string regardless of actual page path the user is navigated toresolveSiteDataByRoute()
, isActive()
always returns false
and localeIndex
is fallen back to "root"
siteData
is made up by merging 2 root configsUpdating notFoundPageData.relativePath
based on the current route would resolve this issue, but I'm not sure might be missing a reason why you set an empty string to it, and can't be so confident to submit a PR. 🙏
notFoundPageData.relativePath
needs to be kept as empty because only one 404.html page is generated and I don't think any popular host supports localized error pages. We can however fix this problem similar to how we are determining the root link inside onMounted hook.
@brc-dd
Thank you for the quick fix! But, unfortunately #3833 resolved the issue only partially. 🙌
themeConfig
for NotFound page is made up on mounted hook of NotFound.vue
, which corresponds to main contents of the page. As a result, other components such as layout components (e.g VPFooter
) is still not localized.
I don't think there is any way to fix that except to render 404 completely on client 👀
@brc-dd will above mentioned container labels support locales? it seems still not fixed yet
You can customize those but cannot override based on locale. Track https://github.com/vuejs/vitepress/issues/3141#issuecomment-1784021955 for that. The current workaround is to always specify titles on blocks.
Yeah, customizable but not localized, I will track that issue, thanks. though it is inactive for half a year already
Describe the bug
I added a custom notFound and footer content in the themeConfig and it works as expected, but when I passed custom in themeConfig of a locale, the values didn't appear
Reproduction
In any vitepress project that has locale go to themeConfig of that locale and add custom notFound or footer values and they wont show up when you are in that locale
Expected behavior
When you add custom values of notFound or footer in themeConfig or a locale, they should show up if you are in that locale
System Info
Additional context
you can find my config here: https://github.com/NuruProgramming/nyaraka/blob/main/docs/.vitepress/config.mts
currently it only has notFound property in locale
Validations