Skip to content

Fix: Add Netlify build configuration for mermaid diagrams#50

Merged
anthonymonori merged 1 commit intotrunkfrom
feature/fix-mermaid-netlify
Feb 23, 2026
Merged

Fix: Add Netlify build configuration for mermaid diagrams#50
anthonymonori merged 1 commit intotrunkfrom
feature/fix-mermaid-netlify

Conversation

@anthonymonori
Copy link
Owner

@anthonymonori anthonymonori commented Feb 22, 2026

Problem

After merging #47, Netlify builds fail with:
```
Could not find gem 'jekyll-mermaid-prebuild (~> 0.3.0)' in locally installed gems.
```

Solution

This PR adds the necessary configuration for Netlify to:

  1. Install Node.js 24
  2. Install mermaid-cli (which requires Puppeteer/Chrome)
  3. Install the chromium plugin for Puppeteer support
  4. Use the updated Gemfile.lock with jekyll-mermaid-prebuild

Changes

  • `package.json` - Declares `@mermaid-js/mermaid-cli` as dependency with prebuild script to install Chrome
  • `.node-version` - Specifies Node.js 24 for Netlify
  • `netlify.toml` - Configures build command and chromium plugin
  • `Gemfile.lock` - Updated with jekyll-mermaid-prebuild gem

How it works

  1. Netlify detects `.node-version` and installs Node.js 24
  2. Netlify detects `package.json` and runs `npm install`
  3. The `prebuild` script installs Chrome for Puppeteer
  4. The `netlify-plugin-chromium` plugin ensures Chromium is available
  5. Jekyll build runs with jekyll-mermaid-prebuild, rendering diagrams to SVG

Testing

After merging, the next Netlify build should succeed and render mermaid diagrams to SVG.

- Add package.json with mermaid-cli dependency
- Add .node-version for Node.js 24
- Add netlify.toml with chromium plugin for Puppeteer
- Update Gemfile.lock with jekyll-mermaid-prebuild

This enables build-time mermaid diagram rendering on Netlify.
@anthonymonori anthonymonori marked this pull request as ready for review February 23, 2026 08:47
@anthonymonori anthonymonori merged commit 52f8021 into trunk Feb 23, 2026
1 check passed
@anthonymonori anthonymonori deleted the feature/fix-mermaid-netlify branch February 23, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant