Cet article montre comment utiliser le shortcode alert.
Important
Depuis
v1.8.0, vous pouvez créer des alertes sans shortcode, voir alertes de citation de bloc.
Syntaxe
En ligne
1{{< alert [type] >}}INLINE ALERT{{< /alert >}}
Bloc
1{{< alert [type] >}}
2BLOCK ALERT
3{{< /alert >}}
Le paramètre
typeest optionnel. Par défaut,info, valeurs disponibles :info,success,warningetdanger.
Avec titre
1{{< alert [type] >}}
2{{< alert-heading >}}Well Done!{{< /alert-heading >}}
3ALERT MESSAGE
4{{< /alert >}}
Avec la syntaxe Markdown
1{{% alert warning %}}
2Alert Shortcode with Markdown Syntax:
3```bash
4$ echo 'Un exemple de shortcode d'alerte avec la syntaxe Markdown'
5```
6{{% /alert %}}
Alert Shortcode with Markdown Syntax:
1$ echo 'An example of alert shortcode with the Markdown syntax'
Veuillez noter que vous devrez activer la configuration markup.goldmark.renderer.unsafe.
config.toml
1[markup]
2 [markup.goldmark]
3 [markup.goldmark.renderer]
4 unsafe = true
config.yaml
1markup:
2 goldmark:
3 renderer:
4 unsafe: true
config.json
1{
2 "markup": {
3 "goldmark": {
4 "renderer": {
5 "unsafe": true
6 }
7 }
8 }
9}
Exemples
Primaire
Infos
Aww ouais, vous avez lu avec succès ce message d'alerte important. Cet exemple de texte va être un peu plus long afin que vous puissiez voir comment l'espacement dans une alerte fonctionne avec ce type de contenu.
Avertissement
Danger