CloudCannon supports embedding rich Snippets in Markdown content when using the CloudCannon Content Editor. Once configured, Snippets in your content will be presented as blocks in rich text views, with the ability to add them as Snippets via the toolbar:
To start configuring Components in your MDX content, a Snippet configuration must be imported using the _snippets_imports
key in your CloudCannon global configuration file.
Docusaurus uses both regular MDX components along with custom extensions, so we import both the mdx
Snippets and the docusaurus_mdx
Snippets. You can find detailed documentation on the base mdx
snippets on the Editing with MDX Components page.
Enabling snippets in the toolbar#
By default, CloudCannon will show the snippet
toolbar action in the content editor if snippets are available.
If you have already customized which options are available via _editables
in your CloudCannon config, you will need to include snippet: true
for Snippets to be available. See the Editables options documentation for more details.
Supported extensions#
Admonitions#
With the Admonition snippet you can use Docusaurus admonition syntax to highlight rich content in the Content Editor.
Code Blocks#
The Code Block snippet allows you to create Docusaurus code blocks with syntax highlighting, titles, and line numbers.
Content Tabs#
The Content Tabs snippet provides support for adding tab seperated content using the Docusaurus Tabs component. If you're using the Content Tab snippet we recommend registering it to the global scope by wrapping the MDX Component file. You can find documentation on Docusaurus component scope here.
Truncate#
The Truncate snippet allows you to mark which content should be included in the blog post summary when using the Docusaurus blog feature.