For a while now I have been looking on a way to highlight some blocks of texts.
But I also wanted to prevent injecting html or tyling code into my markdown files.
While looking in Hugo website I have found out there was a way to customize blockquotes to achieve what I was looking for. Here is how I solved my requirement.
This is a normal quote
ℹ️
Note
This is a note type quote.
💡
Tip
This is a tip type quote.
❗
Important
This is an important type quote.
The Render Hook
Create a the render hook in /layouts/_defaults/_markup, and name it render-blockquote-alert.html.
To add new types, simply add anew type in the collection at the top. The corresponding code for the Icon can be found in the reference list of emojis provided by Hugo (see references).
The use of classes will give us the opportunity to customize the different blockquotes.
Styling
We need to add the styling in a css file, if it is a new one don’t forget to add the style import in the header of the page.