From 357e77f88e19186bf6c39c0efc9d7ebca3e72e4f Mon Sep 17 00:00:00 2001 From: Katherine Beck <49894658+kathmbeck@users.noreply.github.com> Date: Tue, 19 Dec 2023 02:39:00 -0500 Subject: [PATCH] fix(docs): update remote url docs (#38768) update remote url docs --- e2e-tests/adapters/netlify.toml | 4 ++-- packages/gatsby-adapter-netlify/README.md | 14 ++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/e2e-tests/adapters/netlify.toml b/e2e-tests/adapters/netlify.toml index edbccdb76ed51..355b4b679956d 100644 --- a/e2e-tests/adapters/netlify.toml +++ b/e2e-tests/adapters/netlify.toml @@ -7,6 +7,6 @@ [images] remote_images = [ - "^https:\\/\\/images\\.unsplash\\.com\\/(.*)", - "^https:\\/\\/www\\.gatsbyjs\\.com\\/(.*)", + "https://images.unsplash.com/.*", + "https://www.gatsbyjs.com/.*", ] diff --git a/packages/gatsby-adapter-netlify/README.md b/packages/gatsby-adapter-netlify/README.md index b336547cb44d0..8a3c0cf2eaa52 100644 --- a/packages/gatsby-adapter-netlify/README.md +++ b/packages/gatsby-adapter-netlify/README.md @@ -65,7 +65,7 @@ Exact Remote Path regular expressions to use will depend on CMS you use and poss remote_images = [ # is specified in the `spaceId` option for the # gatsby-source-contentful plugin in your gatsby-config file. - "^https:\\/\\/images\\.ctfassets\\.net\\/\\/(.*)" + "https://images.ctfassets.net//.*" ] ``` @@ -76,7 +76,7 @@ Exact Remote Path regular expressions to use will depend on CMS you use and poss remote_images = [ # is speciafied in the `baseUrl` option for the # gatsby-source-drupal plugin in your gatsby-config file. - "\\/(.*)" + "/.*" ] ``` @@ -88,7 +88,7 @@ Exact Remote Path regular expressions to use will depend on CMS you use and poss # is specified in the `url` option for the # gatsby-source-wordpress plugin in your gatsby-config file. # There is no need to include `/graphql in the path here` - "\\/(.*)" + "/.*" ] ``` @@ -96,10 +96,4 @@ Above examples are the most likely ones to be needed. However if you configure your CMS to host assets on different domain or path, you might need to adjust the patterns accordingly. -Keep in mind that you will need to escape special regular expression symbols to avoid creating too permisible patterns: - -- `.` should be escaped as `\\.` (dot) -- `/` should be escaped as `\\/` (slash) -- your rule should start with `^` so domain matching is exact - -If you are using recent versions of Contentful, Drupal or Wordpress source plugins, Gatsby and Netlify Adapter will automatically detect missing Remote Path patterns and will warn you about it and provide require patterns to add to your configuration. +If you are using recent versions of Contentful, Drupal or Wordpress source plugins, Gatsby and Netlify Adapter will automatically detect missing Remote Path patterns and will warn you about it and provide the required patterns to add to your configuration.