Skip to content

Commit

Permalink
refactor: remove secure_url to secureUrl change
Browse files Browse the repository at this point in the history
  • Loading branch information
raae committed Mar 12, 2023
1 parent 72c398b commit 9702b77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ When `true`, includes the context data assigned to each resource. Helpful in ret
## ⚠️ Gotchas

- Gatsby pulls the data from Cloudinary when it builds; you need to trigger a rebuild whenever new media files are added to the Cloudinary account.
- `f_auto` and `q_auto` Cloudinary transformations are applied automatically to the `secure_url` value optimizing the delivered media quality and format.
- `f_auto` and `q_auto` Cloudinary transformations are applied automatically to the `secureUrl` value optimizing the delivered media quality and format.

 

Expand Down
6 changes: 3 additions & 3 deletions demo/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function IndexPage({ data }) {
</tr>

{data.allCloudinaryMedia.nodes.map((media) => {
const { secureUrl, context } = media;
const { secure_url, context } = media;
const example1Image = getImage(media.example1ImageData);
const example2Image = getImage(media.example2ImageData);
const example3Image = getImage(media.example3ImageData);
Expand All @@ -49,7 +49,7 @@ export default function IndexPage({ data }) {
<img
width="300"
style={{ maxWidth: '100%', display: 'block' }}
src={secureUrl}
src={secure_url}
alt={alt}
/>
</td>
Expand Down Expand Up @@ -86,7 +86,7 @@ export const query = graphql`
}
allCloudinaryMedia {
nodes {
secureUrl
secure_url
gatsbyImageData(width: 300, placeholder: BLURRED)
example1ImageData: gatsbyImageData(
width: 300
Expand Down
4 changes: 1 addition & 3 deletions plugin/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ const getNodeData = (gatsbyUtils, media, cloudName) => {
originalFormat: media.format,
// Keep all original data around
cloudinaryData: media,
// Generate urls
// Generated urls
url: url,
secureUrl: secureUrl,
// Keep backwards capabilities
secure_url: secureUrl,
internal: {
type: NODE_TYPE,
Expand Down

0 comments on commit 9702b77

Please sign in to comment.