Shortcode
To call a shortcode you need to write {{< myshortcode >}}.
Alert shortcode
Use the alert
shortcode when you want to outline something in particular. The first parameter is the level of the alert, the second is an optional title. Everything inside the shortcode will be the message. The list of alert level is available on Bootstrap documentation.
Here’s an example for a warning alert:
{{< alert "warning" "Warning:" >}}
This is the message of the warning.
{{< /alert >}}.
This will render:
Warning:
This is the message of the warning.image shortcode
Use the image
shortcode if you want to embed an image. The first parameter is the link to the image. The second is the title/caption of the image.
{{< image "/images/image.png" "Image Title" >}}
readfile shortcode
Use the readfile
shortcode to include a partial document in your content. It acts as a templating solution to enable reuse of common content.
{{< readfile “/content/partials/commonContent.html” >}}
It’s possible to search and replace variable during templating. Make sure you have a dictionary called str_replace_dict
in the frontmatter section of the page.
str_replace_dict:
"@[email protected]": "Go"
githubReadme shortcode
Use the githubReadme
shortcode to embed the Readme of an existing Github project in a page. The first parameter is the group and name of the repository.
This shortcode will embed the clever-tools readme.
{{< githubReadme "CleverCloud/clever-tools" >}}
tooltip shortcode
Use the tooltip
shortcode to provide a definition of the a term in a tooltip. All terms definitions are fetched from the glossary under /data/glossary.json
.
the title
parameter is the identifier of the object from glossary.json
.
This tooltip
{{< tooltip title="paas" >}}PaaS{{< /tooltip >}}
will produce PaaS
ref shortcode
This is a default Hugo shortcode to link to another content page.
This will output the relative link to the common configuration page: reference/common-configuration/#private-ssh-key
{{< ref "reference/common-configuration.md#private-ssh-key" >}}