@@ -12,23 +12,13 @@ function isNewLandingPage(currentLayoutName: string): boolean {
1212 )
1313}
1414
15- // TODO: TEMP: This is a temporary solution to turn off/on new landing pages while we develop them.
16- function isNewLandingPageFeature ( req : ExtendedRequest ) : boolean {
17- return (
18- req . query ?. feature === 'bespoke-landing' ||
19- req . query ?. feature === 'journey-landing' ||
20- req . query ?. feature === 'discovery-landing'
21- )
22- }
23-
2415// This module adds either flatTocItems or nestedTocItems to the context object for
2516// product, category, and subcategory TOCs that don't have other layouts specified.
2617// They are rendered by includes/generic-toc-flat.html or includes/generic-toc-nested.html.
2718export default async function genericToc ( req : ExtendedRequest , res : Response , next : NextFunction ) {
2819 if ( ! req . context ) throw new Error ( 'request not contextualized' )
2920 if ( ! req . context . page ) return next ( )
3021 if (
31- ! isNewLandingPageFeature ( req ) &&
3222 req . context . currentLayoutName !== 'default' &&
3323 ! isNewLandingPage ( req . context . currentLayoutName || '' )
3424 )
@@ -106,8 +96,7 @@ export default async function genericToc(req: ExtendedRequest, res: Response, ne
10696 recurse : isRecursive ,
10797 renderIntros,
10898 includeHidden,
109- textOnly :
110- isNewLandingPageFeature ( req ) || isNewLandingPage ( req . context . currentLayoutName || '' ) ,
99+ textOnly : isNewLandingPage ( req . context . currentLayoutName || '' ) ,
111100 } )
112101 }
113102
@@ -117,13 +106,9 @@ export default async function genericToc(req: ExtendedRequest, res: Response, ne
117106 renderIntros = false
118107 req . context . genericTocNested = await getTocItems ( treePage , req . context , {
119108 recurse : isRecursive ,
120- renderIntros :
121- isNewLandingPageFeature ( req ) || isNewLandingPage ( req . context . currentLayoutName || '' )
122- ? true
123- : false ,
109+ renderIntros : isNewLandingPage ( req . context . currentLayoutName || '' ) ? true : false ,
124110 includeHidden,
125- textOnly :
126- isNewLandingPageFeature ( req ) || isNewLandingPage ( req . context . currentLayoutName || '' ) ,
111+ textOnly : isNewLandingPage ( req . context . currentLayoutName || '' ) ,
127112 } )
128113 }
129114
0 commit comments