Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@ module.exports = {

You can find the plugin options in the table below.

| option | type | required | default | description |
| -------------- | ------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cloudName` | string | true | n/a | Cloud name of your Cloudinary account, can be obtained from your [Cloudinary console](https://cloudinary.com/console/). This should be stored and retrieved as an environment variable. |
| `apiKey` | string | true | na/a | API Key of your Cloudinary account, can be obtained from your [Cloudinary console](https://cloudinary.com/console/). This should be stored and retrieved as an environment variable. |
| `apiSecret` | string | true | n/a | API Secret of your Cloudinary account, can be obtained from your [Cloudinary console](https://cloudinary.com/console/). This should be stored and retrieved as an environment variable. |
| `resourceType` | string | false | image | This is the file type. Possible values: image, raw, video. Note: Use the video resource type for all video resources as well as for audio files, such as .mp3. |
| `type` | string | false | all | This is the storage type: upload, private, authenticated, facebook, twitter, gplus, instagram_name, gravatar, youtube, hulu, vimeo, animoto, worldstarhiphop or dailymotion. |
| `maxResults` | integer | false | 10 | Max number of resources to return |
| `tags` | boolean | false | false | If true, include the list of tag names assigned to each resource |
| `prefix` | string | false | n/a | Find all resources with a public ID that starts with the given prefix. The resources are sorted by public ID in the response. |
| `context` | boolean | false | n/a | Specifies if the context data for the image should be returned. This is useful for retrieving `alt` text or custom metadata in key:value pairs for an image set on Cloudinary. |
| option | type | required | default | description |
| -------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cloudName` | string | true | n/a | Cloud name of your Cloudinary account, can be obtained from your [Cloudinary console](https://cloudinary.com/console/). This should be stored and retrieved as an environment variable. |
| `apiKey` | string | true | na/a | API Key of your Cloudinary account, can be obtained from your [Cloudinary console](https://cloudinary.com/console/). This should be stored and retrieved as an environment variable. |
| `apiSecret` | string | true | n/a | API Secret of your Cloudinary account, can be obtained from your [Cloudinary console](https://cloudinary.com/console/). This should be stored and retrieved as an environment variable. |
| `resourceType` | string | false | image | This is the file type. Possible values: image, raw, video. Note: Use the video resource type for all video resources as well as for audio files, such as .mp3. |
| `type` | string | false | n/a | This is the storage type: upload, private, authenticated, facebook, twitter, gplus, instagram_name, gravatar, youtube, hulu, vimeo, animoto, worldstarhiphop or dailymotion. When non given, all types are sourced. |
| `maxResults` | integer | false | 10 | Max number of resources to return |
| `tags` | boolean | false | false | If true, include the list of tag names assigned to each resource |
| `prefix` | string | false | n/a | Find all resources with a public ID that starts with the given prefix. The resources are sorted by public ID in the response. |
| `context` | boolean | false | n/a | Specifies if the context data for the image should be returned. This is useful for retrieving `alt` text or custom metadata in key:value pairs for an image set on Cloudinary. |

With `prefix`, you can source only media files from a specific folder. However, you will need to specify `type` and `resourceType` in the config options.

Expand Down
2 changes: 1 addition & 1 deletion plugin/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports.pluginOptionsSchema = ({ Joi }) => {
apiKey: Joi.string().required(),
apiSecret: Joi.string().required(),
resourceType: Joi.string().default('image'),
type: Joi.string().default('all'),
type: Joi.string(),
maxResults: Joi.number().integer().positive().default(10),
resultsPerPage: Joi.number()
.integer()
Expand Down
1 change: 0 additions & 1 deletion plugin/gatsby-node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ describe('pluginOptionsSchema', () => {
maxResults: 10,
resultsPerPage: 10,
tags: false,
type: 'all',
});
});
});