Hugo Admonitions
Beautiful callouts for Hugo, written in plain Markdown.
Every callout on this page is plain Markdown, rendered by hugo-admonitions. Use the theme toggle in the header to check both color schemes.
Basics
The syntax is the same as GitHub and Obsidian alerts:
> [!NOTE]
> Useful information that users should know, even when skimming content.
Useful information that users should know, even when skimming content.
GitHub’s five alert types all work:
Helpful advice for doing things better or more easily.
Key information users need to know to achieve their goal.
Urgent info that needs immediate user attention to avoid problems.
Advises about risks or negative outcomes of certain actions.
All 21 types
Abstract: This paper discusses the advantages and challenges of microservice architecture.
Advises about risks or negative outcomes of certain actions.
Code snippet:
function fetchData() {
return axios.get('/api/data');
}
Conclusion: Based on the analysis above, we’ve decided to implement Docker containerization.
Danger! Critical security vulnerability detected in the system. Immediate action required.
Error: Unable to connect to database. Please check your connection settings.
Example:
def hello_world():
print("Hello, World!")
Experiment: Testing the impact of new caching strategies on system performance.
Goal: Reduce service response time by 30% by the end of this quarter.
Idea: Implement a machine learning-based code quality detection system.
Key information users need to know to achieve their goal.
System status: All services are operating normally. Current uptime: 99.99%.
Memo: Technical review meeting scheduled for next Tuesday at 2:00 PM.
Useful information that users should know, even when skimming content.
System notification: Your password will expire in 30 days.
Question: How can we optimize database query performance?
“Code is like humor. When you have to explain it, it’s bad.” - Cory House
Congratulations! Your code has been successfully deployed to production.
To-do list:
- Update documentation
- Deploy new version
Helpful advice for doing things better or more easily.
Urgent info that needs immediate user attention to avoid problems.
Custom titles
Put any text after the type:
> [!IDEA] A custom title
> Any callout type can take its own title.
Any callout type can take its own title.
Run hugo server -D to preview drafts while you write.
Header only
Leave out the body for a compact, single-line callout:
> [!SUCCESS] Congratulations! Your code has been successfully deployed to production
npm install to install all dependenciesCtrl + C to quickly terminate a running programHeadless
Set an empty title (double or single quotes) to show only the body:
> [!TIP] ""
> This is a body-only callout without a header.
This is a body-only callout without a header.
You can still use any callout type, but the header will be hidden.
Foldable
Add - (starts collapsed) or + (starts expanded) after the type:
> [!NOTE]- Here are the details regarding API usage
> [!TIP]+ This one starts expanded
Here are the details regarding API usage
- Endpoint:
/api/v1/usersis used to fetch the user list. - Authentication: A valid
Bearertoken must be provided in the request header. - Rate Limiting: 100 requests are allowed per minute.
This one starts expanded
Click the header to fold it away.
Nested
> [!QUESTION] Can admonitions be nested?
> > [!TIP] Yes, they can.
> > > [!EXAMPLE] You can even use multiple layers of nesting.
Obsidian aliases
Obsidian’s alias names render as their canonical type:
> [!TLDR]
> Renders as ABSTRACT.
TLDR renders as ABSTRACT.
TODO renders as TASK.
BUG renders as ERROR.
FAQ renders as QUESTION.
Unknown types
Unsupported types fall back to NOTE, so a typo never breaks your build:
> [!NOSUPPORT]
> This renders as a NOTE.
This renders as a NOTE.