Hello, I use the Org mode format for markup, and I don’t think I can use the admonition feature that was added in newer versions of Hugo. I noticed there’s also hugo-notice, which isn’t bad but offers more than I need. I decided to create a simple shortcode that looks like this, inspired from hugo-notice:
I only need these three admonitions, icons are not necessary, and there’s no need for i18n translation of titles. What do you suggest. Should I go with my custom shortcode then?
I’m not sure if I did things right in the shortcode as I’m not very familiar with the Hugo syntax. I would be grateful for any feedback, especially about these two lines:
Although I can’t envision a need to “chomp” the text between the opening an closing shortcode tags, if you chomp you should chomp before passing .Inner to markdownify.
Also, there’s no need to initialize a $raw variable.
Thank you. I changed the term ‘admonition’ to ‘callout’ because ‘admonition’ sounds too formal and more like a warning than just an information box. I could be wrong, though.
I’m using the upper function to make all letters uppercase, which I could also do with CSS using text-transform. But since Hugo supports capitalization, I thought, why not use it?
I’ve noticed there are two ways to use the upper function: one is by piping the result into the upper function, and the other is by placing upper before the text output.