Skip to content

Commit 9b6b58f

Browse files
authored
Fix Hugo build issue in GitHub Actions (#5505)
2 parents 217d4fa + 940b0a7 commit 9b6b58f

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

site/layouts/shortcodes/alert.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- $type := lower (default "info" (.Get "type")) -}}
2+
{{- $title := .Get "title" -}}
3+
{{- $icons := dict "info" "fa-info-circle" "warning" "fa-exclamation-triangle" "danger" "fa-exclamation-circle" "success" "fa-check-circle" -}}
4+
{{- $backgrounds := dict "info" "#e0f4ff" "warning" "#fff4e0" "danger" "#ffe3e3" "success" "#e7f5e7" -}}
5+
{{- $borders := dict "info" "#228be6" "warning" "#f08c00" "danger" "#c92a2a" "success" "#2f9e44" -}}
6+
{{- $icon := index $icons $type | default (index $icons "info") -}}
7+
{{- $background := index $backgrounds $type | default (index $backgrounds "info") -}}
8+
{{- $border := index $borders $type | default (index $borders "info") -}}
9+
<div class="alert-box alert-box-{{$type}}" role="alert" style="border-left:4px solid {{$border}}; background-color: {{$background}}; padding:1rem; margin:1rem 0; border-radius:0.5rem;">
10+
<div style="display:flex; align-items:flex-start; gap:0.75rem;">
11+
<i class="fa {{$icon}}" aria-hidden="true" style="font-size:1.75rem; line-height:1;"></i>
12+
<div class="alert-box-content">
13+
{{- if $title -}}
14+
<p style="font-weight:600; margin:0 0 0.25rem 0;">{{$title}}</p>
15+
{{- end -}}
16+
<div>{{ .Inner | markdownify }}</div>
17+
</div>
18+
</div>
19+
</div>

0 commit comments

Comments
 (0)