Strawberry.Tools

  • News
  • Docs
  • Themes
  • Community
  • GitHub
StrawberryTools Star
  • About
    • In this section
    • Introduction
    • Features
    • Privacy
    • Security
    • License
  • Installation
    • In this section
    • Linux
    • macOS
    • Windows
  • Getting started
    • In this section
    • Quick start
    • Basic usage
    • Directory structure
    • Configuration
    • Configure markup
    • Glossary of terms
    • External learning resources
  • Quick reference
    • In this section
    • Emojis
    • Functions
    • Methods
    • Page collections
  • Content management
    • In this section
    • Organization
    • Page bundles
    • Content formats
    • Front matter
    • Build options
    • Page resources
    • Image processing
    • Shortcodes
    • Related content
    • Sections
    • Content types
    • Archetypes
    • Taxonomies
    • Summaries
    • Links and cross references
    • URL management
    • Menus
    • Static files
    • Table of contents
    • Comments
    • Multilingual
    • Markdown attributes
    • Syntax highlighting
    • Diagrams
    • Mathematics
  • Templates
    • In this section
    • Introduction
    • Template lookup order
    • Base templates and blocks
    • Single page templates
    • List templates
    • Homepage template
    • Section templates
    • Taxonomy templates
    • Pagination
    • Content view templates
    • Partial templates
    • Shortcode templates
    • Menu templates
    • Data templates
    • RSS templates
    • Sitemap templates
    • Embedded templates
    • Custom output formats
    • 404 page
    • Robots.txt
  • Functions
    • In this section
    • cast
    • collections
    • compare
    • crypto
    • data
    • debug
    • diagrams
    • encoding
    • fmt
    • global
    • go template
    • hugo
    • images
    • inflect
    • js
    • lang
    • math
    • openapi3
    • os
    • partials
    • path
    • reflect
    • resources
    • safe
    • strings
    • templates
    • time
    • transform
    • urls
  • Methods
    • In this section
    • Duration
    • Menu
    • Menu entry
    • Page
    • Pages
    • Resource
    • Shortcode
    • Site
    • Taxonomy
    • Time
  • Render hooks
    • In this section
    • Introduction
    • Code blocks
    • Headings
    • Images
    • Links
  • Hugo Modules
    • In this section
    • Configure Hugo modules
    • Use Hugo Modules
    • Theme components
  • Hugo Pipes
    • In this section
    • Introduction
    • Transpile Sass to CSS
    • PostCSS
    • PostProcess
    • JavaScript building
    • Babel
    • Asset minification
    • Concatenating assets
    • Fingerprinting and SRI hashing
    • Resource from string
    • Resource from template
  • CLI
  • Troubleshooting
    • In this section
    • Audit
    • Logging
    • Inspection
    • Deprecation
    • Performance
    • FAQs
  • Developer tools
    • In this section
    • Editor plugins
    • Front-ends
    • Search
    • Migrations
    • Other projects
  • Hosting and deployment
    • In this section
    • Hugo Deploy
    • Deploy with Rclone
    • Deploy with Rsync
    • Host on 21YunBox
    • Host on AWS Amplify
    • Host on Azure Static Web Apps
    • Host on Cloudflare Pages
    • Host on Firebase
    • Host on GitHub Pages
    • Host on GitLab Pages
    • Host on KeyCDN
    • Host on Netlify
    • Host on Render
  • Contribute
    • In this section
    • Development
    • Documentation
    • Themes
  • Maintenance
CONTENT MANAGEMENT

Diagrams

Use fenced code blocks and Markdown render hooks to include diagrams in your content.

GoAT diagrams (ASCII)

Hugo natively supports GoAT diagrams with an embedded code block render hook. This means that this code block:

```goat
      .               .                .               .--- 1          .-- 1     / 1
     / \              |                |           .---+            .-+         +
    /   \         .---+---.         .--+--.        |   '--- 2      |   '-- 2   / \ 2
   +     +        |       |        |       |    ---+            ---+          +
  / \   / \     .-+-.   .-+-.     .+.     .+.      |   .--- 3      |   .-- 3   \ / 3
 /   \ /   \    |   |   |   |    |   |   |   |     '---+            '-+         +
 1   2 3   4    1   2   3   4    1   2   3   4         '--- 4          '-- 4     \ 4

```

Will be rendered as:

1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

Mermaid diagrams

Hugo does not provide a built-in template for Mermaid diagrams. Create your own using a code block render hook:

layouts/_default/_markup/render-codeblock-mermaid.html
<pre class="mermaid">
  {{- .Inner | safeHTML }}
</pre>
{{ .Page.Store.Set "hasMermaid" true }}

And then include this snippet at the bottom of the content template:

{{ if .Store.Get "hasMermaid" }}
  <script type="module">
    import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
    mermaid.initialize({ startOnLoad: true });
  </script>
{{ end }}

With that you can use the mermaid language in Markdown code blocks:

```mermaid
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!
```

Goat ASCII diagram examples

Graphics

1 5 0 4 2 6 3 7 + z + y + x v 1 v P 0 X v 3 E y v e 2 R e f r a c t i o n R e f l e c t i o n

Complex

& A M S i o i q f b B x u j o e a ( - x d r a > e f R > c o C n u o b ( n r ) ) d n e e J d r o s i n N o R D t o i u a a n g d d l o i t n e D i a g o n a l s C V u e r r v t e i d c a l n o t A N C : o u l d r r i A a / I v n s i n e e h s t d - e - t r l B i h i i s i o n ' s r e q n . u * o o b t t o e l a s d ' * l i n e D o n S e e ? a r c 3 h

Process

P S I R T N O A P C R U E T T S S E N D A C P H R O O I C C E E S S B C P O R M O X P C L E E S X S P R E P A R A T I O N X

File tree

Created from https://arthursonzogni.com/Diagon/#Tree

─ ─ ─ L i n u x ─ ┬ ├ │ │ │ │ ├ └ ─ ─ ─ ─ A D C F n e e e d b n d r i t o o a o r i n s a d ─ ┬ │ │ │ └ ─ ─ U M b i u n n t t u ─ ┬ ├ ├ └ ─ ─ ─ ─ L K X X u u u u b b b b u u u u n n n n t t t t u u u u

Sequence diagram

https://arthursonzogni.com/Diagon/#Sequence

┌ │ └ ┌ │ └ ─ A ─ ─ A ─ ─ l ─ ─ l ─ ─ i ┬ │ │ │ │ │ │ ┴ i ─ ─ c ─ ─ H < ─ c ─ ─ e ─ H ─ e ─ ─ e ─ ┐ │ ┘ e ─ l ─ ┐ │ ┘ l ─ l ─ l ─ o ─ o ─ ─ ─ A ─ B ─ l ─ o ─ i ─ b ─ c ─ ┌ │ └ ! ─ e ─ ┌ │ └ ─ B ─ > ! ─ ─ B ─ ─ o ┬ │ │ │ │ │ │ ┴ o ─ ─ b ─ ─ b ─ ┐ │ ┘ ┐ │ ┘

Flowchart

https://arthursonzogni.com/Diagon/#Flowchart

O L _ D F _ K I _ B O _ O L _ A N _ U N _ O _ Y E _ T E _ ┌ │ └ Y W _ , _ S _ ─ I ─ O _ L _ Y _ ┌ │ └ ─ ─ U C _ Y A _ O L _ ─ L ─ ─ H ─ H _ O B _ U A _ ─ I ─ ─ A ─ U A _ _ U E _ _ B _ ─ S ─ ─ T ─ N R _ │ ▽ L _ │ ▽ S E _ │ ▽ T ┬ ▽ E ─ D T _ n _ S E _ n _ E L _ n ─ E ─ ─ ─ E S _ o _ E D _ o _ E E _ o ─ N ─ ─ Y ─ R ? _ _ E _ _ D _ ─ . ─ ─ O ─ S _ _ ' _ _ T _ ┐ │ ┘ ─ U ─ T _ _ T Y _ _ H ' _ ┐ │ ┘ A _ _ H E _ _ E N _ N _ _ E S _ _ O _ D _ _ ' _ _ ' _ _ ? _ _ ? _ _ y _ e _ y _ y _ s _ e _ e _ _ s _ s _ _ ┌ │ └ _ _ ─ W ─ _ _ ─ A ─ _ _ ─ I ─ _ _ ─ T ─ _ _ ─ , ─ _ _ ─ ─ _ _ ─ W ─ _ _ ─ H ─ _ _ ─ A ─ _ _ ─ T ─ _ _ ─ ? ─ _ _ ┐ │ ┘ _ _ _ T _ _ H _ B F _ _ E _ U O _ _ _ T L _ _ A O _ L _ _ N N _ Y O _ _ D E _ O W _ _ S _ U E _ _ Y _ D _ _ O L _ _ J _ _ U A _ │ ▽ U T _ │ │ └ _ B _ n _ S H _ n ─ ┌ │ │ └ _ C E _ o _ T E _ o ─ ─ ( A ─ _ A L _ _ M _ ─ ─ T ─ ┌ │ └ _ N E _ _ _ ─ ─ H Q ─ ─ S ─ _ D _ _ T _ ─ ─ A U ─ ─ C ─ _ S _ _ W _ ─ ─ T E ─ ─ R ─ _ E ' _ _ I _ ─ ─ S ─ ─ E ─ _ E N _ _ C _ ┬ ▽ W T ┬ ▽ W ┬ └ _ O _ _ E _ ─ ─ A I ─ ─ ─ ─ _ ' _ _ ? _ ─ ─ S O ─ ─ I ─ ─ ┌ │ │ └ _ ? _ ─ ─ N N ─ ─ T ─ ─ ─ H I ─ _ ─ ─ ' ) ─ ┐ │ ┘ ─ ┌ │ └ ─ E N ─ _ _ y ─ ─ T ─ ─ ─ L ─ ─ Y S ─ _ _ y _ e ─ ┐ │ │ ┘ ┬ │ └ ─ E ─ ─ , T ─ _ _ e _ s ─ ─ ─ ─ T ─ ─ A ─ _ _ s │ │ │ │ ┘ ─ ─ ─ ' ─ ─ I L ─ _ ┌ │ └ ─ ─ ─ S ─ ─ L ─ _ ─ G ─ ─ ─ ─ ─ ─ S I ─ _ ─ O ─ ─ ─ ─ G ─ ─ H N ─ _ ─ O ┬ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ┘ ┬ ▽ O ┬ ▽ O G ─ _ ─ D ─ ─ ─ ─ ─ U ─ _ ┐ │ ┘ ─ ─ D ─ ─ L F ─ ┌ │ └ ─ ─ R ─ ─ D R ─ ─ G ─ ─ ─ I ─ ─ E ─ ─ O ─ ─ ─ N ─ ─ T E ─ ─ O ┬ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ┘ ─ G ─ ─ R B ─ ─ D ─ ┐ │ ┘ ─ Y S ─ ─ ! ─ ─ D ─ ┐ │ ┘ ─ ! ─ ┐ │ │ ┘

Table

https://arthursonzogni.com/Diagon/#Table

┌ │ ├ │ ├ │ ├ │ ├ │ ├ │ ├ │ ├ │ ├ │ ├ │ ├ │ ├ │ └ ─ ─ S ─ P ─ E ─ T ─ F ─ ─ ─ ─ ─ I ─ L ─ ─ ─ Y ─ R ─ X ─ E ─ A ─ ─ ─ ─ ─ D ─ I ─ ─ ─ N ─ O ─ P ─ R ─ C ─ ─ ─ ─ ─ E ─ T ─ ─ ─ T ─ D ─ R ─ M ─ T ─ ─ ─ ─ ─ N ─ E ─ ─ ─ A ─ U ─ E ─ ─ O ─ ─ ─ ─ ─ T ─ R ─ ─ ─ X ─ C ─ S ─ ─ R ─ ─ ─ ─ ─ I ─ A ─ ─ ─ ─ T ─ S ─ ─ ─ ─ ─ ─ ─ F ─ L ─ ─ ─ ─ I ─ I ─ ─ ─ ─ ─ ─ ─ I ─ ─ ─ ─ ─ O ─ O ─ ─ ─ ─ ─ ─ ─ E ─ ─ ─ ─ ─ N ─ N ─ ─ ─ ─ ─ ─ ─ R ─ ─ ─ ─ ─ ─ ─ ─ ─ | ─ | ─ | ─ | ─ ─ ─ ─ ─ = ─ = ─ = ─ = ─ = ─ ─ ─ ─ ─ = ─ = ─ ─ ─ ─ ─ ─ ─ ─ L ─ " ─ " ─ " ─ ─ ─ ─ ─ { ─ I ─ T ─ F ─ I ─ I ─ [ ─ ( ─ { ─ l ─ " ─ ─ ─ ─ D ─ E ─ A ─ D ─ T ─ " ─ " ─ " ─ e ─ " ─ ─ ─ P ─ E ─ R ─ C ─ E ─ E ─ ─ ─ ─ t ─ " ─ ─ ─ R ─ N ─ M ─ T ─ N ─ R ─ E ─ E ─ E ─ t ─ " ─ ─ ─ O ─ T ─ ─ O ─ T ─ A ─ X ─ X ─ X ─ e ─ ─ ─ ─ D ─ I ─ { ─ R ─ I ─ L ─ P ─ P ─ P ─ r ─ c ─ ─ ─ U ─ F ─ ─ ─ F ─ ─ R ─ R ─ R ─ ─ h ─ ─ ─ C ─ I ─ " ─ { ─ I ─ ─ E ─ E ─ E ─ { ─ a ─ ─ ─ T ─ E ─ | ─ ─ E ─ ─ S ─ S ─ S ─ ─ r ─ ─ ─ I ─ R ─ " ─ F ─ R ─ ─ S ─ S ─ S ─ l ─ a ─ ─ ─ O ─ ─ ─ A ─ ─ ─ I ─ I ─ I ─ e ─ c ─ ─ ─ N ─ " ─ T ─ C ─ ─ ─ O ─ O ─ O ─ t ─ t ─ ─ ─ ─ = ─ E ─ T ─ ─ ─ N ─ N ─ N ─ t ─ e ─ ─ ─ } ─ " ─ R ─ O ─ ─ ─ ─ ─ ─ e ─ r ─ ─ ─ ─ ─ M ─ R ─ ─ ─ " ─ " ─ " ─ r ─ ─ ─ ─ . ─ E ─ ─ ─ ─ ─ ] ─ ) ─ } ─ ─ { ─ ─ ─ ─ X ─ } ─ } ─ ─ ─ " ─ " ─ " ─ } ─ ─ ─ ─ ─ P ─ ─ ─ ─ ─ ─ ─ ─ ─ c ─ ─ ─ ─ R ─ . ─ . ─ ─ ─ ─ ─ . ─ . ─ h ─ ─ ─ ─ E ─ ─ ─ ─ ─ ─ ─ ─ ─ a ─ ─ ─ ─ S ─ ─ ─ ─ ─ ─ ─ ─ ─ r ─ ─ ─ ─ S ─ ─ ─ ─ ─ ─ ─ ─ ─ a ─ ─ ─ ─ I ─ ─ ─ ─ ─ ─ ─ ─ ─ c ─ ─ ─ ─ O ─ ─ ─ ─ ─ ─ ─ ─ ─ t ─ ─ ─ ─ N ─ ─ ─ ─ ─ ─ ─ ─ ─ e ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ r ─ ─ ─ ─ " ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ . ─ ─ ─ ─ ─ ─ ─ ─ ─ } ─ ─ ─ ─ " ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ " ─ ─ ─ ─ . ─ ─ ─ ─ ─ ─ ─ ─ ─ " ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ " ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ " ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ . ─ ┐ │ ┤ │ ┤ │ ┤ │ ┤ │ ┤ │ ┤ │ ┤ │ ┤ │ ┤ │ ┤ │ ┤ │ ┘

See also

  • Image processing

On this page

  • GoAT diagrams (ASCII)
  • Mermaid diagrams
  • Goat ASCII diagram examples
Last updated: May 12, 2024: docs: Update Installation pages (#3) (4c124c6)
Improve this page
By the Hugo Authors
Hugo Logo
  • File an Issue
  • Get Help
  • @GoHugoIO
  • @spf13
  • @bepsays
 

Hugo Sponsors

 

The Hugo logos are copyright © Steve Francia 2013–2024.

The Hugo Gopher is based on an original work by Renée French.

  • News
  • Docs
  • Themes
  • Community
  • GitHub
  • About
  • Installation
  • Getting started
  • Quick reference
  • Content management
  • Templates
  • Functions
  • Methods
  • Render hooks
  • Hugo Modules
  • Hugo Pipes
  • CLI
  • Troubleshooting
  • Developer tools
  • Hosting and deployment
  • Contribute
  • Maintenance