Skip to content

Steps

Add {.steps} to an ordered list for a numbered procedure. Use the steps shortcode when each step needs a table-of-contents heading.

Steps present a procedure as a numbered column of dots joined by a line, so a reader following an installation or an upgrade can see at a glance which step they are on and how many remain. Add a {.steps} line under an ordinary ordered list; CSS draws the dots and the line, and no script loads. Use steps only when the order matters. Options and related links belong in a plain list or in cards.

The ordered list is the form to reach for first. Switch to the {{% steps %}} shortcode when each step needs its own heading in the table of contents; Which form to use compares the two.

Shortest form

Number every item 1. and let Markdown count, so you can add, remove or reorder steps without renumbering, and the content indent is always three spaces.

Source
1. Install Hugo
1. Clone OINK Starter
1. Start the local preview
{.steps}
  1. Install Hugo
  2. Clone OINK Starter
  3. Start the local preview

Put {.steps} on the line right after the last item. With a blank line in between, Goldmark drops it without a warning and the list renders as a plain numbered list.

What goes in a step

A step can hold any block content: paragraphs, fenced code, callouts, tables, nested lists and images. Indent it to the item’s content column, three spaces.

Source
1. Clone OINK Starter; it is the small project template for the theme.

   ```bash
   git clone https://github.com/pgsty/oink-starter my-docs
   cd my-docs
   ```

1. Start the local server.

   ```bash
   hugo server
   ```

   > [!NOTE]
   > The first build fetches the theme through the Go module proxy, which needs
   > Go on the machine.

1. Replace three things and it is your site.

   | Where | Replace with |
   | --- | --- |
   | `title` in `hugo.yml` | your site name |
   | `baseURL` in `hugo.yml` | your domain |
   | `content/` | your content |
{.steps}
  1. Clone OINK Starter; it is the small project template for the theme.

    git clone https://github.com/pgsty/oink-starter my-docs
    cd my-docs
  2. Start the local server.

    hugo server
    Note

    The first build fetches the theme through the Go module proxy, which needs Go on the machine.

  3. Replace three things and it is your site.

    Where Replace with
    title in hugo.yml your site name
    baseURL in hugo.yml your domain
    content/ your content

Shortcodes written as {{< … >}}, such as tabs, cards and badges, work inside a step too. The {{% … %}} form does not; see Limits.

Splitting one step per platform

When one step differs by platform, write adjacent {tab=} fences inside that list item; they still combine into one set of tabs.

Source
1. Install Hugo.

1. Install the dependencies:

   ```bash {tab="EL / RHEL" group="stepdemo" value="rpm"}
   sudo dnf install golang git
   ```
   ```bash {tab="Debian / Ubuntu" value="deb"}
   sudo apt install golang-go git
   ```

1. Run `hugo server` to preview.
{.steps}
  1. Install Hugo.

  2. Install the dependencies:

    EL / RHEL
    sudo dnf install golang git
    Debian / Ubuntu
    sudo apt install golang-go git
  3. Run hugo server to preview.

Continuing the numbering

When prose interrupts a procedure, start the next group with its real step number. Markdown writes that number as the list’s start, and the dots continue from it; starts from 2 to 40 are supported.

Source
4. Configure `baseURL` and the deployment workflow.
1. Push to `main` and wait for GitHub Actions to finish.
{.steps}
  1. Configure baseURL and the deployment workflow.
  2. Push to main and wait for GitHub Actions to finish.

Steps with headings

A long procedure is easier to navigate when every step has a heading that appears in the table of contents and can be linked to. Wrap the procedure in {{% steps %}}: its body is ordinary page Markdown, not indented, and each direct child heading starts a step. The three headings below are in this page’s table of contents.

Source
{{% steps %}}

### Install the toolchain {#install-toolchain}

Install Hugo and Go; [Get started](/docs/start/) lists the versions.

### Run the server {#run-server}

{{< tabs group="oink-os" default="macos" >}}
{{< tab label="macOS" value="macos" >}}
`brew install hugo go`
{{< /tab >}}
{{< tab label="Debian" value="debian" >}}
`sudo apt install hugo golang-go`
{{< /tab >}}
{{< /tabs >}}

### Publish {#publish}

Push to `main`; the workflow the repository ships builds and publishes.

{{% /steps %}}

Install the toolchain

Install Hugo and Go; Get started lists the versions.

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.

steps is the theme’s only shortcode written with percent delimiters. That form hands its body to Goldmark as page Markdown, which lets each step carry headings that enter the TOC. The cost is that it cannot sit inside a list item or inside another percent container, another steps included. Give every step in one procedure the same heading level.

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 %}}
The procedure itself has to nest inside another list item ordered list + {.steps}

Optional presentation

For a short procedure, {.steps .td-steps-compact} and steps variant="compact" tighten the spacing; numbering, nesting and heading anchors work as before. The presentation page shows both next to the regular form.

Output

Steps load no script, so they look the same with JavaScript off. Print keeps the numbers, content and connecting line; the Markdown output keeps the source as written, and RSS shows a plain list or titled sections.

Parameter reference

{.steps} , Whereline below the ordered list
Required; has no effect on an unordered list
{.steps .td-steps-compact} , Whereline below the ordered list
Compact spacing for a short procedure
1. , Whereevery item
Let Markdown count; the content indent is always three spaces
4. (first item) , Wherefirst item
Emits <ol start="4"> and continues from 4; supported for 2–40
{{% steps %}} , Wherearound a set of headings
Direct child headings (##–######) are the steps; the body is not indented
variant="compact" , Whereon {{% steps %}}
Compact spacing; any other value warns and uses the regular layout

Limits

  • Do not put a {{% … %}} shortcode inside a list item: its multiline output ends the list early. To put a {{% … %}} shortcode in a step, use the shortcode form.
  • Formatters such as Prettier may separate {.steps} from its list. Wrap the list in <!-- prettier-ignore-start --> and <!-- prettier-ignore-end -->.
  • {.steps} works only on ordered lists; a - list gets no numbers.
  • Steps do not collapse, expand or track progress; there is no “done” state.
  • 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