File tree 1 file changed +22
-6
lines changed
1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change 55
55
56
56
{{ $_hugo_config := `{ "version": 1 }` }}
57
57
{{ $color := .Get "color" | default "primary" }}
58
- < div class ="alert alert-{{ $color }} " role ="alert ">
59
- {{ with .Get "title" | default "Success"}}< h4 class ="alert-heading "> {{ . | safeHTML }}</ h4 > {{ end }}
60
- {{ if eq .Page.File.Ext "md" }}
61
- {{ .Inner | markdownify }}
62
- {{ else }}
63
- {{ .Inner | htmlUnescape | safeHTML }}
58
+ {{ $title := .Get "title" }}
59
+
60
+ {{ if not $title }}
61
+ {{ if eq $color "warning" }}
62
+ {{ $title = "Warning" }}
63
+ {{ else if eq $color "danger" }}
64
+ {{ $title = "Danger" }}
65
+ {{ else if eq $color "info" }}
66
+ {{ $title = "Info" }}
67
+ {{ else if eq $color "note" }}
68
+ {{ $title = "Note" }}
69
+ {{ else }}
70
+ {{ $title = "Success" }}
71
+ {{ end }}
64
72
{{ end }}
73
+
74
+ < div class ="alert alert-{{ $color }} " role ="alert ">
75
+ < h4 class ="alert-heading "> {{ $title | safeHTML }}</ h4 >
76
+ {{ if eq .Page.File.Ext "md" }}
77
+ {{ .Inner | markdownify }}
78
+ {{ else }}
79
+ {{ .Inner | htmlUnescape | safeHTML }}
80
+ {{ end }}
65
81
</ div >
66
82
67
83
{{ end }}
You can’t perform that action at this time.
0 commit comments