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:
# 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:
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:
👉
Make sure to always self-close the alert shortcode.
Paired
{{< alert icon="👉" >}}
_Markdown_ and <em>HTML</em> will be rendered.
{{< /alert >}}
Will be processed into:
👉
Markdown and HTML will be rendered.