docs: improve media library config info (#2685)

This commit is contained in:
Tanvi Bhakta 2019-09-26 03:55:44 +05:30 committed by Shawn Erquhart
parent bcb5caf89e
commit d099bef529

View File

@ -49,19 +49,23 @@ From a technical perspective, the workflow translates editor UI actions into com
## Media and Public Folders
_This setting is required._
Netlify CMS users can upload files to your repository using the Media Gallery. The following settings specify where these files are saved, and where they can be accessed on your built site.
**Options**
### Media Folder
* `media_folder` (required): Folder path where uploaded files should be saved, relative to the base of the repo.
* `public_folder` (optional): Folder path where uploaded files will be accessed, relative to the base of the built site. For fields controlled by \[file] or \[image] widgets, the value of the field is generated by prepending this path to the filename of the selected file. Defaults to the value of `media_folder`, with an opening `/` if one is not already included.
_This setting is required._
**Example**
The `media_folder` option specifies the folder path where uploaded files should be saved, relative to the base of the repo.
```yaml
media_folder: "static/images/uploads"
```
### Public Folder
The `public_folder` option specifies the folder path where the files uploaded by the media library will be accessed, relative to the base of the built site. For fields controlled by \[file] or \[image] widgets, the value of the field is generated by prepending this path to the filename of the selected file. Defaults to the value of `media_folder`, with an opening `/` if one is not already included.
```yaml
public_folder: "/images/uploads"
```
@ -73,7 +77,7 @@ Media library integrations are configured via the `media_library` property, and
an object with at least a `name` property. A `config` property can also be used for options that
should be passed to the library in use.
**Example**
**Example:**
```yaml
media_library:
@ -96,7 +100,7 @@ site_url: https://your-site.com
## Display URL
When the `display_url` setting is specified, the CMS UI will include a link in the fixed area at the top of the page, allowing content authors to easily return to your main site. The text of the link consists of the URL less the protocol portion (e.g., `your-site.com`).
When the `display_url` setting is specified, the CMS UI will include a link in the fixed area at the top of the page, allowing content authors to easily return to your main site. The text of the link consists of the URL without the protocol portion (e.g., `your-site.com`).
Defaults to `site_url`.