Skip to content

Commit 60741d0

Browse files
authored
Merge pull request #235 from OCram85/featureAlert
✨ Uses inline shortcode in alerts for large texts
2 parents e549c2a + c7ebe71 commit 60741d0

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

layouts/shortcodes/alert.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<div class="alert alert-warning d-flex" role="alert">
2-
<div class="flex-shrink-1 alert-icon">{{ with .Get "icon" }}{{.}}{{ end }}</div>
3-
<div class="w-100">{{ with .Get "text" }}{{ . | safeHTML }}{{ end }}</div>
4-
</div>
2+
<div class="flex-shrink-1 alert-icon">{{ with .Get "icon" }}{{.}} {{ end }}</div>
3+
{{ with .Get "text"}}
4+
<div class="w-100">{{ . | safeHTML }} </div>
5+
{{ else }}
6+
{{ with .Inner}}
7+
<div class="w-100"> {{ . | markdownify}}</div>
8+
{{ else }}
9+
{{ errorf "No valid text variable or Inner content given"}}
10+
{{ end }}
11+
{{ end}}
12+
</div>

0 commit comments

Comments
 (0)