Skip to content

Commit

Permalink
fix: update domain url docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kathmbeck committed Dec 18, 2023
1 parent 93430e2 commit fc61b60
Showing 1 changed file with 5 additions and 12 deletions.
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

0 comments on commit fc61b60

Please sign in to comment.