I wanted to share a little project I’ve been working on - hugo-admonitions. It’s a Hugo module that helps you create beautiful admonition/callout blocks in your content using simple markdown syntax.
Key Features:
Multiple predefined types: note, info, warning, etc.
Built-in color themes that match your site’s style
Thank you so much for your detailed feedback! I really appreciate you taking the time to point out these important issues. I will fix these problems as soon as possible, especially moving the styles to an external stylesheet for better compatibility.
By the way, I’m curious about the validation you mentioned - which validation system or standard were you referring to? This will help me ensure the fixes meet the right requirements.
Thanks again for helping improve the code quality!
Search for HTML validator. The W3C’s one should be one of the first hits. They also offer CSS validation, though that’s something your browser’s developer tools does, too.
The AlertType is already lowercase… no need to convert it again
Use render-blockquote-alert.html instead of render-blockquote.html to reduce chance of template overrides
Internationalize (use T function and create at least one i18n file)
Support portable[1] Markdown by adding alert types note, important, and caution
Do some error checking/recovery with templates.Exists to prevent dead-ends such as:
ERROR Rebuild failed: render: failed to render pages: render of “home” failed: “/home/jmooring/code/hugo-testing/layouts/_default/home.html:11:5”: execute of template failed at <.Content>: error calling Content: “/home/jmooring/code/hugo-testing/content/_index.md:11:3”: “/home/jmooring/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!k!k!k!z!o!z/hugo-admonitions@v0.1.0/layouts/_default/_markup/render-blockquote.html:20:11”: execute of template failed at <partial (printf “icons/%!s(MISSING).svg” $type) .>: error calling partial: partial “icons/note.svg” not found
In the above, your GitHub user name is represented as k!k!k!z!o!z because your GitHub user name contains capital letters. This is undesirable but expected. See Go documentation.
Initialize as a Go module, use semver tags, and create releases. That will allow users to do this:
Thank you so much for your detailed suggestions! I really appreciate you taking the time to help improve hugo-admonitions. I’m happy to let you know that I’ve implemented all the changes you recommended:
Major improvements include:
Switched to using Store method instead of Scratch
Renamed to render-blockquote-alert.html for better template handling
Added internationalization support with i18n files
Included new alert types: note, important, and caution
Implemented error checking using templates.Exists for icon files
Initialized as a Go module with proper versioning
Your suggestions have significantly improved the module’s reliability and user experience. Thanks again for taking the time to provide such comprehensive feedback!
git clone --single-branch -b hugo-forum-topic-52576 https://github.com/jmooring/hugo-testing hugo-forum-topic-52576
cd hugo-forum-topic-52576
hugo server