Skip to content

fix: update domain url docs #735

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 1 commit into from
Dec 19, 2023
Merged
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
17 changes: 5 additions & 12 deletions docs/image-cdn.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ NETLIFY_IMAGE_CDN = "true"

[images]
remote_images = [
'^https:\\/\\/example1\\.com\\/.*',
'^https:\\/\\/example2\\.com\\/.*'
'https://example1.com/.*',
'https://example2.com/.*'
]
```

Expand All @@ -33,7 +33,7 @@ configuration of it.
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 @@ -44,7 +44,7 @@ configuration of it.
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 @@ -56,21 +56,14 @@ configuration of it.
# <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

## How it works

When using the Image CDN, Gatsby generates URLs of the form
Expand Down