mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-14 21:43:12 +00:00
Rename text param to title
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<!--
|
<!--
|
||||||
Displays a button. The shortcode supports the following arguments:
|
Displays a button. The shortcode supports the following arguments:
|
||||||
"text" Required text of the button.
|
"title" Required title of the button.
|
||||||
"href" Required address for the button or hyperlink.
|
"href" Required address for the button or hyperlink.
|
||||||
"state" Optional state of the button, either "enabled" (default), "disabled", "active", or "inactive".
|
"state" Optional state of the button, either "enabled" (default), "disabled", "active", or "inactive".
|
||||||
"size" Optional size of the button, either "sm", "md" (default), or "lg".
|
"size" Optional size of the button, either "sm", "md" (default), or "lg".
|
||||||
@@ -8,15 +8,15 @@
|
|||||||
"danger", "warning", "info", "light", or "dark".
|
"danger", "warning", "info", "light", or "dark".
|
||||||
"outline" Optional flag indicating the button should be outlined, either "false" (default) or "true".
|
"outline" Optional flag indicating the button should be outlined, either "false" (default) or "true".
|
||||||
"badge" Optional positioned badge to display on top of the button.
|
"badge" Optional positioned badge to display on top of the button.
|
||||||
"aria-label" Optional label for the badge.
|
"aria-label" Optional assistive label for the badge.
|
||||||
"tooltip" Optional title to display in a tooltip. Ignored for active/inactive buttons.
|
"tooltip" Optional text to display in a tooltip. Ignored for active/inactive buttons.
|
||||||
"type" Optional type of the element, either "link" or "button" (default).
|
"type" Optional type of the element, either "link" or "button" (default).
|
||||||
"placement" Optional position of the tooltip: "top" (default), "bottom", "left", or "right".
|
"placement" Optional position of the tooltip: "top" (default), "bottom", "left", or "right".
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{{ $text := trim .text " \n" -}}
|
{{ $title := trim .title " \n" -}}
|
||||||
{{ if not $text -}}
|
{{ if not $title -}}
|
||||||
{{ errorf "Missing element text" -}}
|
{{ errorf "Missing element title" -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{ $state := "enabled" -}}
|
{{ $state := "enabled" -}}
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
{{ if eq $state "active" }}data-bs-toggle="button" aria-pressed="true"{{ end }}
|
{{ if eq $state "active" }}data-bs-toggle="button" aria-pressed="true"{{ end }}
|
||||||
{{ if eq $state "inactive" }}data-bs-toggle="button" aria-pressed="false"{{ end }}
|
{{ if eq $state "inactive" }}data-bs-toggle="button" aria-pressed="false"{{ end }}
|
||||||
>
|
>
|
||||||
{{ $text -}}
|
{{ $title -}}
|
||||||
{{ with $badge }}
|
{{ with $badge }}
|
||||||
<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
|
<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
|
||||||
{{ . }}
|
{{ . }}
|
||||||
|
@@ -15,8 +15,8 @@
|
|||||||
{{ $error := false }}
|
{{ $error := false }}
|
||||||
{{ $type := "button" -}}
|
{{ $type := "button" -}}
|
||||||
|
|
||||||
{{ $text := trim .Inner " \n" -}}
|
{{ $title := trim .Inner " \n" -}}
|
||||||
{{ if not $text -}}
|
{{ if not $title -}}
|
||||||
{{ errorf "Missing inner element text: %s" .Position -}}
|
{{ errorf "Missing inner element text: %s" .Position -}}
|
||||||
{{ $error = true }}
|
{{ $error = true }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
@@ -75,5 +75,5 @@
|
|||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{ if not $error }}
|
{{ if not $error }}
|
||||||
{{- partial "button.html" (dict "type" $type "text" $text "size" $size "color" $color "outline" $outline "badge" $badge "label" $label "tooltip" $tooltip "href" $href "state" $state "placement" $placement) -}}
|
{{- partial "button.html" (dict "type" $type "title" $title "size" $size "color" $color "outline" $outline "badge" $badge "label" $label "tooltip" $tooltip "href" $href "state" $state "placement" $placement) -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
Displays a tooltip for a link. The shortcode supports the following arguments:
|
Displays a tooltip for a link. The shortcode supports the following arguments:
|
||||||
"color": Optional theme color of the element, either "primary" (default), "secondary", "success",
|
"color": Optional theme color of the element, either "primary" (default), "secondary", "success",
|
||||||
"danger", "warning", "info", "light", or "dark".
|
"danger", "warning", "info", "light", or "dark".
|
||||||
"title" Required title to display in the tooltip.
|
"title" Required text to display in the tooltip.
|
||||||
"href" Required address for the button or hyperlink.
|
"href" Required address for the button or hyperlink.
|
||||||
"placement" Optional position of the tooltip: "top" (default), "bottom", "left", or "right".
|
"placement" Optional position of the tooltip: "top" (default), "bottom", "left", or "right".
|
||||||
-->
|
-->
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
{{ $error := false }}
|
{{ $error := false }}
|
||||||
{{ $type := "link" -}}
|
{{ $type := "link" -}}
|
||||||
|
|
||||||
{{ $text := trim .Inner " \n" -}}
|
{{ $title := trim .Inner " \n" -}}
|
||||||
{{ if not $text -}}
|
{{ if not $title -}}
|
||||||
{{ errorf "Missing inner element text: %s" .Position -}}
|
{{ errorf "Missing inner element text: %s" .Position -}}
|
||||||
{{ $error = true }}
|
{{ $error = true }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
@@ -41,5 +41,5 @@
|
|||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{ if not $error }}
|
{{ if not $error }}
|
||||||
{{- partial "button.html" (dict "type" $type "text" $text "color" $color "tooltip" $tooltip "href" $href "placement" $placement) -}}
|
{{- partial "button.html" (dict "type" $type "title" $title "color" $color "tooltip" $tooltip "href" $href "placement" $placement) -}}
|
||||||
{{ end }}
|
{{ end }}
|
Reference in New Issue
Block a user