Skip to content

Commit 736d583

Browse files
committed
Enable blockquote rendering for alerts based on the Bootstrap styling used
1 parent 953eca4 commit 736d583

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ enableEmoji = true
4343
prod_url = "https://goto.ceesbos.nl"
4444
dev_url = "http://localhost:8080"
4545

46+
[markup]
47+
[markup.goldmark]
48+
[markup.goldmark.parser]
49+
[markup.goldmark.parser.attribute]
50+
block = true
51+
4652
[module]
4753
[[module.imports]]
4854
path = 'faro-analytics'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{ $emojis := dict
2+
"caution" "🚨"
3+
"important" ":information_source:"
4+
"note" "️:pen:"
5+
"tip" ":bulb:"
6+
"warning" ":warning: "
7+
"question" ":question:"
8+
}}
9+
10+
{{ $style := dict
11+
"caution" "danger"
12+
"important" "info"
13+
"note" "light"
14+
"tip" "primary"
15+
"warning" "warning"
16+
"question" "secondary"
17+
}}
18+
19+
{{ if eq .Type "alert" }}
20+
<div class="alert alert-{{ index $style .AlertType }}" role="alert" style="padding-bottom: 0px;">
21+
{{ transform.Emojify (index $emojis .AlertType) }}
22+
{{ with .AlertTitle }}
23+
{{ . }}
24+
{{ else }}
25+
{{ or (i18n .AlertType) (title .AlertType) }}
26+
{{ end }}
27+
{{ .Text }}
28+
</div>
29+
{{ else }}
30+
<blockquote>
31+
{{ .Text }}
32+
</blockquote>
33+
{{ end }}

0 commit comments

Comments
 (0)