hugo icon indicating copy to clipboard operation
hugo copied to clipboard

Support for Manually Defining GitHub Alert Types

Open jakeprice-me opened this issue 1 year ago • 1 comments

I've been trying out the new GitHub style alerts from #12590. Following the new documentation the alerts work great, thanks to @bep and @jmooring.

I have however noticed that the alert type's seem to be hardcoded to only accept a few preset types (the five mentioned in GitHub's alerts documentation) - which makes sense because this ticket was for exactly that!

It would be quite helpful if we could define additional alert types. I use Obsidian and this change is great because Obsidian does alerts the same way as GitHub, but supports a few more alert types, see here for the list (stuff like info, danger etc).

Would @bep consider adding functionality to allow the user to manually define their own alert types in config.yml?

jakeprice-me avatar Aug 27 '24 17:08 jakeprice-me

This is the regexp in question:

(?i)^<p>\[!(NOTE|TIP|WARNING|IMPORTANT|CAUTION)\]

We HTML context here is the start of a blockquote in a render hook, so I suspect it would be more than specific enough if we made it slightly less specific...

/cc @jmooring

bep avatar Aug 27 '24 17:08 bep

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Sep 23 '24 02:09 github-actions[bot]