Steps
{.steps} becomes a numbered procedure with dots and a connecting rule; switch to the steps shortcode when each step needs a heading in the table of contents.Steps are an ordered list with numbered dots and a rule running through them: a
plain ordered list plus a {.steps} marker line. The dots and the rule are
drawn in CSS and no script is loaded. Use it for procedures that have an order.
Parallel items with no order belong in a plain list or in cards.
There are two spellings: an ordered list plus {.steps} (the default choice),
and the {{% steps %}} shortcode, for when each step needs its own heading
and those headings belong in the table of contents.
Shortest form
Write 1. for every item and let Markdown do the counting. Inserting, deleting
and reordering steps then needs no renumbering, and the content indent is always
three spaces.
- Install Hugo Extended
- Clone the documentation site
- Start the local preview
{.steps} must touch the last line of the list; leave a blank line and it turns
into a visible line of braces.
What goes in a step
A list item takes any block content: paragraphs, fenced code, callouts, tables, nested lists, images. Indent it to the item’s content column — three spaces.
-
Clone the documentation site; it is itself a complete example of the theme.
-
Start the local server.
NoteThe first build fetches the theme through the Go module proxy, which needs Go on the machine.
-
Replace three things and it is your site.
Where Replace with titleinhugo.ymlyour site name baseURLinhugo.ymlyour domain content/your content
Shortcodes in {{< … >}} form — tabs, cards, badges — work inside a list
item too. The {{% … %}} form does not; see Limits.
Splitting one step per platform
When one step differs per platform, write the {tab=} fences side by side
inside that list item and they still assemble into a tab set.
-
Install Hugo Extended.
-
Install the dependencies:
EL / RHELDebian / Ubuntu -
Run
hugo serverto preview.
Continuing the numbering
When prose interrupts a procedure, write the first item of the next group with
its real number. Markdown emits start and the numbering continues from there
(up to 40).
- Configure
baseURLand the deployment workflow. - Push to
mainand wait for GitHub Actions to finish.
Steps with headings
When the procedure is long and each step deserves a heading that can be linked
to and collected by the table of contents, use {{% steps %}}: its body is
page-level Markdown, every direct child heading is one step, and the body is not
indented. The three headings below appear in this page’s table of contents.
Install the toolchain
You need Hugo Extended ≥ 0.160.1 and Go.
Run the server
brew install hugo go
sudo apt install hugo golang-go
Publish
Push to main; the workflow the repository ships builds and publishes.
This is the theme’s only {{% … %}} shortcode. The percent form hands its
body to Goldmark as page-level Markdown, which is the only way its headings can
reach the table of contents and the only way container shortcodes such as
tabs, cards and fields can live inside it. The price is that it cannot
nest inside a list item or inside another percent container.
Keep the headings of one procedure at one level, and never nest one steps
inside another.
Which form to use
| Situation | Use |
|---|---|
| A step is a sentence or two plus a command | ordered list + {.steps} |
| Each step needs a heading, a link and a place in the TOC | {{% steps %}} |
A step must contain a tabs, cards or fields container |
{{% steps %}} |
| The procedure itself has to nest inside another list item | ordered list + {.steps} |
Output
| Output | Shape |
|---|---|
| HTML | The native form is <ol class="steps"> with numbers and rule drawn in CSS; the shortcode form is <div class="td-steps"> plus headings |
| Numbers and content unchanged, the rule stays | |
| Markdown | The source as written: an ordered list plus {.steps}, or headings plus bodies |
| RSS | A static list or titled sections |
No script; with JavaScript off nothing changes.
Parameter reference
Neither form takes parameters — only conventions:
Limits
- No
{{% … %}}inside a list item: the multi-line output of a percent shortcode truncates the list. To put a container in a step, switch the whole procedure to the shortcode form. {{% steps %}}cannot go inside a list item, nor inside another percent container.- The marker must touch the list: no blank line between the list and
{.steps}. Wrap it in<!-- prettier-ignore-start -->/<!-- prettier-ignore-end -->when a formatter like Prettier is in play. {.steps}applies to ordered lists only: on a-list there are no numbers.- Steps do not fold and do not track progress: no “done” state, no expanding or collapsing.
Related
- Tabs — commands split per platform
- Callouts — prerequisites and warnings inside a step
- Code blocks — the commands in a step
- Cards — “what next” once the procedure is done