cloudinary-community / cloudinary-community/gatsby-source-cloudinary

Clarify usage for multiple `resourceType`s

Open
#60 3 comments 0 reactions 0 assignees View on GitHub
hacktoberfest
Dominant language
JavaScript
Stars
28
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Correct me if I'm wrong, but it seems like the way to source both image and video `resourceType`'s, is to include the `gatsby-source-cloudinary` plugin twice in `gatsby-config.js`. Is this the recommended approach?

Example:
```
module.exports = {
plugins: [
...
{
resolve: `gatsby-source-cloudinary`,
options: {
cloudName: process.env.CLOUDINARY_CLOUD_NAME,
apiKey: process.env.CLOUDINARY_API_KEY,
apiSecret: process.env.CLOUDINARY_API_SECRET,
resourceType: "image",
},
},
{
resolve: `gatsby-source-cloudinary`,
options: {
cloudName: process.env.CLOUDINARY_CLOUD_NAME,
apiKey: process.env.CLOUDINARY_API_KEY,
apiSecret: process.env.CLOUDINARY_API_SECRET,
resourceType: "video",
},
},
...
]
};
```

I tried an array `["image", "video"]` but `resourceType` must be a string. Also tried `"image,video"` but that didn't seem to work.

I feel like it would be nice to call out the recommended way to do this in the docs somewhere (whether that is what I've done or another way). I find it kind of surprising the Gatsby config allows duplicate plugins like this; I tried this as a kind of last-ditch effort and it worked, so some explicit guidance would be super helpful.

Contributor guide

Open the contributing guide

Research direction

Start with the gatsby-config.js examples in the issue and review the plugin's existing usage documentation. Document the recommended way to source multiple resourceTypes, including whether duplicate plugin entries are supported, and make the guidance clear enough for users configuring image and video sources.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.