Alerts

Add a page alert with a Doks shortcode (named parameter or paired). Add a (dismissible) global alert, visible on all pages.

Global alert

The global alert is visible on all pages when activated (at the top). Switch it on by setting alert = true and make it dismissible by setting alertDismissable = true in ./config/_default/params.toml, like so:

# Alert
alert = true
alertDismissable = true
alertText = "Help Doks grow by supporting us on Open Collective. <a class=\"alert-link stretched-link\" href=\"https://opencollective.com/doks\" target=\"_blank\" rel=\"noopener\">Become a backer!</a>"

Will be processed into:

Global Dismissable Alert

Page alert

./layouts/shortcode/alert.html

See also the Hugo docs: Shortcodes

Named parameter

{{< alert icon="👉" text="Make sure to always self-close the alert shortcode." />}}

Will be processed into:

Paired

{{< alert icon="👉" >}}
_Markdown_ and <em>HTML</em> will be rendered.
{{< /alert >}}

Will be processed into:

Context

Add context to page alerts (info, success, warning, or danger).

{{< alert icon="👉" context="info" text="A simple info alert — check it out!" />}}

Will be processed into:

Edit this page on GitHub