Skip to content

Commit 5d6bb65

Browse files
gatsbybotkathmbeck
andauthored
fix(docs): update remote url docs (#38768) (#38770)
update remote url docs (cherry picked from commit 357e77f) Co-authored-by: Katherine Beck <[email protected]>
1 parent 18ffcfa commit 5d6bb65

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

e2e-tests/adapters/netlify.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77

88
[images]
99
remote_images = [
10-
"^https:\\/\\/images\\.unsplash\\.com\\/(.*)",
11-
"^https:\\/\\/www\\.gatsbyjs\\.com\\/(.*)",
10+
"https://images.unsplash.com/.*",
11+
"https://www.gatsbyjs.com/.*",
1212
]

packages/gatsby-adapter-netlify/README.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Exact Remote Path regular expressions to use will depend on CMS you use and poss
6565
remote_images = [
6666
# <your-contentful-space-id> is specified in the `spaceId` option for the
6767
# gatsby-source-contentful plugin in your gatsby-config file.
68-
"^https:\\/\\/images\\.ctfassets\\.net\\/<your-contentful-space-id>\\/(.*)"
68+
"https://images.ctfassets.net/<your-contentful-space-id>/.*"
6969
]
7070
```
7171

@@ -76,7 +76,7 @@ Exact Remote Path regular expressions to use will depend on CMS you use and poss
7676
remote_images = [
7777
# <your-drupal-base-url> is speciafied in the `baseUrl` option for the
7878
# gatsby-source-drupal plugin in your gatsby-config file.
79-
"<your-drupal-base-url>\\/(.*)"
79+
"<your-drupal-base-url>/.*"
8080
]
8181
```
8282

@@ -88,18 +88,12 @@ Exact Remote Path regular expressions to use will depend on CMS you use and poss
8888
# <your-wordpress-url> is specified in the `url` option for the
8989
# gatsby-source-wordpress plugin in your gatsby-config file.
9090
# There is no need to include `/graphql in the path here`
91-
"<your-wordpress-url>\\/(.*)"
91+
"<your-wordpress-url>/.*"
9292
]
9393
```
9494

9595
Above examples are the most likely ones to be needed. However if you configure
9696
your CMS to host assets on different domain or path, you might need to adjust
9797
the patterns accordingly.
9898

99-
Keep in mind that you will need to escape special regular expression symbols to avoid creating too permisible patterns:
100-
101-
- `.` should be escaped as `\\.` (dot)
102-
- `/` should be escaped as `\\/` (slash)
103-
- your rule should start with `^` so domain matching is exact
104-
105-
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.
99+
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.

0 commit comments

Comments
 (0)