++ + +{{/* Render a different block, if "loud" callouts are used */}} +{{ $specialTitles := slice "Caution" "Warning" "Deprecated" "Important" }} +{{ $specialTitleIcons := dict + "Caution" "alert-triangle" + "Warning" "alert-octagon" + "Deprecated" "alert-octagon" + "Important" "arrow-right-circle" +}} +{{ $icon := index $specialTitleIcons $title | default "" }} + +{{ $isSpecialTitle := in $specialTitles $title }} +{{ if $isSpecialTitle }} + {{/* Loud callouts */}} ++ {{ with $icon }} + + {{ end }} + {{ $title }} + {{ .content | markdownify }} ++
-\ No newline at end of file + {{ partial "callout.html" (dict + "class" "tip" + "title" "Before you begin:" + "icon" "" + "inline" "false" + "content" .Inner +) }} +{{ warnf "'Before you begin:-
{{ .Inner | markdownify }}
-\ No newline at end of file +{{ partial "callout.html" (dict + "class" $class + "title" $title + "icon" $icon + "inline" $inline + "content" .Inner +) }} \ No newline at end of file diff --git a/layouts/shortcodes/caution.html b/layouts/shortcodes/caution.html index 7aff8c24..866fba3b 100644 --- a/layouts/shortcodes/caution.html +++ b/layouts/shortcodes/caution.html @@ -1,3 +1,7 @@ -- - {{ with .Get 2 }} - - - {{ end }} - - {{ .Get 1 }}-
- - {{ .Inner | markdownify }} -
-\ No newline at end of file +{{ partial "callout.html" (dict +"class" "caution call-out" +"title" "Caution" +"icon" "" +"inline" "false" +"content" .Inner +) }} \ No newline at end of file diff --git a/layouts/shortcodes/deprecated.html b/layouts/shortcodes/deprecated.html index 9fcd7204..512092d5 100644 --- a/layouts/shortcodes/deprecated.html +++ b/layouts/shortcodes/deprecated.html @@ -1,3 +1,7 @@ -Caution-
{{ .Inner | markdownify }}
-\ No newline at end of file +{{ partial "callout.html" (dict +"class" "warning call-out" +"title" "Deprecated" +"icon" "" +"inline" "false" +"content" .Inner +) }} \ No newline at end of file diff --git a/layouts/shortcodes/important.html b/layouts/shortcodes/important.html index 55f6ade8..ee48cd7b 100644 --- a/layouts/shortcodes/important.html +++ b/layouts/shortcodes/important.html @@ -1,3 +1,7 @@ -Deprecated-
{{ .Inner | markdownify }}
-+{{ partial "callout.html" (dict +"class" "important call-out" +"title" "Important" +"icon" "" +"inline" "false" +"content" .Inner +) }} \ No newline at end of file diff --git a/layouts/shortcodes/note.html b/layouts/shortcodes/note.html index 95b0ebf2..08f1209d 100644 --- a/layouts/shortcodes/note.html +++ b/layouts/shortcodes/note.html @@ -1,3 +1,8 @@ -Important-
{{ .Inner | markdownify }}
-+{{ partial "callout.html" (dict +"class" "note" +"title" "Note:" +"icon" "" +"inline" "false" +"content" .Inner +) }} +{{ warnf "'Note:-
{{ .Inner | markdownify }}
-+{{ partial "callout.html" (dict +"class" "tip" +"title" "See Also:" +"icon" "" +"inline" "false" +"content" .Inner +) }} +{{ warnf "'See Also:-
{{ .Inner | markdownify }}
-+{{ partial "callout.html" (dict +"class" "tip" +"title" "Tip:" +"icon" "" +"inline" "false" +"content" .Inner +) }} +{{ warnf "'Tip:-
{{ .Inner | markdownify }}
-+{{ partial "callout.html" (dict +"class" "warning call-out" +"title" "Warning" +"icon" "" +"inline" "false" +"content" .Inner +) }} \ No newline at end of fileWarning-
{{ .Inner | markdownify }}