You may not need to complete every step in this guide but please carefully review each step to see if it is applicable to your Site's configuration.
1. Explicitly configure attributes for file content Editable Regions#
CloudCannon no longer automatically applies Editable Regions to file content without an explicit attribute. Previously, CloudCannon would attempt to discover these regions automatically when it encountered a content variable as the only child of an element, for example:
<div>{{ content }}</div>
This markup detection was fragile in certain circumstances, and couldn't be explicitly toggled on or off.
For sites using Unified Configuration, CloudCannon will no longer discover these regions automatically. Instead, an explicit attribute now exists to add an Editable Region for the content of a file.
The below code shows how to configure the data-cms-edit="content" attribute to configure Editable Regions for your content:
<div data-cms-edit="content">{{ content }}</div>
2. Configure _snippets_imports#
This step of the migration guide is only relevant to Sites using Hugo or Jekyll as their SSG.
Add the _snippets_imports corresponding to your SSG:
_snippets_imports:
jekyll: true
{
"_snippets_imports": {
"jekyll": true
}
}_snippets_imports:
hugo:
exclude:
- hugo_instagram
{
"_snippets_imports": {
"hugo": {
"exclude": [
"hugo_instagram"
]
}
}
}3. Configure path.static#
This step of the migration guide is only relevant to Sites using Hugo as their SSG.
CloudCannon no longer uses build integrations to set path.static automatically. Please set the path.static key to static.
paths:
static: static
uploads: static/uploads
{
"paths": {
"static": "static",
"uploads": "static/uploads"
}
}To configure paths.uploads, you must also have configured paths.static first.
4. Configure your Markdown engine#
This step of the migration guide is only relevant to Sites using Jekyll or Hugo as their SSG.
CloudCannon supports two Markdown engines: CommonMark and Kramdown. Because most SSGs use CommonMark, CloudCannon assumes you are using this engine by default in the Unified Configuration file format.
Jekyll is on of the few SSGs which use Kramdown by default. If your Site uses Kramdown, you must specify your Markdown engine in your CloudCannon configuration file.
markdown:
engine: kramdown
options:
treat_indentation_as_code: true
table: true
attributes: true
{
"markdown": {
"engine": "kramdown",
"options": {
"treat_indentation_as_code": true,
"table": true,
"attributes": true
}
}
}Previously CloudCannon used your SSG configuration and build to infer which markdown.options you would want. With Unified Configuration, this needs to be configured explicitly. Below is a list of suggestions about options that you might want to enable.
- For Hugo sites, check your Hugo config file
xhtmlshould matchmarkup.goldmark.renderer.xhtml.breaksshould matchmarkup.goldmark.renderer.hardWraps.tableshould matchmarkup.goldmark.extensions.table.strikethroughshould matchmarkup.goldmark.extensions.strikethrough.treat_indentation_as_codeshould be set totrue
- For Jekyll sites
breaksshould matchkramdown.hard_wrapfrom your Jekyll config filetreat_indentation_as_codeshould be set totruetableshould be set totrueattributesshould be set totrue
5. Defunct configuration options#
CloudCannon no longer uses some configuration options in the Unified Configuration file format. Although leaving these keys in your Site files will not harm your Site, they also will not function. If you want to maintain a clean configuration file, we recommend removing defunct configuration options.
We recommend deleting the following keys:
paths.datapaths.collectionspaths.layoutspaths.includes