hugo-toha/layouts/shortcodes/alert.html
Emruz Hossain fdfee4d3bb
Refactor alert shortcode (#858)
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
2024-01-01 08:58:11 +00:00

16 lines
461 B
HTML

{{ $type := .Get "type"}}
{{ $icon := "alert-circle"}}
{{ if eq $type "success" }}
{{ $icon = "check-circle"}}
{{ else if eq $type "warning" }}
{{ $icon = "alert-triangle"}}
{{ else if eq $type "danger" }}
{{ $icon = "alert-octagon"}}
{{ else if eq $type "info" }}
{{ $icon = "info"}}
{{ end }}
<div class="alert {{ $type }}">
<span><i data-feather="{{$icon}}"></i></span>
<span><strong>{{.Inner | markdownify }}</strong></span>
</div>