@@ -14,6 +14,7 @@ import { Breadcrumbs } from 'src/frame/components/page-header/Breadcrumbs'
1414import { useLanguages } from 'src/languages/components/LanguagesContext'
1515import { ClientSideLanguageRedirect } from './ClientSideLanguageRedirect'
1616import { DomainNameEditProvider } from 'src/links/components/useEditableDomainContext'
17+ import { SearchOverlayContextProvider } from '@/search/components/context/SearchOverlayContext'
1718
1819const MINIMAL_RENDER = Boolean ( JSON . parse ( process . env . MINIMAL_RENDER || 'false' ) )
1920
@@ -76,96 +77,98 @@ export const DefaultLayout = (props: Props) => {
7677
7778 return (
7879 < DomainNameEditProvider >
79- < Head >
80- { error === '404' ? (
81- < title > { t ( 'oops' ) } </ title >
82- ) : ( ! isHomepageVersion && page . fullTitle ) ||
83- ( currentPathWithoutLanguage . includes ( 'enterprise-server' ) && page . fullTitle ) ? (
84- < title > { page . fullTitle } </ title >
85- ) : null }
86-
87- { /* For Google and Bots */ }
88- < meta name = "description" content = { metaDescription } />
89- { page . hidden && < meta name = "robots" content = "noindex" /> }
90- { Object . values ( languages )
91- . filter ( ( lang ) => lang . code !== router . locale )
92- . map ( ( variant ) => {
93- return (
94- < link
95- key = { variant . code }
96- rel = "alternate"
97- hrefLang = { variant . hreflang || variant . code }
98- href = { `https://docs.github.com/${ variant . code } ${
99- router . asPath === '/' ? '' : router . asPath
100- } `}
101- />
102- )
103- } ) }
104-
105- { /* For local site search indexing */ }
106- { page . topics . length > 0 && < meta name = "keywords" content = { page . topics . join ( ',' ) } /> }
107-
108- { /* For analytics events */ }
109- { router . locale && < meta name = "path-language" content = { router . locale } /> }
110- { currentVersion && < meta name = "path-version" content = { currentVersion } /> }
111- { currentProduct && < meta name = "path-product" content = { currentProduct . id } /> }
112- { relativePath && (
113- < meta
114- name = "path-article"
115- content = { relativePath . replace ( '/index.md' , '' ) . replace ( '.md' , '' ) }
116- />
117- ) }
118- { page . type && < meta name = "page-type" content = { page . type } /> }
119- { page . documentType && < meta name = "page-document-type" content = { page . documentType } /> }
120- { status && < meta name = "status" content = { status . toString ( ) } /> }
121-
122- { /* OpenGraph data */ }
123- { page . fullTitle && (
124- < >
125- < meta property = "og:site_name" content = "GitHub Docs" />
126- < meta property = "og:title" content = { page . fullTitle } />
127- < meta property = "og:type" content = "article" />
128- < meta property = "og:url" content = { fullUrl } />
129- < meta property = "og:image" content = { getSocialCardImage ( ) } />
130- </ >
131- ) }
132- { /* Twitter Meta Tags */ }
133- < meta name = "twitter:card" content = "summary" />
134- < meta property = "twitter:domain" content = { new URL ( fullUrl ) . hostname } />
135- < meta property = "twitter:url" content = { fullUrl } />
136- < meta name = "twitter:title" content = { page . fullTitle } />
137- { page . introPlainText && < meta name = "twitter:description" content = { page . introPlainText } /> }
138- < meta name = "twitter:image" content = { getSocialCardImage ( ) } />
139- </ Head >
140- < a
141- href = "#main-content"
142- className = "visually-hidden skip-button color-bg-accent-emphasis color-fg-on-emphasis"
143- >
144- Skip to main content
145- </ a >
146- < Header />
147- < ClientSideLanguageRedirect />
148- < div className = "d-lg-flex" >
149- { isHomepageVersion ? null : < SidebarNav /> }
150- { /* Need to set an explicit height for sticky elements since we also
151- set overflow to auto */ }
152- < div className = "flex-column flex-1 min-width-0" >
153- < main id = "main-content" style = { { scrollMarginTop : '5rem' } } >
154- < DeprecationBanner />
155- < RestBanner />
156-
157- { props . children }
158- </ main >
159- < footer data-container = "footer" >
160- < SupportSection />
161- < LegalFooter />
162- < ScrollButton
163- className = "position-fixed bottom-0 mb-4 right-0 mr-4 z-1"
164- ariaLabel = { t ( 'scroll_to_top' ) }
80+ < SearchOverlayContextProvider >
81+ < Head >
82+ { error === '404' ? (
83+ < title > { t ( 'oops' ) } </ title >
84+ ) : ( ! isHomepageVersion && page . fullTitle ) ||
85+ ( currentPathWithoutLanguage . includes ( 'enterprise-server' ) && page . fullTitle ) ? (
86+ < title > { page . fullTitle } </ title >
87+ ) : null }
88+
89+ { /* For Google and Bots */ }
90+ < meta name = "description" content = { metaDescription } />
91+ { page . hidden && < meta name = "robots" content = "noindex" /> }
92+ { Object . values ( languages )
93+ . filter ( ( lang ) => lang . code !== router . locale )
94+ . map ( ( variant ) => {
95+ return (
96+ < link
97+ key = { variant . code }
98+ rel = "alternate"
99+ hrefLang = { variant . hreflang || variant . code }
100+ href = { `https://docs.github.com/${ variant . code } ${
101+ router . asPath === '/' ? '' : router . asPath
102+ } `}
103+ />
104+ )
105+ } ) }
106+
107+ { /* For local site search indexing */ }
108+ { page . topics . length > 0 && < meta name = "keywords" content = { page . topics . join ( ',' ) } /> }
109+
110+ { /* For analytics events */ }
111+ { router . locale && < meta name = "path-language" content = { router . locale } /> }
112+ { currentVersion && < meta name = "path-version" content = { currentVersion } /> }
113+ { currentProduct && < meta name = "path-product" content = { currentProduct . id } /> }
114+ { relativePath && (
115+ < meta
116+ name = "path-article"
117+ content = { relativePath . replace ( '/index.md' , '' ) . replace ( '.md' , '' ) }
165118 />
166- </ footer >
119+ ) }
120+ { page . type && < meta name = "page-type" content = { page . type } /> }
121+ { page . documentType && < meta name = "page-document-type" content = { page . documentType } /> }
122+ { status && < meta name = "status" content = { status . toString ( ) } /> }
123+
124+ { /* OpenGraph data */ }
125+ { page . fullTitle && (
126+ < >
127+ < meta property = "og:site_name" content = "GitHub Docs" />
128+ < meta property = "og:title" content = { page . fullTitle } />
129+ < meta property = "og:type" content = "article" />
130+ < meta property = "og:url" content = { fullUrl } />
131+ < meta property = "og:image" content = { getSocialCardImage ( ) } />
132+ </ >
133+ ) }
134+ { /* Twitter Meta Tags */ }
135+ < meta name = "twitter:card" content = "summary" />
136+ < meta property = "twitter:domain" content = { new URL ( fullUrl ) . hostname } />
137+ < meta property = "twitter:url" content = { fullUrl } />
138+ < meta name = "twitter:title" content = { page . fullTitle } />
139+ { page . introPlainText && < meta name = "twitter:description" content = { page . introPlainText } /> }
140+ < meta name = "twitter:image" content = { getSocialCardImage ( ) } />
141+ </ Head >
142+ < a
143+ href = "#main-content"
144+ className = "visually-hidden skip-button color-bg-accent-emphasis color-fg-on-emphasis"
145+ >
146+ Skip to main content
147+ </ a >
148+ < Header />
149+ < ClientSideLanguageRedirect />
150+ < div className = "d-lg-flex" >
151+ { isHomepageVersion ? null : < SidebarNav /> }
152+ { /* Need to set an explicit height for sticky elements since we also
153+ set overflow to auto */ }
154+ < div className = "flex-column flex-1 min-width-0" >
155+ < main id = "main-content" style = { { scrollMarginTop : '5rem' } } >
156+ < DeprecationBanner />
157+ < RestBanner />
158+
159+ { props . children }
160+ </ main >
161+ < footer data-container = "footer" >
162+ < SupportSection />
163+ < LegalFooter />
164+ < ScrollButton
165+ className = "position-fixed bottom-0 mb-4 right-0 mr-4 z-1"
166+ ariaLabel = { t ( 'scroll_to_top' ) }
167+ />
168+ </ footer >
169+ </ div >
167170 </ div >
168- </ div >
171+ </ SearchOverlayContextProvider >
169172 </ DomainNameEditProvider >
170173 )
171174}
0 commit comments