Skip to content

Netlify config fixes #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Oct 1, 2020
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 40 additions & 64 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,147 +1,123 @@
# 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.
command = "cd website; npm install; npm run format-docs; npm run build"
command = "npm i -g yarn; cd website; yarn; yarn format-docs; yarn build"

[dev]
autoLaunch = true # a Boolean value that determines if Netlify Dev launches the local server address in your browser

# Shortcut to discord server invite
[[redirects]]
from = "https://testing-library.com/discord"
from = "/discord"
to = "https://discord.gg/c6JN9fM"
status = 301
force = true

# React root to React landing page
[[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

# React Redux recipe to Redux's recipe
[[redirects]]
from = "/docs/example-react-redux"
to = "https://redux.js.org/recipes/writing-tests#connected-components"
force = true

# Redirects due to reorganization
# Redirects due to reorganization (do not redirect if route is not 404)
[[redirects]]
from = "/docs/*"
to = "/docs/dom-testing-library/:splat"
status = 301
force = false # do not redirect if route is not 404

# Support page to help page
[[redirects]]
from = "/support"
to = "/help"
status = 301
force = true

# DOM landing page to home page
[[redirects]]
from = "https://testing-library.com/dom/"
to = "https://testing-library.com/docs/dom-testing-library/intro"
status = 301
from = "/dom/"
to = "/docs/dom-testing-library/intro"
force = true

# React landing page to home page
[[redirects]]
from = "https://testing-library.com/react/"
to = "https://testing-library.com/docs/react-testing-library/intro"
status = 301
from = "/react/"
to = "/docs/react-testing-library/intro"
force = true

# React Native landing page to home page
[[redirects]]
from = "https://testing-library.com/react-native/"
to = "https://testing-library.com/docs/react-native-testing-library/intro"
status = 301
from = "/react-native/"
to = "/docs/react-native-testing-library/intro"
force = true

# Cypress landing page to home page
[[redirects]]
from = "https://testing-library.com/cypress/"
to = "https://testing-library.com/docs/cypress-testing-library/intro"
status = 301
from = "/cypress/"
to = "/docs/cypress-testing-library/intro"
force = true

# Vue landing page to home page
[[redirects]]
from = "https://testing-library.com/vue/"
to = "https://testing-library.com/docs/vue-testing-library/intro"
status = 301
from = "/vue/"
to = "/docs/vue-testing-library/intro"
force = true

# Angular landing page to home page
[[redirects]]
from = "https://testing-library.com/angular/"
to = "https://testing-library.com/docs/angular-testing-library/intro"
status = 301
from = "/angular/"
to = "/docs/angular-testing-library/intro"
force = true

# Puppeteer landing page to home page
[[redirects]]
from = "https://testing-library.com/pptr/"
to = "https://testing-library.com/docs/pptr-testing-library/intro"
status = 301
from = "/pptr/"
to = "/docs/pptr-testing-library/intro"
force = true

# Svelte landing page to home page
[[redirects]]
from = "https://testing-library.com/svelte/"
to = "https://testing-library.com/docs/svelte-testing-library/intro"
status = 301
from = "/svelte/"
to = "/docs/svelte-testing-library/intro"
force = true

# Preact landing page to home page
[[redirects]]
from = "https://testing-library.com/preact/"
to = "https://testing-library.com/docs/preact-testing-library/intro"
status = 301
from = "/preact/"
to = "/docs/preact-testing-library/intro"
force = true

# jest-dom landing page to home page
[[redirects]]
from = "https://testing-library.com/jest-dom/"
to = "https://testing-library.com/docs/ecosystem-jest-dom"
status = 301
from = "/jest-dom/"
to = "/docs/ecosystem-jest-dom"
force = true

# Testcafe landing page to home page
[[redirects]]
from = "https://testing-library.com/testcafe/"
to = "https://testing-library.com/docs/testcafe-testing-library/intro"
status = 301
from = "/testcafe/"
to = "/docs/testcafe-testing-library/intro"
force = true

# Nightwatch landing page to home page
[[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
[[redirects]]
from = "https://testing-library.com/docs/example-react-redux"
to = "https://redux.js.org/recipes/writing-tests#connected-components"
status = 301
from = "/nightwatch/"
to = "/docs/nightwatch-testing-library/intro"
force = true