diff --git a/Makefile.js b/Makefile.js
index f74c8c44e97..4bf2c580645 100644
--- a/Makefile.js
+++ b/Makefile.js
@@ -345,9 +345,18 @@ function generatePrerelease(prereleaseId) {
*/
function publishRelease() {
ReleaseOps.publishRelease();
+ const releaseInfo = JSON.parse(cat(".eslint-release-info.json"));
+ const isPreRelease = /[a-z]/u.test(releaseInfo.version);
- // push to latest branch to trigger docs deploy
- exec("git push origin HEAD:latest -f");
+ /*
+ * for a pre-release, push to the "next" branch to trigger docs deploy
+ * for a release, push to the "latest" branch to trigger docs deploy
+ */
+ if (isPreRelease) {
+ exec("git push origin HEAD:next -f");
+ } else {
+ exec("git push origin HEAD:latest -f");
+ }
publishSite();
}
diff --git a/docs/.eleventy.js b/docs/.eleventy.js
index 374ab1b93e5..01801d389e3 100644
--- a/docs/.eleventy.js
+++ b/docs/.eleventy.js
@@ -25,8 +25,9 @@ module.exports = function(eleventyConfig) {
* it's easier to see if URLs are broken.
*
* When a release is published, HEAD is pushed to the "latest" branch.
- * Netlify deploys that branch as well, and in that case, we want the
- * docs to be loaded from /docs/latest on eslint.org.
+ * When a pre-release is published, HEAD is pushed to the "next" branch.
+ * Netlify deploys those branches as well, and in that case, we want the
+ * docs to be loaded from /docs/latest or /docs/next on eslint.org.
*
* The path prefix is turned off for deploy previews so we can properly
* see changes before deployed.
@@ -38,6 +39,8 @@ module.exports = function(eleventyConfig) {
pathPrefix = "/";
} else if (process.env.BRANCH === "latest") {
pathPrefix = "/docs/latest/";
+ } else if (process.env.BRANCH === "next") {
+ pathPrefix = "/docs/next/";
}
//------------------------------------------------------------------------------
@@ -49,6 +52,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addGlobalData("site_name", siteName);
eleventyConfig.addGlobalData("GIT_BRANCH", process.env.BRANCH);
+ eleventyConfig.addGlobalData("HEAD", process.env.BRANCH === "main");
eleventyConfig.addGlobalData("NOINDEX", process.env.BRANCH !== "latest");
eleventyConfig.addDataExtension("yml", contents => yaml.load(contents));
diff --git a/docs/src/_data/config.json b/docs/src/_data/config.json
index 4acb4820247..9bd751d1809 100644
--- a/docs/src/_data/config.json
+++ b/docs/src/_data/config.json
@@ -1,4 +1,5 @@
{
"lang": "en",
- "version": "7.26.0"
+ "version": "7.26.0",
+ "showNextVersion": false
}
diff --git a/docs/src/_includes/components/nav-version-switcher.html b/docs/src/_includes/components/nav-version-switcher.html
index f4e0f5fe025..a01e5ddf30c 100644
--- a/docs/src/_includes/components/nav-version-switcher.html
+++ b/docs/src/_includes/components/nav-version-switcher.html
@@ -12,8 +12,11 @@
Version