In the previous post, Building a Content Publishing Pipeline with Jenkins and WordPress, I introduced a fully automated workflow for publishing Markdown content — including pre-rendered diagrams — directly to WordPress.
This post adds a small but powerful improvement: Mermaid diagrams can now be written inline in Markdown and rendered automatically during the pipeline run.
Why this matters
Keeping diagrams close to the text they describe has several benefits:
- Better readability while writing
- Fewer external files to manage
- Easier reviews and diffs
- Fully automated rendering — no manual steps
- Wordpress, unlike other platforms, does not automatically recognize Mermaid code
Authors can now focus on content, while the pipeline handles everything else.
Inline Mermaid example
Here is a Mermaid diagram written directly in Markdown:
{{ diagram: mermaid-ef2c8c198811.png }}
During the Jenkins run, this block is:
- Extracted from the Markdown
- Rendered into a PNG image
- Uploaded to the WordPress media library
- Replaced inline with a standard Markdown image reference
The published post contains no Mermaid code at all, only a static image — which means:
- No JavaScript dependencies
- Better performance
- Better SEO
- No surprises for feed readers or crawlers
How it works (high level)
The workflow is intentionally simple:
- Markdown files are scanned for “`mermaid blocks
- Each diagram is rendered deterministically based on its content
- Images are stored alongside other media assets
- The publishing step only deals with already-rendered files
This keeps responsibilities clearly separated:
- Jenkins renders
- Publishing uploads
- WordPress (and later other platforms) displays
What’s next
This marks the v1.1.0 milestone of the publishing pipeline.
Future improvements may include:
- Diagram captions
- Reusable diagrams across posts
- Cross-posting to additional platforms
But for now, inline Mermaid support removes friction where it matters most: writing and being creative.
If you haven’t seen the original pipeline yet, start here: Building a Content Publishing Pipeline with Jenkins and WordPress.
Did you find this post helpful? You can support me.



