Refactor alert shortcode (#858)

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
Emruz Hossain 2024-01-01 14:58:11 +06:00 committed by GitHub
parent d3968ca711
commit fdfee4d3bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 93 additions and 2 deletions

View file

@ -1,3 +1,16 @@
<div class="alert alert-{{ .Get "type"}}">
<strong>{{.Inner | markdownify }}</strong>
{{ $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>