Skip to content

Commit 7a2b2d2

Browse files
chore: Add error for deprecated call-out shortcodes
1 parent be91073 commit 7a2b2d2

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

layouts/shortcodes/before-you-begin.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
"sideline" "false"
66
"content" .Inner
77
) }}
8-
{{ warnf "'<before-you-begin></before-you-begin>' is being deprecated. Use generic 'call-out' shortcode instead. (%s)" .Position }}

layouts/shortcodes/call-out.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,10 @@
3131
"icon" $icon
3232
"sideline" $sidelineParam
3333
"content" .Inner
34-
) }}
34+
) }}
35+
36+
{{ if $deprecatedTag := .Get 0 }}
37+
{{ $suggestions := dict "warning" "<warning></warning>" "caution call-out" "<caution></caution>" }}
38+
{{ $suggest := index $suggestions $deprecatedTag | default "<call-out></call-out>" }}
39+
{{ errorf "The '<%s>' shortcode is deprecated. Please use %s instead. This will be removed in future versions. (%s)" $deprecatedTag $suggest .Position }}
40+
{{ end }}

layouts/shortcodes/note.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
"sideline" "false"
66
"content" .Inner
77
) }}
8-
{{ warnf "'<note></note>' is being deprecated. Use generic 'call-out' shortcode instead. (%s)" .Position }}

layouts/shortcodes/see-also.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
"sideline" "false"
66
"content" .Inner
77
) }}
8-
{{ warnf "'<see-also></see-also>' is being deprecated. Use generic 'call-out' shortcode instead. (%s)" .Position }}

layouts/shortcodes/tip.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
"sideline" "false"
66
"content" .Inner
77
) }}
8-
{{ warnf "'<tip></tip>' is being deprecated. Use generic 'call-out' shortcode instead. (%s)" .Position }}

0 commit comments

Comments
 (0)