janraasch / hugo-bearblog

🧸 A Hugo theme based on »Bear Blog«. Free, no-nonsense, super-fast blogging. This theme now includes a dark color scheme to support dark mode 🦉 ⬛️!
https://themes.gohugo.io/hugo-bearblog/
MIT License
887 stars 218 forks source link

Add Support for Mermaid.js Diagrams #83

Closed cbrgm closed 8 months ago

cbrgm commented 9 months ago

Feature Request: Mermaid.js Support

Integrate Mermaid.js for enhanced diagramming capabilities within blog posts.

What + Why:

janraasch commented 8 months ago

Hi @cbrgm,

thank you for opening this (detailed & neatly organised!!!) issue🧤. Nice to meet you 😁.

I have not used Mermaid myself, but it does look cool. It definitely seems useful for technical bloggers & educators!

I did some quick duckduckgo-🦆-ing on using mermaid.js with hugo. Here's what I found. This post

https://robb.sh/posts/how-to-use-mermaid-diagrams-in-hugo/

has a quick & easy way to get you setup.

If you run into problems or have further questions there's also a discussion on the main Hugo discourse platform https://discourse.gohugo.io/t/correct-way-to-embed-mermaid-js/43491 about how to best embed Mermaid on Hugo.

I am not sure, if we'd want to add an integration to this particular theme. It seems like this is more of a general issue. In fact once you have a working shortcut, you could ship that as an (independent) Hugo module.

I hope that helps.

Kind regards 👋, Jan

cbrgm commented 8 months ago

Hi @janraasch ,

Thanks for the swift and helpful response!

Mermaid integration looks straightforward with your guidance. I'll explore the links you provided, especially the setup guide and the Hugo forum discussion for any advanced embedding options.

Regarding theme integration, your point about creating a Hugo module makes a lot of sense. It could streamline the process for others facing the same issue.

And what a small world – I'm located in Hamburg! Great to connect with a "neighbor" in this context. 😁

Best, @cbrgm