diff --git a/netlify.toml b/netlify.toml index 78cd14ceb..ae464136b 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,154 +1,93 @@ -# Settings in the [build] context are global and are applied to all contexts -# unless otherwise overridden by more specific contexts. [build] - # Directory to change to before starting a build. - # This is where we will look for package.json/.nvmrc/etc. - base = "" - # Directory (relative to root of your repo) that contains the deploy-ready - # HTML files and assets generated by the build. If a base directory has - # been specified, include it in the publish directory path. + # HTML files and assets generated by the build publish = "website/build/testing-library-docs" - # Default build command. + # Default build command command = "cd website; npm install; npm run format-docs; npm run build" -# Shortcut to discord server invite -[[redirects]] - from = "https://testing-library.com/discord" - to = "https://discord.gg/c6JN9fM" - status = 301 - force = true +[dev] + # A Boolean value that determines if Netlify Dev launches the local server address in your browser + autoLaunch = true + +# Redirects -# React root to React landing page +# Domains [[redirects]] from = "https://react-testing-library.com/" - to = "https://testing-library.com/react/" - status = 301 + to = "/react/" force = true - -# React to main domain [[redirects]] from = "https://react-testing-library.com/*" - to = "https://testing-library.com/:splat" - status = 301 + to = "/:splat" force = true - -# Netlify subdomain to main domain [[redirects]] from = "https://testing-library.netlify.com/*" - to = "https://testing-library.com/:splat" - status = 301 + to = "/:splat" force = true -# Redirects due to reorganization +# Shortcut to Discord server invite [[redirects]] - from = "/docs/*" - to = "/docs/dom-testing-library/:splat" - status = 301 - force = false # do not redirect if route is not 404 + from = "/discord" + to = "https://discord.gg/c6JN9fM" # Support page to help page [[redirects]] from = "/support" to = "/help" - status = 301 - force = true -# DOM landing page to home page +# React Redux recipe to Redux's recipe [[redirects]] - from = "https://testing-library.com/dom/" - to = "https://testing-library.com/docs/dom-testing-library/intro" - status = 301 - force = true + from = "/docs/example-react-redux" + to = "https://redux.js.org/recipes/writing-tests#connected-components" -# React landing page to home page +# Reorganization (do not redirect if route is not 404) [[redirects]] - from = "https://testing-library.com/react/" - to = "https://testing-library.com/docs/react-testing-library/intro" - status = 301 - force = true + from = "/docs/*" + to = "/docs/dom-testing-library/:splat" -# React Native landing page to home page +# Landing pages [[redirects]] - from = "https://testing-library.com/react-native/" - to = "https://testing-library.com/docs/react-native-testing-library/intro" - status = 301 - force = true - -# Cypress landing page to home page + from = "/dom/" + to = "/docs/dom-testing-library/intro" [[redirects]] - from = "https://testing-library.com/cypress/" - to = "https://testing-library.com/docs/cypress-testing-library/intro" - status = 301 - force = true - -# Vue landing page to home page + from = "/react/" + to = "/docs/react-testing-library/intro" [[redirects]] - from = "https://testing-library.com/vue/" - to = "https://testing-library.com/docs/vue-testing-library/intro" - status = 301 - force = true - -# Angular landing page to home page + from = "/react-native/" + to = "/docs/react-native-testing-library/intro" [[redirects]] - from = "https://testing-library.com/angular/" - to = "https://testing-library.com/docs/angular-testing-library/intro" - status = 301 - force = true - -# Puppeteer landing page to home page + from = "/cypress/" + to = "/docs/cypress-testing-library/intro" [[redirects]] - from = "https://testing-library.com/pptr/" - to = "https://testing-library.com/docs/pptr-testing-library/intro" - status = 301 - force = true - -# Svelte landing page to home page + from = "/vue/" + to = "/docs/vue-testing-library/intro" [[redirects]] - from = "https://testing-library.com/svelte/" - to = "https://testing-library.com/docs/svelte-testing-library/intro" - status = 301 - force = true - -# Preact landing page to home page + from = "/angular/" + to = "/docs/angular-testing-library/intro" [[redirects]] - from = "https://testing-library.com/preact/" - to = "https://testing-library.com/docs/preact-testing-library/intro" - status = 301 - force = true - -# jest-dom landing page to home page + from = "/pptr/" + to = "/docs/pptr-testing-library/intro" [[redirects]] - from = "https://testing-library.com/jest-dom/" - to = "https://testing-library.com/docs/ecosystem-jest-dom" - status = 301 - force = true - -# Testcafe landing page to home page + from = "/svelte/" + to = "/docs/svelte-testing-library/intro" [[redirects]] - from = "https://testing-library.com/testcafe/" - to = "https://testing-library.com/docs/testcafe-testing-library/intro" - status = 301 - force = true - -# Nightwatch landing page to home page + from = "/preact/" + to = "/docs/preact-testing-library/intro" [[redirects]] - from = "https://testing-library.com/nightwatch/" - to = "https://testing-library.com/docs/nightwatch-testing-library/intro" - status = 301 - force = true - -# React Redux recipe to Redux's recipe + from = "/jest-dom/" + to = "/docs/ecosystem-jest-dom" +[[redirects]] + from = "/testcafe/" + to = "/docs/testcafe-testing-library/intro" +[[redirects]] + from = "/nightwatch/" + to = "/docs/nightwatch-testing-library/intro" [[redirects]] from = "https://testing-library.com/docs/example-react-redux" to = "https://redux.js.org/recipes/writing-tests#connected-components" - status = 301 - force = true -# Redirect screen error messe to correct page +# Redirect screen error message to correct page [[redirects]] from = "https://testing-library.com/s/screen-global-error" to = "https://testing-library.com/docs/dom-testing-library/api-queries#screen" - status = 301 - force = true