Fix bug for ghec version of experimental pages (#30494)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user