diff --git a/components/HeaderNotifications.tsx b/components/HeaderNotifications.tsx index 7827acbd8a..76057ec427 100644 --- a/components/HeaderNotifications.tsx +++ b/components/HeaderNotifications.tsx @@ -19,7 +19,15 @@ type Notif = { export const HeaderNotifications = () => { const router = useRouter() const { currentVersion } = useVersion() - const { relativePath, allVersions, data, languages, currentLanguage, userLanguage, currentPathWithoutLanguage } = useMainContext() + const { + relativePath, + allVersions, + data, + languages, + currentLanguage, + userLanguage, + currentPathWithoutLanguage, + } = useMainContext() const { t } = useTranslation('header') const translationNotices: Array = [] @@ -39,13 +47,12 @@ export const HeaderNotifications = () => { type: NotificationType.TRANSLATION, content: t('notices.localization_in_progress'), }) - } + } } else { if (userLanguage && userLanguage !== 'en' && languages[userLanguage]?.wip === false) { translationNotices.push({ type: NotificationType.TRANSLATION, - content: - `This article is also available in your language of choice. Click here` + content: `This article is also available in your language of choice. Click here`, }) } } diff --git a/components/context/TocLandingContext.tsx b/components/context/TocLandingContext.tsx index a747c91ef1..a4bc6fbf13 100644 --- a/components/context/TocLandingContext.tsx +++ b/components/context/TocLandingContext.tsx @@ -10,6 +10,7 @@ export type TocLandingContextT = { title: string introPlainText: string tocItems: Array + variant?: 'compact' | 'expanded' } export const TocLandingContext = createContext(null) @@ -28,6 +29,7 @@ export const getTocLandingContextFromRequest = (req: any): TocLandingContextT => return { title: req.context.page.title, introPlainText: req.context.page.introPlainText, - tocItems: req.context.tocItems || [], + tocItems: req.context.genericTocFlat || req.context.genericTocNested || [], + variant: req.context.genericTocFlat ? 'expanded' : 'compact', } } diff --git a/components/landing/TocLanding.tsx b/components/landing/TocLanding.tsx index 0f225f9137..d2f1d57ce0 100644 --- a/components/landing/TocLanding.tsx +++ b/components/landing/TocLanding.tsx @@ -7,11 +7,9 @@ import { Breadcrumbs } from 'components/Breadcrumbs' import { useTocLandingContext } from 'components/context/TocLandingContext' import { ArticleTitle } from 'components/article/ArticleTitle' -type Props = { - variant?: 'compact' | 'expanded' -} -export const TocLanding = ({ variant = 'expanded' }: Props) => { - const { title, introPlainText, tocItems } = useTocLandingContext() +type Props = {} +export const TocLanding = (props: Props) => { + const { title, introPlainText, tocItems, variant } = useTocLandingContext() return (
diff --git a/middleware/render-page.js b/middleware/render-page.js index 4f44511e0d..d71c40a87a 100644 --- a/middleware/render-page.js +++ b/middleware/render-page.js @@ -13,8 +13,11 @@ const { HEROKU_RELEASE_VERSION, FEATURE_NEXTJS } = process.env const defaultNextJSRoutes = FEATURE_NEXTJS ? [ - '/en/sponsors', - '/en/discussions' + '/en/billing', + '/en/code-security', + '/en/communities', + '/en/discussions', + '/en/sponsors' ] : [] const pageCacheDatabaseNumber = 1 diff --git a/pages/[versionId]/[productId]/index.tsx b/pages/[versionId]/[productId]/index.tsx index c0af21516e..67b8550864 100644 --- a/pages/[versionId]/[productId]/index.tsx +++ b/pages/[versionId]/[productId]/index.tsx @@ -39,7 +39,7 @@ const GlobalPage = ({ tocLandingContext, articleContext, }: Props) => { - const { currentLayoutName, page, relativePath } = mainContext + const { currentLayoutName, relativePath } = mainContext let content if (currentLayoutName === 'product-landing') { @@ -53,13 +53,7 @@ const GlobalPage = ({ } else if (relativePath?.endsWith('index.md')) { content = ( - + ) } else {