local_backend
configuration to your config.yml
:npx netlify-cms-proxy-server
from the root directory of the above repository.gatsby develop
).netlify-cms-proxy-server
runs an unauthenticated express server. As any client can send requests to the server, it should only be used for local development..env
file in the project's root folder and define the PORT you'd like the proxy server to uselocal_backend
object in config.yml
and specify a url
property to use your custom port numberconfig.yml
file:structure: single_file
.i18n: true
. i18n
configuration on sub fields is ignored.i18n: true
and i18n
configuration should be done per field:backend.use_graphql
to true
in your CMS config:folder: posts
for a collection will save the content under posts/post-title.md
.path
template (similar to the slug
template) to control the content destination.path: '{{year}}/{{slug}}'
will save the content under posts/2019/post-title.md
.media_folder
directory as specified in the configuration.media_folder
directory any entry field that points to a media file will use the absolute path to the published file as designated by the public_folder
configuration.image.png
will result in the image being saved under static/media/image.png
and relevant entry fields populated with the value of /media/image.png
.media_folder
configuration which specifies a relative media folder for the collection.example post
with an image named image.png
will result in a directory structure of:image.png
.path
on a folder collection, media_folder
defaults to an empty string.{{dirname}}
The path to the file's parent directory, relative to the collection's folder
.{{filename}}
The file name without the extension part.{{extension}}
The file extension.{{media_folder}}
The global media_folder
.{{public_folder}}
The global public_folder
.fields
or field
, define them under types
. Similar to fields
, types
must be an array of field definition objects.types
must use the object
widget (this is the default value for widget
).types
: a nested list of object widgets. All widgets must be of type object
. Every object widget may define different set of fields.typeKey
: the name of the field that will be added to every item in list representing the name of the object widget that item belongs to. Ignored if types
is not defined. Default is type
.summary
: allows customization of a collapsed list item object in a similar way to a collection summarytype
key with the name of the type used for the list item. The type
key name can be customized via the typeKey
property in the list configuration.nc-root
. If Netlify CMS finds an element with this ID during initialization, it will mount within that element instead of creating its own.config.yml
. This is important, for example, when creating tight integrations with static site generators.window.CMS_MANUAL_INIT = true
before importing the CMS:registerPreviewStyle
registerPreviewStyle
can now accept a CSS string, in addition to accepting a url. The feature is activated by passing in an object as the second argument, with raw
set to a truthy value. This is critical for integrating with modern build tooling. Here's an example using webpack:github
or GitHub-connected git-gateway
backends, Netlify CMS creates a pull request for each unpublished entry. Every time the unpublished entry is changed and saved, a new commit is added to the pull request. When the entry is published, the pull request is merged, and all of those commits are added to your project commit history in a merge commit.config.yml
:commit_messages
option under backend
in your Netlify CMS config.yml
.{{path}}
will include the full path to the file changed.config.yml
to recreate the default values would look like this:create
slug
, path
, collection
, author-login
, author-name
update
slug
, path
, collection
, author-login
, author-name
delete
slug
, path
, collection
, author-login
, author-name
uploadMedia
path
, author-login
, author-name
deleteMedia
path
, author-login
, author-name
openAuthoring
message
, author-login
, author-name
{{slug}}
: the url-safe filename of the entry changed{{collection}}
: the name of the collection containing the entry changed{{path}}
: the full path to the file changed{{message}}
: the relevant message based on the current change (e.g. the create
message when an entry is created){{author-login}}
: the login/username of the author{{author-name}}
: the full name of the author (might be empty based on the user's profile)YYYY-MM-DD
format. Available transformations are upper
, lower
and date('<format>')
prePublish
, postPublish
, preUnpublish
, postUnpublish
, preSave
and postSave
. The preSave
hook can be used to modify the entry data like so:/admin/#/collections/posts/new
you can pass URL parameters to pre-populate an entry./#/collections/posts/new?title=first&object.title=second&body=%23%20content
title
field populated with first
, the nested object.title
field with second
and the markdown body
field with # content
.body
is URL encoded).remark
, the library used by the richtext editor for serializing and deserializing markdown.netlify-widget-markdown
currently uses [email protected]
, so you should check a plugin's compatibility first.admin
folder contains all Netlify CMS files, stored at the root of your published site. Where you store this folder in the source files depends on your static site generator. Here's the static file location for a few of the most popular static site generators:/
(project root)/static
/public
/source
/views
/input
/content
/.vuepress/public
/_site
/_site
/src/static
css
or images
folder. The contents of folders like that are usually processed as static files, so it's likely you can store your admin
folder next to those. (When you've found the location, feel free to add it to these docs by filing a pull request!)admin
folder, you'll create two files:admin/index.html
, is the entry point for the Netlify CMS admin interface. This means that users navigate to yoursite.com/admin/
to access it. On the code side, it's a basic HTML starter page that loads the Netlify CMS JavaScript file. The second file, admin/config.yml
, is the heart of your Netlify CMS installation, and a bit more complex. The Configuration section covers the details.admin/index.html
file from a public CDN.script
is loaded from the unpkg
CDN. Should there be any issue, jsDelivr
can be used as an alternative source. Simply set the src
to https://cdn.jsdelivr.net/npm/[email protected]^2.0.0/dist/netlify-cms.js
admin/config.yml
file.config.yml
file with these lines:branch
declaration, it defaults to master
.backend
. However, you also have the option to enable the Editorial Workflow, which adds an interface for drafting, reviewing, and approving posts. To do this, add the following line to your Netlify CMS config.yml
:images
folder in your project, you could use its path, possibly creating an uploads
sub-folder, for example:admin
folder.media_folder
file path is relative to the project root, so the example above would work for Jekyll, GitBook, or any other generator that stores static files at the project root. However, it would not work for Hugo, Hexo, Middleman or others that store static files in a subfolder. Here's an example that could work for a Hugo site:public_folder
. While media_folder
specifies where uploaded files are saved in the repo, public_folder
indicates where they are found in the published site. Image src
attributes use this path, which is relative to the file where it's called. For this reason, we usually start the path at the site root, using the opening /
.public_folder
is not set, Netlify CMS defaults to the same value as media_folder
, adding an opening /
if one is not included.collections
settings differ greatly from one site to the next._posts/blog
, and files saved in a date-title format, like 1999-12-31-lets-party.md
. Each post begins with settings in yaml-formatted front matter, like so:collections
settings would look like this in your NetlifyCMS config.yml
file:name
label
folder
create
true
to allow users to create new files in this collection.slug
{{year}}
, {{month}}
, and {{day}}
pulls from the post's date
field or save date. {{slug}}
is a url-safe version of the post's title
. Default is simply {{slug}}
.fields
body
, which follows the front matter). Each field contains the following properties:label
: Field label in the editor UI.name
: Field name in the document front matter.widget
: Determines UI style and value data type (details below).default
(optional): Sets a default value for the field.widget
property specifies a built-in or custom UI widget for a given field. When a content editor enters a value into a widget, that value is saved in the document front matter as the value for the name
specified for that field. A full listing of available widgets can be found in the Widgets doc.config.yml
file. Each post type should be listed as a separate node under the collections
field. See the Collections reference doc for more configuration options.en
in the language
field.<head>
of your CMS index page at /admin/index.html
, as well as the <head>
of your site's main index page. Depending on how your site generator is set up, this may mean you need to add it to the default template, or to a "partial" or "include" template. If you can find where the site stylesheet is linked, that's probably the right place. Alternatively, you can include the script in your site using Netlify's Script Injection feature./admin/
path. To do this, add the following script before the closing body
tag of your site's main index page:function () {}
) in place of the arrow functions (() => {}
), or use a transpiler such as Babel.yoursite.com/admin/
.