@@ -25,8 +25,9 @@ module.exports = function(eleventyConfig) {
2525 * it's easier to see if URLs are broken.
2626 *
2727 * When a release is published, HEAD is pushed to the "latest" branch.
28- * Netlify deploys that branch as well, and in that case, we want the
29- * docs to be loaded from /docs/latest on eslint.org.
28+ * When a pre-release is published, HEAD is pushed to the "next" branch.
29+ * Netlify deploys those branches as well, and in that case, we want the
30+ * docs to be loaded from /docs/latest or /docs/next on eslint.org.
3031 *
3132 * The path prefix is turned off for deploy previews so we can properly
3233 * see changes before deployed.
@@ -38,6 +39,8 @@ module.exports = function(eleventyConfig) {
3839 pathPrefix = "/" ;
3940 } else if ( process . env . BRANCH === "latest" ) {
4041 pathPrefix = "/docs/latest/" ;
42+ } else if ( process . env . BRANCH === "next" ) {
43+ pathPrefix = "/docs/next/" ;
4144 }
4245
4346 //------------------------------------------------------------------------------
@@ -49,6 +52,7 @@ module.exports = function(eleventyConfig) {
4952
5053 eleventyConfig . addGlobalData ( "site_name" , siteName ) ;
5154 eleventyConfig . addGlobalData ( "GIT_BRANCH" , process . env . BRANCH ) ;
55+ eleventyConfig . addGlobalData ( "HEAD" , process . env . BRANCH === "main" ) ;
5256 eleventyConfig . addGlobalData ( "NOINDEX" , process . env . BRANCH !== "latest" ) ;
5357 eleventyConfig . addDataExtension ( "yml" , contents => yaml . load ( contents ) ) ;
5458
0 commit comments