Skip to content

Commit a1da30d

Browse files
committed
Callouts: Refactored inline param to be sideline param instead
1 parent 6550b11 commit a1da30d

File tree

13 files changed

+27
-27
lines changed

13 files changed

+27
-27
lines changed

exampleSite/content/test-product/call-out/call-out-param-types.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ The callout shortcode aims to support both, but **not** in the same shortcode in
1313
## The two callouts below using **unnamed** params
1414

1515
{{<call-out "" "Custom title" "fa fa-check-circle" "true">}}
16-
This callout uses the icon check-circle. **This should be an inline callout.**
16+
This callout uses the icon check-circle. **This should be an sideline callout.**
1717
{{</call-out>}}
1818

1919
{{<call-out "" "Custom title" "fa fa-check-circle" "false">}}
20-
This callout uses the icon check-circle. **This should be an sideline callout.**
20+
This callout uses the icon check-circle. **This should be an inline callout.**
2121
{{</call-out>}}
2222

2323
## The two callouts below using **named** params
2424
This should work exactly the same as the two callouts above
2525

26-
{{<call-out title="Custom title" icon="fa fa-check-circle" inline="true">}}
27-
This callout uses the icon check-circle. **This should be an inline callout.**
26+
{{<call-out title="Custom title" icon="fa fa-check-circle" sideline="true">}}
27+
This callout uses the icon check-circle. **This should be an sideline callout.**
2828
{{</call-out>}}
2929

30-
{{<call-out title="Custom title" icon="fa fa-check-circle" inline="asdas">}}
30+
{{<call-out title="Custom title" icon="fa fa-check-circle" sideline="true">}}
3131
This callout uses the icon check-circle. **This should be an sideline callout.**
3232
{{</call-out>}}

exampleSite/content/test-product/call-out/call-out-side.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ This assumes the callout text is shorter than the text in the callout.
4646
If the text in the paragraph is shorter than the callout, it's likely
4747
the content needs to be re-written.
4848

49-
{{<call-out "tip inline-callout" "Tip for Automated Reporting" >}}
49+
{{<call-out "tip" "Tip for Automated Reporting" >}}
5050
I am some call out text. Look at me go!
5151
{{</call-out>}}

layouts/partials/callout.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
{{ $class := .class | default "" }}
33
{{ $title := .title | default "" }}
44
{{ $icon := .icon | default "" }}
5-
{{ $inlineParam := .inline | default "false" | lower }}
5+
{{ $sidelineParam := .sideline | default "false" | lower }}
66

7-
{{ if not (in (slice "true" "false") $inlineParam) }}
8-
{{ errorf "Invalid parameter 'inline'='%s' passed to blockquote partial from '%s'. Allowed values: true, false" $inlineParam .Page.Path }}
7+
{{ if not (in (slice "true" "false") $sidelineParam) }}
8+
{{ errorf "Invalid parameter 'sideline'='%s' passed to blockquote partial from '%s'. Allowed values: true, false" $sidelineParam .Page.Path }}
99
{{ end }}
1010

1111
{{/* Figure out inline/side and set class accordingly */}}
12-
{{ $inline := eq $inlineParam "true" }}
12+
{{ $sideline := eq $sidelineParam "true" }}
1313
{{ $sideOption := "side-callout" }}
1414
{{ $inlineOption := "inline-callout" }}
1515

16-
{{ if $inline }}
16+
{{ if $sideline }}
1717
{{ $class = printf "%s %s" $class $sideOption }}
1818
{{ else }}
1919
{{ $class = printf "%s %s" $class $inlineOption }}

layouts/shortcodes/banner.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"class" (printf "%s %s" $type "call-out")
55
"title" $title
66
"icon" "fa-solid fa-triangle-exclamation"
7-
"inline" true
7+
"sideline" true
88
"type" ($type | strings.FirstUpper)
99
"content" .Inner
1010
) }}

layouts/shortcodes/before-you-begin.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"class" "tip"
33
"title" "Before you begin:"
44
"icon" ""
5-
"inline" "false"
5+
"sideline" "false"
66
"content" .Inner
77
) }}
88
{{ warnf "'<before-you-begin></before-you-begin>' is being deprecated. Use generic 'call-out' shortcode instead."}}

layouts/shortcodes/call-out.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{{/*
22

33
Usage:
4-
{{<call-out title="Custom title" icon="fa fa-check-circle" inline="true">}}
5-
This callout uses the icon check-circle. **This should be an inline callout.**
4+
{{<call-out title="Custom title" icon="fa fa-check-circle" sideline="true">}}
5+
This callout uses the icon check-circle. **This should be an sideline callout.**
66
{{</call-out>}}
77

88
Backwards compatibility usage:
99
{{<call-out "warning" "Custom title" "fa fa-check-circle" "true">}}
10-
This callout uses the icon check-circle. **This should be an inline callout.**
10+
This callout uses the icon check-circle. **This should be an sideline callout.**
1111
{{</call-out>}}
1212

1313
Depends on `callout.html` partial.
@@ -19,16 +19,16 @@
1919
{{ $icon := .Get 2 | default (.Get "icon") | default "" }}
2020

2121
{{/* Handle different versions of booleans */}}
22-
{{ $inlineParam := (.Get 3) | default (.Get "inline") | default "false" | lower }}
22+
{{ $sidelineParam := (.Get 3) | default (.Get "sideline") | default "false" | lower }}
2323
{{- /* Validate the parameter strictly */ -}}
24-
{{ if not (in (slice "true" "false") $inlineParam) }}
25-
{{ warnf "The '<call-out>' Shortcode parameter 'inline' must be 'true' or 'false', but got: '%s'. This will now default to 'false'" $inlineParam}}
24+
{{ if not (in (slice "true" "false") $sidelineParam) }}
25+
{{ warnf "The '<call-out>' Shortcode parameter 'sideline' must be 'true' or 'false', but got: '%s'. This will now default to 'false'" $sidelineParam}}
2626
{{ end }}
2727

2828
{{ partial "callout.html" (dict
2929
"class" (printf "%s %s" $class "call-out")
3030
"title" $title
3131
"icon" $icon
32-
"inline" $inlineParam
32+
"sideline" $sidelineParam
3333
"content" .Inner
3434
) }}

layouts/shortcodes/caution.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"class" "caution call-out"
33
"title" "Caution"
44
"icon" ""
5-
"inline" "false"
5+
"sideline" "false"
66
"content" .Inner
77
) }}

layouts/shortcodes/deprecated.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"class" "warning call-out"
33
"title" "Deprecated"
44
"icon" ""
5-
"inline" "false"
5+
"sideline" "false"
66
"content" .Inner
77
) }}

layouts/shortcodes/important.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"class" "important call-out"
33
"title" "Important"
44
"icon" ""
5-
"inline" "false"
5+
"sideline" "false"
66
"content" .Inner
77
) }}

layouts/shortcodes/note.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"class" "note"
33
"title" "Note:"
44
"icon" ""
5-
"inline" "false"
5+
"sideline" "false"
66
"content" .Inner
77
) }}
88
{{ warnf "'<note></note>' is being deprecated. Use generic 'call-out' shortcode instead."}}

0 commit comments

Comments
 (0)