Skip to content

fix(docs): upgrade Docsy to v0.12.0 to render mermaid diagrams#3541

Open
twishabansal wants to merge 2 commits into
mainfrom
fix/mermaid-hugo-compat
Open

fix(docs): upgrade Docsy to v0.12.0 to render mermaid diagrams#3541
twishabansal wants to merge 2 commits into
mainfrom
fix/mermaid-hugo-compat

Conversation

@twishabansal

@twishabansal twishabansal commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Problem

Docsy v0.11.0's mermaid.html partial calls Resource.Err, which Hugo removed in 0.141.0. This repo builds with Hugo >= 0.146, so any page containing a mermaid block fails the build. No page uses mermaid today, so the break is latent.

Fix

  • Bump Docsy to v0.12.0.
  • Pin mermaid to 11.16.0 in hugo.toml.

Verified locally: the site builds and a mermaid block renders. Unblocks upcoming docs that include mermaid diagrams.

@twishabansal twishabansal requested a review from a team as a code owner June 29, 2026 07:34

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a local override for Docsy's mermaid.html script to use Hugo's try keyword, resolving compatibility issues with Hugo >= 0.141.0, and updates hugo.toml to specify Mermaid version 11.16.0. The review feedback correctly points out that the try function in Hugo templates always returns a truthy TryResult struct, making the outer else block unreachable, and provides a code suggestion to simplify the error handling.

Comment thread .hugo/layouts/partials/scripts/mermaid.html Outdated
@twishabansal twishabansal marked this pull request as draft June 29, 2026 07:37
@twishabansal twishabansal reopened this Jun 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧨 Preview deployments removed.

Cloudflare Pages environments for pr-3541 have been deleted.

Docsy v0.11.0's scripts/mermaid.html uses Resource.Err, removed in Hugo
0.141.0 and replaced by the try keyword. The repo builds with Hugo
>= 0.146, so any page with a mermaid block fails the build. Docsy v0.12.0
switched the partial to try, so bump to it. Also pin the mermaid version.
@twishabansal twishabansal force-pushed the fix/mermaid-hugo-compat branch from 1d9e3a5 to b19b43e Compare June 29, 2026 07:47
@twishabansal twishabansal changed the title fix(docs): render mermaid diagrams on Hugo 0.141+ fix(docs): upgrade Docsy to v0.12.0 to render mermaid on Hugo 0.141+ Jun 29, 2026
@twishabansal

Copy link
Copy Markdown
Contributor Author

/gemini review

@twishabansal twishabansal added the docs: deploy-preview Label to trigger Github Action docs preview. label Jun 29, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Hugo documentation dependencies, upgrading the Docsy theme (github.com/google/docsy) from v0.11.0 to v0.12.0 and updating the corresponding checksums in go.sum. Additionally, it configures Mermaid diagram support in hugo.toml by specifying version 11.16.0. There are no review comments, and I have no feedback to provide as the changes are straightforward dependency and configuration updates.

@twishabansal twishabansal changed the title fix(docs): upgrade Docsy to v0.12.0 to render mermaid on Hugo 0.141+ fix(docs): upgrade Docsy to v0.12.0 to render mermaid diagrams Jun 29, 2026
@github-actions github-actions Bot removed the docs: deploy-preview Label to trigger Github Action docs preview. label Jun 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Preview Ready!

🔎 View Preview: https://pr-3541.toolbox-docs-6xc.pages.dev

(Note: Subsequent pushes to this PR will automatically update the preview at this same URL)

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.

4 participants