Skip to content

Commit

Permalink
docs: add Private CDNs and custom delivery hostnames (CNAMEs) section
Browse files Browse the repository at this point in the history
  • Loading branch information
raae committed Jul 28, 2024
1 parent 563ce20 commit b04237c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,40 @@ To find the GraphQL Type describing your Cloudinary assets use the built-in [Gra
`defaultBase64` and `defaultTracedSVG` is the base64 URI of the placeholder image, it must comply with [RFC 2397](https://tools.ietf.org/html/rfc2397).
### Private CDNs and custom delivery hostnames (CNAMEs)
If you are using a private CDN or a custom delivery hostname (CNAME) you may configure the plugin to do so. Read more about [Private CDNs and CNAMEs](https://cloudinary.com/documentation/advanced_url_delivery_options#private_cdns_and_cnames).
```js
// File: ./gatsby-config.js

module.exports = {
plugins: [
{
resolve: `gatsby-transformer-cloudinary`,
options: {
transformTypes: [
{
type: `CloudinaryAsset`,
secureDistribution: 'my-domain.com',

// Or using privateCdn
// privateCdn: true,

// Or using cname
// secure: false,
// cname: 'my-domain.com',
},
],
// Optional transformation option
defaultTransformations: ['c_fill', 'g_auto', 'q_auto'],
},
},
`gatsby-plugin-image`,
],
};
```
### Sanity.io Configuration
If you are using [Sanity.io](https://www.sanity.io/) and the [gatsby-source-sanity](https://www.gatsbyjs.com/plugins/gatsby-source-sanity/) plugin use the following configuration to add the `gatsbyImageData` resolver to the sourced Sanity Cloudinary assets:
Expand Down

0 comments on commit b04237c

Please sign in to comment.