message: feat(theme): try to keep current hash across languages
diff: @@ -24,7 +24,7 @@ export const useNavbarLanguageDropdown =
  // do not display language selection dropdown if there is only one language
  if (localePaths.length < 2) return null;
  - const currentPath = router.currentRoute.value.path;
  + const { path, hash } = router.currentRoute.value;
  const { navbarLocales } = themeLocale.value;
  const languageDropdown: HopeThemeNavGroup<AutoLink> = {
  @@ -44,11 +44,11 @@ export const useNavbarLanguageDropdown =
  // if the target language is current language
  if (targetLang === siteLocale.value.lang) {
  // stay at current link
  - link = currentPath;
  + link = path;
  }
  // if the target language is not current language
  else {
  - const targetLocalePage = currentPath.replace(
  + const targetLocalePage = path.replace(
  routeLocale.value,
  targetLocalePath
  );
  @@ -56,7 +56,8 @@ export const useNavbarLanguageDropdown =
  link =
  // try to link to the corresponding page of current page
  router.getRoutes().some((item) => item.path === targetLocalePage)
  - ? targetLocalePage
  + ? // try to keep current hash across languages
  + `${targetLocalePage}${hash}`
  : // or fallback to homepage
  targetThemeLocale.home ?? targetLocalePath;
  }
  