Files
website/src/content/writing/markdown-elements/admonitions.md
T

2.5 KiB

title, description, publishDate, updatedDate, tags
title description publishDate updatedDate tags
Markdown Admonitions This post showcases using the markdown admonition feature in Astro Cactus 25 Aug 2024 4 July 2025
markdown
admonitions

What are admonitions

Admonitions (also known as “asides”) are useful for providing supportive and/or supplementary information related to your content.

How to use them

To use admonitions in Astro Cactus, wrap your Markdown content in a pair of triple colons :::. The first pair should also include the type of admonition you want to use.

For example, with the following Markdown:

:::note
Highlights information that users should take into account, even when skimming.
:::

Outputs:

:::note Highlights information that users should take into account, even when skimming. :::

Admonition Types

The following admonitions are currently supported:

  • note
  • tip
  • important
  • warning
  • caution

Note

:::note
Highlights information that users should take into account, even when skimming.
:::

:::note Highlights information that users should take into account, even when skimming. :::

Tip

:::tip
Optional information to help a user be more successful.
:::

:::tip Optional information to help a user be more successful. :::

Important

:::important
Crucial information necessary for users to succeed.
:::

:::important Crucial information necessary for users to succeed. :::

Caution

:::caution
Negative potential consequences of an action.
:::

:::caution Negative potential consequences of an action. :::

Warning

:::warning
Critical content demanding immediate user attention due to potential risks.
:::

:::warning Critical content demanding immediate user attention due to potential risks. :::

Customising the admonition title

You can customise the admonition title using the following markup:

:::note[My custom title]
This is a note with a custom title.
:::

Outputs:

:::note[My custom title] This is a note with a custom title. :::

GitHub Repository Cards

You can add dynamic cards that link to GitHub repositories, on page load, the repository information is pulled from the GitHub API.

::github{repo="chrismwilliams/astro-theme-cactus"}

You can also link a Github user:

::github{user="withastro"}

To use this feature you just use the "Github" directive:

::github{repo="chrismwilliams/astro-theme-cactus"}
::github{user="withastro"}