Series index: Images, galleries and media
Use this guide for an existing Markdown post or page with the default layout
or another layout based on minimal. The search layout does not display page
content.
Version requirement: Mermaid is available in v2.2.0 and later. It is absent from the v2.1.0 gem or a remote theme pinned to that release.
Enable and insert the diagram
Add mermaid: true to the existing settings block between --- lines at the top
of your page. Preserve the other fields. Then insert a mermaid fenced block
in the body. A complete page example:
---
layout: default
title: My publishing workflow
mermaid: true
---
```mermaid
flowchart LR
accTitle: Publishing workflow
accDescr: Write content, build the site and publish it.
A[Write] --> B[Build] --> C[Publish]
```
Saving an article starts the build; a successful build publishes the website.
Adapt the labels and accessible description to your diagram. Keep a prose explanation for complex diagrams.
Publish and check
Use the publishing checklist to open the updated site.
Use a modern browser with JavaScript modules and ES2024 support (Safari 17.4 or
later). Check that the flowchart replaces the code and fits the page; wide
charts can scroll horizontally. If code remains visible, check mermaid: true,
the fence spelling and diagram syntax, then check whether the CDN or JavaScript
is blocked. Mermaid loads from https://cdn.jsdelivr.net.
Try the live Mermaid demo. For the library version, security restrictions and fallback behavior, see the Mermaid reference.