Configuration Options
- All configuration options for Netlify CMS are specified in a
config.yml
file, in the folder where you access the editor UI (usually in the/admin
folder).
Alternatively, you can specify a custom config file using a link tag:
To see working configuration examples, you can start from a template or check out the CMS demo site. (No login required: click the login button and the CMS will open.) You can refer to the demo configuration code to see how each option was configured.
You can find details about all configuration options below. Note that YAML syntax allows lists and objects to be written in block or inline style, and the code samples below include a mix of both.
Backend
This setting is required.
The backend
option specifies how to access the content for your site, including authentication. Full details and code samples can be found in Backends.
Note: no matter where you access Netlify CMS — whether running locally, in a staging environment, or in your published site — it will always fetch and commit files in your hosted repository (for example, on GitHub), on the branch you configured in your Netlify CMS config.yml file. This means that content fetched in the admin UI will match the content in the repository, which may be different from your locally running site. It also means that content saved using the admin UI will save directly to the hosted repository, even if you're running the UI locally or in staging.
Publish Mode
By default, all entries created or edited in the Netlify CMS are committed directly into the main repository branch.
The publish_mode
option allows you to enable "Editorial Workflow" mode for more control over the content publishing phases. All unpublished entries will be arranged in a board according to their status, and they can be further reviewed and edited before going live.
Note: Editorial workflow works with GitHub repositories, and support for GitLab and Bitbucket is in beta.
You can enable the Editorial Workflow with the following line in your Netlify CMS config.yml
file:
from a technical perspective, the workflow translates editor UI actions into common Git commands:
Actions in Netlify UI ... | Perform these Git actions |
---|---|
Save draft | Commits to a new branch (named according to the pattern cms/collectionName/entrySlug ), and opens a pull request |
Edit draft | Pushes another commit to the draft branch/pull request |
Approve and publish draft | Merges pull request and deletes branch |
Media and Public Folders
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.
Media Folder
This setting is required.
The media_folder
option specifies the folder path where uploaded files should be saved, relative to the base of the repo.
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.
Based on the settings above, if a user used an image widget field called avatar to upload and select an image called philosoraptor.png, the image would be saved to the repository at /static/images/uploads/philosoraptor.png
, and the avatar field for the file would be set to /images/uploads/philosoraptor.png.
Lists
- List one
- with list bullets
- Nice
- Ja he
- lols
Quotes
This is a quote and is a very cool one
- Laytan Laats