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.
Note

Useful information that users should know, even when skimming content.

GitHub’s five alert types all work:

Tip

Helpful advice for doing things better or more easily.

Important

Key information users need to know to achieve their goal.

Warning

Urgent info that needs immediate user attention to avoid problems.

Caution

Advises about risks or negative outcomes of certain actions.

All 21 types

Abstract

Abstract: This paper discusses the advantages and challenges of microservice architecture.

Caution

Advises about risks or negative outcomes of certain actions.

Code

Code snippet:

function fetchData() {
    return axios.get('/api/data');
}
Conclusion

Conclusion: Based on the analysis above, we’ve decided to implement Docker containerization.

Danger

Danger! Critical security vulnerability detected in the system. Immediate action required.

Error

Error: Unable to connect to database. Please check your connection settings.

Example

Example:

def hello_world():
    print("Hello, World!")
Experiment

Experiment: Testing the impact of new caching strategies on system performance.

Goal

Goal: Reduce service response time by 30% by the end of this quarter.

Idea

Idea: Implement a machine learning-based code quality detection system.

Important

Key information users need to know to achieve their goal.

Info

System status: All services are operating normally. Current uptime: 99.99%.

Memo

Memo: Technical review meeting scheduled for next Tuesday at 2:00 PM.

Note

Useful information that users should know, even when skimming content.

Notification

System notification: Your password will expire in 30 days.

Question

Question: How can we optimize database query performance?

Quote

“Code is like humor. When you have to explain it, it’s bad.” - Cory House

Success

Congratulations! Your code has been successfully deployed to production.

Task

To-do list:

  • Update documentation
  • Deploy new version
Tip

Helpful advice for doing things better or more easily.

Warning

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.
A custom title

Any callout type can take its own title.

Pro tip

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
This paper discusses the advantages of microservice architecture
Ensure all tests pass before merging to main branch
Execute npm install to install all dependencies
We’ve decided to implement Docker containerization
Critical security vulnerability detected in the system
Error: Unable to connect to database. Please check your connection settings
Git commit message format: “feat: add user authentication”
Testing new caching strategy with Redis
Reduce service response time by 30% by the end of this quarter
Implement a machine learning-based code quality detection system
Please review and update your security settings
Current system status: All services are operating normally with 99.9% uptime
Technical review meeting scheduled for next Tuesday at 2:00 PM
Always backup your data before performing system updates
System notification: Your password will expire in 30 days
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
Review and update API documentation by Friday
Use Ctrl + C to quickly terminate a running program
Warning: This operation will delete all data

Headless

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/users is used to fetch the user list.
  • Authentication: A valid Bearer token 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.
Can admonitions be nested?
Yes, they can.
You can even use multiple layers of nesting.

Obsidian aliases

Obsidian’s alias names render as their canonical type:

> [!TLDR]
> Renders as ABSTRACT.
Abstract

TLDR renders as ABSTRACT.

Task

TODO renders as TASK.

Error

BUG renders as ERROR.

Question

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.
Note

This renders as a NOTE.