File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11const developerRedirects = require ( '../redirects/static/developer' )
2+ const { latest } = require ( '../../lib/enterprise-server-releases' )
3+ const latestDevRedirects = { }
4+
5+ // Replace hardcoded 'latest' with real value
6+ Object . entries ( developerRedirects ) . forEach ( ( [ oldPath , newPath ] ) => {
7+ latestDevRedirects [ oldPath ] = newPath . replace ( 'enterprise-server@latest' , `enterprise-server@${ latest } ` )
8+ } )
29
310// This function runs at server warmup and precompiles possible redirect routes.
411// It outputs them in key-value pairs within a neat Javascript object: { oldPath: newPath }
512module . exports = function precompileRedirects ( pageList ) {
6- const allRedirects = Object . assign ( { } , developerRedirects )
13+ const allRedirects = Object . assign ( { } , latestDevRedirects )
714
815 // CURRENT PAGES PERMALINKS AND FRONTMATTER
916 // create backwards-compatible old paths for page permalinks and frontmatter redirects
You can’t perform that action at this time.
0 commit comments