Alert

The alert shortcode displays a JavaScript browser alert dialog with your custom message when the page loads. This is useful for important announcements, warnings, or testing purposes.

Usage

GO
1
2
3
{{< alert >}}
Your alert message here
{{< /alert >}}

Parameters

ParameterRequiredDefaultDescription
Inner contentYes-The message to display in the alert dialog
Table: Alert Parameters

Examples

Basic Alert

GO
1
2
3
{{< alert >}}
Welcome to my website!
{{< /alert >}}

Alert with go

GO
1
2
3
{{< alert >}}
**Important:** Your session will expire in 5 minutes.
{{< /alert >}}

Note: go formatting like bold and italic will be converted to plain text in the alert.

Multi-line Alert

GO
1
2
3
4
5
{{< alert >}}
Welcome to our site!

Please read the terms and conditions before proceeding.
{{< /alert >}}

Alert with Special Characters

GO
1
2
3
4
{{< alert >}}
Don't forget to save your work!
Use "Ctrl+S" to save quickly.
{{< /alert >}}

Important Notes

GO
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<!-- Alert triggers on page load -->
{{< alert >}}
This will appear immediately when the page loads
{{< /alert >}}

<!-- go is converted to plain text -->
{{< alert >}}
**Bold** text becomes: Bold text
*Italic* text becomes: Italic text
[Links](url) become: Links
{{< /alert >}}

<!-- Multiple alerts will appear in sequence -->
{{< alert >}}First alert{{< /alert >}}
{{< alert >}}Second alert{{< /alert >}}

Alternative Approaches

For less intrusive notifications, consider using:

Example Output

When you use:

GO
1
2
3
{{< alert >}}
**Welcome!** Please read our privacy policy.
{{< /alert >}}

The user will see a browser alert dialog with the plain text:

Welcome! Please read our privacy policy.