News
NEWeSAR for NBA Accreditation of Electronics & Communication Engineering Department Submitted to NBA – View Document(27 Feb 2026)NEWAdmissions Open for Academic Year 2026-27 – Apply Now via ACPDC Portal(1 Feb 2026)NEWGTU Winter Examination 2025 – Revised Timetable Published(25 Jan 2026)NEWGuest Faculty Recruitment 2026 – Applications Invited for Engineering Departments(20 Jan 2026)SSIP Grant 2025-26 – Submit Your Innovation Proposals by 28 February 2026(15 Jan 2026)Annual Technical Fest "INNOVATE 2026" – Registration Open for All Events(10 Jan 2026)GTU Semester 3 Examination Results Declared – Check Results on GTU Portal(5 Jan 2026)Library: 250+ New Technical Books Added – Available for Borrowing from 1 Feb 2026(2 Jan 2026)Holiday List for Year 2026 Published – View Official Calendar(1 Jan 2026)NEW(27 Feb 2026)NEW(1 Feb 2026)NEW(25 Jan 2026)NEW(20 Jan 2026)(15 Jan 2026)(10 Jan 2026)GTU Semester 3 Examination Results Declared – Check Results on GTU Portal(5 Jan 2026)(2 Jan 2026)(1 Jan 2026)

Mermaid Diagrams in Hugo

March 3, 2025
2 min read

This post demonstrates how to use Mermaid diagrams in Hugo. Mermaid lets you create diagrams and visualizations using text and code.

Flowchart Example

graph LR; A[Lemons]-->B[Lemonade]; B-->C[Profit] {{< /mermaid >}}
flowchart LR
    A[Start] --> B{Is it?}
    B -- Yes --> C[OK]
    C --> D[Rethink]
    D --> B
    B -- No --> E[End]

Sequence Diagram Example

sequenceDiagram
    participant Alice
    participant Bob
    Alice->>John: Hello John, how are you?
    loop Healthcheck
        John->>John: Fight against hypochondria
    end
    Note right of John: Rational thoughts<br/>prevail...
    John-->>Alice: Great!
    John->>Bob: How about you?
    Bob-->>John: Jolly good!

Class Diagram Example

classDiagram
    Animal <|-- Duck
    Animal <|-- Fish
    Animal <|-- Zebra
    Animal : +int age
    Animal : +String gender
    Animal: +isMammal()
    Animal: +mate()
    class Duck{
      +String beakColor
      +swim()
      +quack()
    }
    class Fish{
      -int sizeInFeet
      -canEat()
    }
    class Zebra{
      +bool is_wild
      +run()
    }

Gantt Chart Example

gantt
    title A Gantt Diagram
    dateFormat  YYYY-MM-DD
    section Section
    A task           :a1, 2025-03-01, 30d
    Another task     :after a1, 20d
    section Another
    Task in sec      :2025-03-12, 12d
    another task     :24d

State Diagram

stateDiagram-v2
    [*] --> Still
    Still --> [*]
    Still --> Moving
    Moving --> Still
    Moving --> Crash
    Crash --> [*]

Pie Chart

pie
    title What kind of diagrams do you prefer?
    "ASCII Art" : 40
    "Mermaid" : 35
    "Other Tools" : 25

Git Graph

gitGraph
    commit
    commit
    branch develop
    checkout develop
    commit
    commit
    checkout main
    merge develop
    commit
    commit

Entity Relationship Diagram

erDiagram
    CUSTOMER ||--o{ ORDER : places
    ORDER ||--|{ LINE-ITEM : contains
    CUSTOMER }|..|{ DELIVERY-ADDRESS : uses

Related Posts

Mixed Diagram Test

June 17, 2025

# Mixed Diagram Test This page tests both mermaid and goat diagrams to ensure they render correctly. ## Mermaid Flowchart [Mermaid Diagram] ## Go...

test
mermaid
goat
+1
Shortcodes

Shortcodes

October 25, 2026

In addition to all the [default Hugo shortcodes](https://gohugo.io/content-management/shortcodes/), Blowfish adds a few extras for additional functio...

shortcodes
mermaid
icon
+2

Markdown Syntax Guide

March 11, 2019

This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated...

markdown
css
html
+1