1
0
mirror of synced 2025-12-30 03:01:36 -05:00

Fix bug for ghec version of experimental pages (#30494)

This commit is contained in:
Grace Park
2022-09-06 09:14:25 -07:00
committed by GitHub
parent 219638d7d4
commit b84b627e8c
2 changed files with 4 additions and 3 deletions

View File

@@ -59,8 +59,9 @@ export const PlaygroundContextProvider = (props: { children: React.ReactNode })
const router = useRouter()
const [activeSectionIndex, setActiveSectionIndex] = useState(0)
const [scrollToSection, setScrollToSection] = useState<number>()
const path = router.asPath.split('?')[0].split('#')[0]
const path = router.asPath.includes('@latest')
? router.asPath.split('?')[0].split('#')[0].split('@latest')[1]
: router.asPath.split('?')[0].split('#')[0]
const relevantArticles = articles.filter(({ slug }) => slug === path)
const { langId } = router.query

View File

@@ -15,7 +15,7 @@ export const CodeLanguagePicker = () => {
<SubNav.Link
key={language.id}
as={Link}
href={`${routePath}?langId=${language.id}`}
href={`/${router.locale}${routePath}?langId=${language.id}`}
selected={language.id === currentLanguage.id}
>
{language.label}