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
Copy
1
2
3
{{< alert >}}
Your alert message here
{{< / alert >}}
Parameters Parameter Required Default Description Inner content Yes - The message to display in the alert dialog Table: Alert Parameters
Examples Basic Alert GO
Copy
1
2
3
{{< alert >}}
Welcome to my website !
{{< / alert >}}
Alert with go GO
Copy
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
Copy
1
2
3
4
5
{{< alert >}}
Welcome to our site !
Please read the terms and conditions before proceeding .
{{< / alert >}}
Alert with Special Characters GO
Copy
1
2
3
4
{{< alert >}}
Don ' t forget to save your work !
Use "Ctrl+S" to save quickly .
{{< / alert >}}
Important Notes GO
Copy
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:
The admonition shortcode for in-content callouts Modal dialogs for user confirmations Banner notices at the top of the page Example Output When you use:
GO
Copy
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.