Note: You need to run Hugo ⩾ 0.81.
1. Enable Markdown Attributes:#
In config.toml
[markup.goldmark.parser.attribute]
block = true
title = true
or in config.yml
markup:
goldmark:
parser:
attribute:
block: true
title: true
2. Add custom CSS#
See the theme’s documentation
3. Usage#
Add a single class:#

{.custom-css-class}
Add multiples classes:#

{.myclass class="custom-css-class1 custom-class2"}
Références#
- https://gohugo.io/getting-started/configuration-markup#goldmark
- https://github.com/yuin/goldmark/#built-in-extensions