8
8
{{ errorf "Invalid parameter 'inline'='%s' passed to blockquote partial from '%s'. Allowed values: true, false" $inlineParam .Page.Path }}
9
9
{{ end }}
10
10
11
+ {{/* Figure out inline/side and set class accordingly */}}
11
12
{{ $inline := eq $inlineParam "true" }}
12
13
{{ $sideOption := "side-callout" }}
13
14
{{ $inlineOption := "inline-callout" }}
18
19
{{ $class = printf "%s %s" $class $inlineOption }}
19
20
{{ end }}
20
21
22
+ {{/* Render a different block, if "loud" callouts are used */}}
23
+ {{ $specialTitles := slice "Caution" "Warning" "Deprecated" "Important" }}
24
+ {{ $isSpecialTitle := in $specialTitles $title }}
25
+
26
+ {{/* Old frame callout */}}
21
27
< blockquote class ="{{ $class }} " data-mf ="false ">
22
28
< div >
23
29
{{ with $icon }}
28
34
</ div >
29
35
</ blockquote >
30
36
31
- < blockquote class ="{{ $class }} " data-mf ="true " style ="display: none; ">
37
+
38
+ {{ if $isSpecialTitle }}
39
+ {{/* Loud callouts */}}
40
+ < blockquote class ="{{ $class }} " data-mf ="true " style ="display: none; ">
41
+ < div >
42
+ {{ with $icon }}
43
+ < i class ="{{ . }} "> </ i >
44
+ {{ end }}
45
+ < div class ="special-header ">
46
+ < h3 > {{ $title }}</ h3 >
47
+ </ div >
48
+ < div class ="special-content ">
49
+ I AM THE SPECIAL CALLOUT - NOT FINISHED YET
50
+ {{ .content | markdownify }}
51
+ </ div >
52
+ </ div >
53
+ </ blockquote >
54
+
55
+ {{ else }}
56
+
57
+ {{/* "Generic" mf callout */}}
58
+
59
+ {{ $cleanTitle := strings.TrimSuffix ":" $title}}
60
+
61
+ < blockquote class ="{{ $class }} note " data-mf ="true " style ="display: none; " data-title ="{{ $cleanTitle }} ">
32
62
< div >
33
63
{{ with $icon }}
34
64
< i class ="{{ . }} "> </ i >
35
65
{{ end }}
36
- {{ with $title }}
37
- < h2 class ="callout-title "> {{ $title }}</ h2 >
38
- {{ end }}
39
66
{{ .content | markdownify }}
40
67
</ div >
41
- </ blockquote >
68
+ </ blockquote >
69
+
70
+ {{ end }}
0 commit comments