To store and edit Markdown content in CloudCannon, we need to process it into HTML to make it editable. You can use any Markdown engine you want when building your site, this only covers the Markdown content you edit inside CloudCannon.
CloudCannon supports the CommonMark and Kramdown specifications. The implementations for these are markdown-it
(JavaScript) and kramdown
(Ruby).
specific doc
CloudCannon automatically reads your settings from _config.yml
to match editing and builds.
To use Kramdown:
- Remove or set the
markdown
field tokramdown
in_config.yml
- Set your options in the
kramdown
field in_config.yml
kramdown:
input: GFM
auto_ids: true
To use CommonMark:
- Add the
jekyll-commonmark
gem to yourGemfile
- Set the
markdown
field toCommonMark
in_config.yml
- Set your options in the
commonmark
field in_config.yml
source 'https://rubygems.org'
gem 'jekyll', '3.8.5'
group :jekyll_plugins do
gem 'jekyll-commonmark', '1.3.1'
end
markdown: CommonMark
commonmark:
options: ["SMART", "UNSAFE"]
extensions: ["strikethrough", "table"]
The UNSAFE
option is required for HTML content inside your Markdown files to render correctly.
specific doc
CloudCannon automatically reads your Goldmark settings from Hugo to match editing and builds. The settings you set for Goldmark are automatically mapped across to markdown-it
.
See the Hugo Documentation for information on how to configure Goldmark. Other engines set with defaultMarkdownHandler
are not officially supported.
The UNSAFE
option is required for HTML content inside your Markdown files to render correctly.
specific doc
CloudCannon uses the Eleventy default settings for markdown-it
to match editing and builds.
The default configuration is { html: true }
to match the Eleventy default, but you can update this to match your site by setting the generator.metadata
in your global configuration file:
{
"generator": {
"metadata": {
"markdown": "markdown-it",
"markdown-it": {
"html": true,
"linkify": true
}
}
}
}
generator:
metadata:
markdown: markdown-it
markdown-it:
html: true
linkify: true
module.exports = {
generator: {
metadata: {
markdown: "markdown-it",
"markdown-it": {
html: true,
linkify: true
}
}
}
};
specific doc
markdown-it
is the default Markdown processor in CloudCannon.
The default configuration is { html: true }
to allow the images with width and height attributes the Rich Text editors create, but you can update this to match your site by setting the generator.metadata
in your global configuration file:
{
"generator": {
"metadata": {
"markdown": "markdown-it",
"markdown-it": {
"html": true,
"linkify": true
}
}
}
}
generator:
metadata:
markdown: markdown-it
markdown-it:
html: true
linkify: true
module.exports = {
generator: {
metadata: {
markdown: "markdown-it",
"markdown-it": {
html: true,
linkify: true
}
}
}
};
CommonMark does not support a syntax to define attributes on elements. In order to preserve attributes, that content saves as HTML within your Markdown files.