Cloudinary support for brunch
This brunch plugin uploads any images to Cloudinary.
This plugin automatically uploads any assets with the following extensions, with no configuration required:
.gif, .jpg, .jpe, .jpeg, .png, .webp, .bmp, .ps, .ept, .eps, .pdf, .psd, .arw, .cr2, .svg, .tif, .tiff, .webp
By default, this plugin will run whenever brunch is in production mode. Any of these commands should work to upload your images:
$ brunch b -p
$ brunch build -p
$ brunch b --production
$ brunch build --production
If you are using the default skeleton, npm run build should also work.
plugins.cloudinary = {
auth: {},
folder: null
useFilename: true
uniqueFilename: true
overwrite: true
transforms: [],
pattern: /\.(gif|jpg|jpe|jpeg|png|webp|bmp|ps|ept|eps|pdf|psd|arw|cr2|svg|tif|tiff|webp)$/
}See Cloudinary parameters for additional info.
If the CLOUDINARY_URL environment variable is not defined, you must configure cloudinary by setting this to an object with the following keys: cloudName, apiKey, and apiSecret.
An optional folder name where the uploaded asset will be stored.
Whether to use the original file name of the uploaded asset. When false, the Public ID will be comprised of random characters. When true, the uploaded file's original filename becomes the Public ID. Random characters are appended to the filename value to ensure Public ID uniqueness if uniqueFilename is true.
When false, does not add random characters at the end of the filename that guarantee its uniqueness. In this case, if overwrite is also false, the upload returns an error. This parameter is relevant only if useFilename is also true.
Whether to overwrite existing assets with the same Public ID. When set to false, a response is returned immediately if an asset with the same Public ID was found.
Transformations passed directly to Cloudinary's eager parameter.
This is a regular expression pattern used to figure out which files should be uploaded to Cloudinary.