Sometimes you want to draw your reader’s attention to an important piece of information. You can do this using admonitions. Below are a few examples of how to do this, and the various styles that are available in Elegant.
To use admonitions within our Markdown, we need to enable support for them first.
pelicanconfig.py find your
MARKDOWN dictionary. Add the following line to
the dictionary (and ensure the previous line ends with a comma so that the dictionary
That’s it! Now your site will support Markdown admonitions.
There are several styles available and Elegant supports the recommended values of:
Let’s see some examples!
You can use either
error to get a red admonition box.
!!! danger This is a danger or error admonition
This is a danger or error admonition
warning admonition will be yellow.
!!! warning This is an attention, caution or warning admonition
This is an attention, caution or warning admonition
note to get a green admonition box.
!!! important This is an important or note admonition
This is an important or note admonition
tip to get a blue admonition box.
!!! hint This is a hint or tip admonition
This is a hint or tip admonition
Admonitions can have custom titles. When the default examples are used, the titles of each box are the same as the admonition type. This isn’t always what you want. If you want to use a custom title, you pass the title in double quotes after the type of admonition you are utilizing.
!!! hint "Use double quotes to change the title" This admonition box contains a custom tile because I placed it in double quotes after the `hint`.
Use double quotes to change the title
This admonition box contains a custom tile because I placed it in double quotes after the
There are times when you don’t need a title in your boxes. This can be done by
passing an empty string (
"") after the admonition type.
!!! important "" This box doesn't require a title, but is still an `important` admonition and will be highlighted as such.
This box doesn’t require a title, but is still an
important admonition and will be highlighted as such.