diff --git a/.netlify/www/_redirects b/.netlify/www/_redirects new file mode 100644 index 000000000..6e09ed462 --- /dev/null +++ b/.netlify/www/_redirects @@ -0,0 +1,6 @@ +# Specific to our deploy-preview +# Our docs are published using CircleCI + GitBook +# Confgure redirects using netlify.toml + +# PWA Demo +/pwa/* /pwa/index.html 200 diff --git a/README.md b/README.md index 6f74abd22..edc142726 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,8 @@ window.config = { }; ``` -- Install the viewer: `window.OHIFStandaloneViewer.installViewer(window.config);` +- Install the viewer: + `window.OHIFStandaloneViewer.installViewer(window.config);` This exact setup is demonstrated in this [CodeSandbox](https://codesandbox.io/s/ohif-viewer-script-tag-usage-c4u4t) and diff --git a/docs/_redirects b/docs/_redirects new file mode 100644 index 000000000..d28537fec --- /dev/null +++ b/docs/_redirects @@ -0,0 +1,3 @@ +# Netlify redirects +# SPA rules for our docs +/* /index.html 200 diff --git a/netlify.toml b/netlify.toml index 20302413b..18c51b3ef 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ # TOML Reference: # https://www.netlify.com/docs/netlify-toml-reference/ # -# We use Netlify for deploy previews and deploy previews only. +# We use Netlify for deploy previews and for publishing docs (gh-pages branch). # https://viewer.ohif.org is created using a different process that is # managed by CircleCI and deployed to our Google Hosting # @@ -40,25 +40,6 @@ publish = ".netlify/www/" command = "yarn config set workspaces-experimental true && chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh" -# Redirects and headers are GLOBAL for all builds – they do not get scoped to -# contexts no matter where you define them in the file. -# For context-specific rules, use _headers or _redirects files, which are -# PER-DEPLOY. -# The following redirect is intended for use with most SPAs that handle -# routing internally. -# By default, redirects won't be applied if there's a file with the same -# path as the one defined in the `from` property. Setting `force` to `true` -# will make the redirect rule take precedence over any existing files. -[[redirects]] - from = "/*" - to = "/index.html" - status = 200 - -[[redirects]] - from = "/pwa/*" - to = "/pwa/index.html" - status = 200 - [[headers]] # Define which paths this specific [[headers]] block will cover. for = "/*"