-
Notifications
You must be signed in to change notification settings - Fork 121
Add a template for blockquote alerts (aka callouts) #2977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
New Issues (2)Checkmarx found the following issues in this Pull Request
|
|
To address the DCO requirement you'll need to sign-off the commit(s): |
b861228 to
6fe81f8
Compare
Signed-off-by: chibbyalucard <[email protected]>
Signed-off-by: chibbyalucard <[email protected]>
6fe81f8 to
8bab1f4
Compare
|
Leaving a comment about force-pushed changes. I added the sign-off trailer. |
|
@Wryhder thanks! Do you have instructions for a quick way to try this out? Or is that in your other PR? |
|
@psiinon My bad! I should probably include this info in the README? These examples are straight from the Hugo docs, in case the formatting below is wonky (I'm on mobile): |
|
Thanks! Will try them out now 😁 |
| @@ -0,0 +1,28 @@ | |||
| {{ $emojis := dict | |||
| "caution" ":exclamation:" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about these, so we dont get 3x info source?
"caution" ":bangbang:"
"important" ":information_source:"
"note" ":page_facing_up:"
"tip" ":bulb:"
"warning" ":warning:"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I figured there must be something better 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, thanks! I'll add those in a bit.
Signed-off-by: chibbyalucard <[email protected]>
Signed-off-by: chibbyalucard <[email protected]>
psiinon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this. Now we just need to work out all the existing pages we should update to use it :D
Signed-off-by: Rick M <[email protected]>
| } | ||
|
|
||
| /* Styles for blockquote alerts, aka admonitions or callouts */ | ||
| // Source: https://github.com/KKKZOZ/hugo-admonitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason not to use the module instead of c/p?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not especially. There are several more types of callouts in the module and definitely more robust styling. However, I was just looking to add the most basic types.
Note that the template itself is from an example in the Hugo docs (only a couple of lines changed). It's just the CSS I copied from the module (one line changed).
Do you suggest adding the module directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kingthorin I replied @thc202 earlier. My comment is supposed to be up there just before yours, although I added it using the mobile app. Maybe that's why it's not showing up? Anyway, here it is again:
Not especially. There are several more types of callouts in the module and definitely more robust styling. However, I was just looking to add the most basic types.
Note that the template itself is from an example in the Hugo docs (only a couple of lines changed). It's just the CSS I copied from the module (one line changed).
Do you suggest adding the module directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be preferable than duplicate functionality IMHO.
@psiinon I'm gonna create a new PR for that. But I was thinking of modifying just the docs, not existing articles. What needs to be highlighted will probably be obvious in some of the articles, but I was thinking there's a risk of highlighting wrongly in articles where I don't have adequate context. I'll take a look at the articles regardless, but please let me know what you think. |
|
Worth noting that 90% of the docs are generated from the help content. |
|
@kingthorin @thc202 Can you see my response above to your question about using the hugo-admonition module? Just in case not:
|
|
No, is it as a pending comment? |
| {{ $emojis := dict | ||
| "caution" ":bangbang:" | ||
| "important" ":information_source:" | ||
| "note" ":memo:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@psiinon I changed the emoji for "note" from 📄 to 📝. I was thinking the latter looks more colourful and is more noticeable (matches the other icons better, I think).
| } | ||
|
|
||
| /* Styles for blockquote alerts, aka admonitions or callouts */ | ||
| // Source: https://github.com/KKKZOZ/hugo-admonitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not especially. There are several more types of callouts in the module and definitely more robust styling. However, I was just looking to add the most basic types.
Note that the template itself is from an example in the Hugo docs (only a couple of lines changed). It's just the CSS I copied from the module (one line changed).
Do you suggest adding the module directly?
| } | ||
|
|
||
| /* Styles for blockquote alerts, aka admonitions or callouts */ | ||
| // Source: https://github.com/KKKZOZ/hugo-admonitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kingthorin I replied @thc202 earlier. My comment is supposed to be up there just before yours, although I added it using the mobile app. Maybe that's why it's not showing up? Anyway, here it is again:
Not especially. There are several more types of callouts in the module and definitely more robust styling. However, I was just looking to add the most basic types.
Note that the template itself is from an example in the Hugo docs (only a couple of lines changed). It's just the CSS I copied from the module (one line changed).
Do you suggest adding the module directly?
Yes, I thought "Pending" meant you were reviewing it. Didn't realize I hadn't actually submitted my comments. |
|
@kingthorin @psiinon Regarding PR #3042, perhaps a shortcode would work better for both HTML and Markdown files. Usage syntax would look something like this (see the Adding Custom Alerts section in this article): (Although I really liked the simplicity of the current syntax.) What do you think? I can update this branch when I get a chance. |





Proposed changes
Add a template for alerts (aka callouts or admonitions).
Alerts are useful for highlighting important information or including contextual warnings or tips that might get skipped over otherwise in long pieces of content.
@kingthorin @psiinon I separated out the alert template mentioned in the other PR (#2976) to this one.
Please let me know if there are any changes you'd like me to make. Thanks for your time and help with this.