Configure your Markdown engine

Last modified: November 24th, 2023

Working with a specific static site generator?
Customize CloudCannon's documentation to suit your SSG.

Great! We'll show you documentation relevant to .
You can change this any time using the dropdown in the navigation bar.

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:

  1. Remove or set the markdown field to kramdown in _config.yml
  2. Set your options in the kramdown field in _config.yml
_config.yml
copied
kramdown:
  input: GFM
  auto_ids: true

To use CommonMark:

  1. Add the jekyll-commonmark gem to your Gemfile
  2. Set the markdown field to CommonMark in _config.yml
  3. Set your options in the commonmark field in _config.yml
Gemfile
copied
source 'https://rubygems.org'

gem 'jekyll', '3.8.5'

group :jekyll_plugins do
  gem 'jekyll-commonmark', '1.3.1'
end
_config.yml
copied
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:

cloudcannon.config.json
copied
{
  "generator": {
    "metadata": {
      "markdown": "markdown-it",
      "markdown-it": {
        "html": true,
        "linkify": true
      }
    }
  }
}
cloudcannon.config.yaml
copied
generator:
  metadata:
    markdown: markdown-it
    markdown-it:
      html: true
      linkify: true
cloudcannon.config.cjs
copied
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:

cloudcannon.config.json
copied
{
  "generator": {
    "metadata": {
      "markdown": "markdown-it",
      "markdown-it": {
        "html": true,
        "linkify": true
      }
    }
  }
}
cloudcannon.config.yaml
copied
generator:
  metadata:
    markdown: markdown-it
    markdown-it:
      html: true
      linkify: true
cloudcannon.config.cjs
copied
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.

Open in a new tab