Alerts

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

On this page

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:

  1. # Alert
  2. alert = true
  3. alertDismissable = true
  4. 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

  1. ./layouts/shortcode/alert.html

See also the Hugo docs: Shortcodes

Named parameter

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

Will be processed into:

👉

Make sure to always self-close the alert shortcode.

Paired

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

Will be processed into:

👉

Markdown and HTML will be rendered.