Skip to content
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

fix(docs): update remote url docs (#38768) #38770

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions e2e-tests/adapters/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

[images]
remote_images = [
"^https:\\/\\/images\\.unsplash\\.com\\/(.*)",
"^https:\\/\\/www\\.gatsbyjs\\.com\\/(.*)",
"https://images.unsplash.com/.*",
"https://www.gatsbyjs.com/.*",
]
14 changes: 4 additions & 10 deletions packages/gatsby-adapter-netlify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Exact Remote Path regular expressions to use will depend on CMS you use and poss
remote_images = [
# <your-contentful-space-id> is specified in the `spaceId` option for the
# gatsby-source-contentful plugin in your gatsby-config file.
"^https:\\/\\/images\\.ctfassets\\.net\\/<your-contentful-space-id>\\/(.*)"
"https://images.ctfassets.net/<your-contentful-space-id>/.*"
]
```

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

Expand All @@ -88,18 +88,12 @@ Exact Remote Path regular expressions to use will depend on CMS you use and poss
# <your-wordpress-url> 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`
"<your-wordpress-url>\\/(.*)"
"<your-wordpress-url>/.*"
]
```

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.