diff --git a/docs/.eleventy.js b/docs/.eleventy.js index d1138eff322..7b4c4f1a034 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -25,6 +25,15 @@ const { module.exports = function(eleventyConfig) { let now = new Date(); + /* + * The site is loaded from /docs on eslint.org and so we need to adjust + * the path prefix so URLs are evaluated correctly. + * + * The path prefix is turned off for deploy previews so we can properly + * see changes before deployed. + */ + const pathPrefix = process.env.CONTEXT === "deploy-preview" ? "" : "/docs"; + /***************************************************************************************** * Filters * ***************************************************************************************/ @@ -180,7 +189,7 @@ module.exports = function(eleventyConfig) { rules.forEach(function(rule) { let list_item = `