Media Storage
Sveltia CMS supports multiple media storage providers for managing media assets such as images and files. You can choose from the built-in internal media storage that saves files directly in your Git repository, or integrate with popular cloud-based media storage services for enhanced capabilities.
Note for Netlify/Decap CMS users
In Sveltia CMS, the term “media storage provider” is used instead of “media library” to avoid confusion with Sveltia CMS’s Asset Library feature that allows you to manage media assets from multiple sources in one place. There is no change in functionality or configuration; it’s simply a terminology update.
Internal Storage
The internal media storage allows you to store media files directly in your Git repository along with your content files. It supports various configuration options for organizing and managing media files effectively.
External Storage
Sveltia CMS supports integrations with popular cloud-based media storage providers for enhanced capabilities such as automatic image transformations, CDN delivery, and more. Sveltia CMS currently supports the following external media storage providers:
Unlike backends, you can use multiple storage providers simultaneously in Sveltia CMS. Each media storage provider integration includes its own configuration instructions.
Breaking changes from Netlify/Decap CMS
Sveltia CMS does not support the deprecated Netlify Large Media service. If you are currently using it, you will need to migrate your assets to one of the supported providers mentioned above.
Also, Sveltia CMS does not support the undocumented custom media storage provider API. The CMS.registerMediaLibrary method is a noop in Sveltia CMS. We may add support for custom storage providers in future releases.
Future Plans
More integrations, including Amazon S3 and Cloudflare R2, will be added in the future.
Configuration
Relevant configuration options can be set in the media_folder, public_folder, and media_libraries options of your CMS configuration file. The media_library option from Netlify/Decap CMS is also supported for backward compatibility.
The following example demonstrates how to configure multiple providers in Sveltia CMS:
# Default media storage paths
media_folder: /static/media
public_folder: /media
# Media provider features
media_libraries:
default:
config:
max_file_size: 1024000 # default: Infinity
slugify_filename: true # default: false
transformations: # See the documentation for details
cloudinary:
config:
cloud_name: YOUR_CLOUD_NAME
api_key: YOUR_API_KEY
output_filename_only: true
uploadcare:
config:
publicKey: YOUR_PUBLIC_KEY
settings:
autoFilename: true
defaultOperations: '/resize/800x600/'# Default media storage paths
media_folder = "/static/media"
public_folder = "/media"
# Media provider features
[media_libraries.default]
[media_libraries.default.config]
max_file_size = 1024000 # default: Infinity
slugify_filename = true # default: false
# transformations: See the documentation for details
[media_libraries.cloudinary]
[media_libraries.cloudinary.config]
cloud_name = "YOUR_CLOUD_NAME"
api_key = "YOUR_API_KEY"
output_filename_only = true
[media_libraries.uploadcare]
[media_libraries.uploadcare.config]
publicKey = "YOUR_PUBLIC_KEY"
[media_libraries.uploadcare.settings]
autoFilename = true
defaultOperations = "/resize/800x600/"{
"media_folder": "/static/media",
"public_folder": "/media",
"media_libraries": {
"default": {
"config": {
"max_file_size": 1024000,
"slugify_filename": true
}
},
"cloudinary": {
"config": {
"cloud_name": "YOUR_CLOUD_NAME",
"api_key": "YOUR_API_KEY"
},
"output_filename_only": true
},
"uploadcare": {
"config": {
"publicKey": "YOUR_PUBLIC_KEY"
},
"settings": {
"autoFilename": true,
"defaultOperations": "/resize/800x600/"
}
}
}
}{
media_folder: "/static/media",
public_folder: "/media",
media_libraries: {
default: {
config: {
max_file_size: 1024000,
slugify_filename: true,
},
},
cloudinary: {
config: {
cloud_name: "YOUR_CLOUD_NAME",
api_key: "YOUR_API_KEY",
},
output_filename_only: true,
},
uploadcare: {
config: {
publicKey: "YOUR_PUBLIC_KEY",
},
settings: {
autoFilename: true,
defaultOperations: "/resize/800x600/",
},
},
},
}See the individual media storage provider documentation for specific configuration options and details.
Legacy media_library Option
Sveltia CMS supports the legacy media_library option for backward compatibility with Netlify/Decap CMS, but it is recommended to use the media_libraries option for new configurations. With the legacy option, only a single media storage provider can be configured. Here is an example of configuring Cloudinary using the legacy option:
media_library:
name: cloudinary
config:
cloud_name: YOUR_CLOUD_NAME
api_key: YOUR_API_KEY
output_filename_only: true