Add: Icons to alert shortcode

This commit is contained in:
Aroy-Art 2022-05-09 21:21:13 +02:00
parent eb62eb693c
commit b1c676c2d4
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -1 +1,13 @@
<div class="alert {{ with .Get "theme" }}alert-{{.}}{{ end }}" role="alert" data-dir="{{ with .Get "dir" }}{{.}}{{ else }}ltr{{ end }}">{{ .Inner | markdownify }}</div> <div class="alert {{ with .Get "theme" }}alert-{{.}}{{ end }}" role="alert" data-dir="{{ with .Get "dir" }}{{.}}{{ else }}ltr{{ end }}">
{{ $alert := .Get "theme" }}
{{ if findRE "info" $alert }}
<i class="nf nf-fa-info_circle" style="font-size: 28px;"></i>
{{ else if findRE "warning" $alert }}
<i class="nf nf-fa-warning" style="font-size: 28px;"></i>
{{ else if findRE "danger" $alert }}
<i class="nf nf-oct-stop" style="font-size: 28px;"></i>
{{ end }}
{{ .Inner | markdownify }}
</div>