File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/learning-track/middleware Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -176,9 +176,20 @@ async function indexOfLearningTrackGuide(
176176) {
177177 let guideIndex = - 1
178178
179+ const renderOpts = { textOnly : true }
179180 for ( let i = 0 ; i < trackGuidePaths . length ; i ++ ) {
180181 // Learning track URLs may have Liquid conditionals.
181- const renderedGuidePath = await renderContent ( trackGuidePaths [ i ] , context , { textOnly : true } )
182+ let renderedGuidePath = ''
183+ try {
184+ renderedGuidePath = await renderContent ( trackGuidePaths [ i ] , context , renderOpts )
185+ } catch {
186+ const englishFallbackContext = { ...context , currentLanguage : 'en' }
187+ renderedGuidePath = await renderContent (
188+ trackGuidePaths [ i ] ,
189+ englishFallbackContext ,
190+ renderOpts ,
191+ )
192+ }
182193
183194 if ( ! renderedGuidePath ) continue
184195
You can’t perform that action at this time.
0 commit comments