* cleanup FEATURE_NEXTJS * fixing some server tests * updating article a for server tests * update h2 to h4 map topic tests * data off on TOCs * updating dropdown article versions links * Update so markdown renders in intros * updating typo and all server tests are now passing * remove nextjs feature flag * head.js tests pass * updating article-version-picker * remove nextjs feature flag browser test * update header.js tests * fix page-titles.js test * fix deprecated-enterprise versions * adding early access * testing * getting childTocItem * fixing table of contents to show child toc items * updated to 2 because the sidebar article also has the same link * remove comment * updating pick * Update TocLandingContext.tsx * update package.json and change className to h4 for h2 * updating with mikes feedback * remove a.active test * React clean up: Delete unnecessary layouts/includes Part 2 (#20143) * Delete unnecessary layouts * setting back tests failing :( * update layouts * delete unnecessary includes * remove github-ae-release-notes and updating layouts * remove a.active test
58 lines
1.9 KiB
TypeScript
58 lines
1.9 KiB
TypeScript
import Head from 'next/head'
|
|
|
|
import { SidebarNav } from 'components/SidebarNav'
|
|
import { Header } from 'components/Header'
|
|
import { SmallFooter } from 'components/SmallFooter'
|
|
import { ScrollButton } from 'components/ScrollButton'
|
|
import { SupportSection } from 'components/SupportSection'
|
|
import { DeprecationBanner } from 'components/DeprecationBanner'
|
|
import { useMainContext } from 'components/context/MainContext'
|
|
import { useTranslation } from './hooks/useTranslation'
|
|
|
|
type Props = { children?: React.ReactNode }
|
|
export const DefaultLayout = (props: Props) => {
|
|
const { page, error, isHomepageVersion, currentPathWithoutLanguage } = useMainContext()
|
|
const { t } = useTranslation('errors')
|
|
return (
|
|
<div className="d-lg-flex">
|
|
<Head>
|
|
{error === '404' ? (
|
|
<title>{t('oops')}</title>
|
|
) : (!isHomepageVersion && page.fullTitle) || (currentPathWithoutLanguage.includes('enterprise-server') && page.fullTitle) ? (
|
|
<title>{page.fullTitle}</title>
|
|
) : null}
|
|
|
|
{/* For Google and Bots */}
|
|
{page.introPlainText && <meta name="description" content={page.introPlainText} />}
|
|
|
|
{page.topics.length > 0 && <meta name="keywords" content={page.topics.join(',')} />}
|
|
|
|
{page.hidden && <meta name="robots" content="noindex" />}
|
|
|
|
{page.languageVariants.map((languageVariant) => {
|
|
return (
|
|
<link
|
|
key={languageVariant.href}
|
|
rel="alternate"
|
|
hrefLang={languageVariant.hreflang}
|
|
href={`https://docs.github.com${languageVariant.href}`}
|
|
/>
|
|
)
|
|
})}
|
|
</Head>
|
|
<SidebarNav />
|
|
|
|
<main className="flex-1 min-width-0">
|
|
<Header />
|
|
<DeprecationBanner />
|
|
|
|
{props.children}
|
|
|
|
<SupportSection />
|
|
<SmallFooter />
|
|
<ScrollButton />
|
|
</main>
|
|
</div>
|
|
)
|
|
}
|