Callouts
> [!NOTE] blockquotes without shortcodes.A callout lifts out the one thing a reader must not miss: a prerequisite, a
destructive command, a version limit. It is an ordinary blockquote whose first
line is a [!TYPE] marker, the syntax GitHub and Obsidian use, so the same
source renders as an alert on GitHub and as a plain quote in any other Markdown
reader.
Use them sparingly. When every other paragraph sits in a box, readers stop seeing the boxes, so if a sentence of prose does the job, write the sentence.
Shortest form
Hugo Modules need Go on the machine; an offline archive does not.
Without a title, the callout shows its type name in the page’s language: “Note” in English, 「说明」 in Chinese.
Ten types
GitHub defines the first five types and OINK adds five more; each has its own
icon and color, and type names are case-insensitive. Choose the type by what
happens when the reader skips the box: NOTE and TIP are safe to skip,
IMPORTANT means the task fails without it, WARNING and CAUTION mean
something breaks or slows down, and DANGER marks what cannot be undone.
hugo server -D previews drafts.
Enable Goldmark block attributes in hugo.yml, or component attribute lines render as plain text.
hugo --cleanDestinationDir empties public/.
The first build after deleting resources/_gen is much slower.
All 312 pages built; the site is ready to deploy.
rm -rf public/ before a deploy also deletes files you placed there by hand.
Should the site have comments? See enabling comments.
pgsty.com is a documentation site built from callouts and tables alone.
Documentation is a love letter that you write to your future self.
Custom title
Text after the marker on the same line becomes the title, and it may contain inline code, bold text and links.
public/Check that baseURL points at the production domain before a production
build, or every absolute link will be wrong.
Body content
The body is ordinary Markdown: lists, fenced code, tables, images, even
another callout. Every line starts with >, fence lines included.
- Clone:
git clone https://github.com/pgsty/oink-starter my-docs - Enter the directory and preview:
- Open http://localhost:1313/
| Port | Purpose |
|---|---|
| 1313 | Hugo development server |
Collapsing
Put - after the type to render the callout closed, or + to render it open
with a toggle. Either way it is a native <details> element that works
without JavaScript. Fold what most readers can skip: full command output, an
alternative procedure, background reading.
Why is Go needed?
Hugo downloads themes through Go’s module system (hugo mod get). A submodule
or an offline archive works without Go installed.
Open by default, but the reader can close it
The closed state is not remembered; a reload returns to the default.
The neutral disclosure, DETAILS
[!DETAILS] is a disclosure with no color and no icon, closed unless you
write [!DETAILS]+. Use it when the content is neither a note nor a warning,
just long: a complete configuration file, a full log, or an
audio transcript placed right after a
player.
Full hugo version output
Custom icon
To replace the type’s icon, put {icon="fa-solid fa-…"} (one Font Awesome
class pair) on the line right after the blockquote, with no blank line between
them.
Pigsty v4 installs PostgreSQL 18 by default.
Nesting
Add one > per level. One level is usually enough; deeper nesting is hard to
read.
A theme version bump can change how a page renders.
How to back up
git tag pre-upgrade is enough — rolling back is git checkout pre-upgrade.
Unknown types and common slips
A misspelled type does not break the build or lose content. The block renders as a plain blockquote with the marker still visible, so the typo is easy to spot.
[!NOTICE] Not a valid type
The marker stays on the page to tell you so.
Formatters such as Prettier cause the other two common slips:
- They join the title line and the body. Keep an empty
>line under the title. - They move attribute lines such as
{icon=…}. Wrap the callout in<!-- prettier-ignore-start -->and<!-- prettier-ignore-end -->.
Output
Callouts load no script. Print and RSS show every callout expanded, and the page’s Markdown output keeps the original blockquote, marker and title included.
Parameter reference
The marker line > [!TYPE]± Title:
The attribute line {…}, immediately after the blockquote:
Any other key, style included, is dropped with a build warning. Hugo strips
on* handlers before the theme sees them, so they are dropped silently.
Limits
- The type sets the color; there is no color parameter. When no type fits, take the closest one and let the title carry the meaning.
- A reader’s open or closed choice is not remembered after a reload.
- Inside a
{.steps}item, indent every>line to the item’s text; inside a{{% steps %}}step, write it unindented. See Steps.
Related
- Social —
> [!SOCIAL]callouts for offline quoted social posts - Steps — callouts inside a procedure
- Tabs — the same note split per platform
- Writing pages — when to use a callout and when to use prose