From 6fc3ed5c07206af6c5f788c6b14c1f7c4a05ad62 Mon Sep 17 00:00:00 2001 From: Hannah Issermann Date: Wed, 11 Sep 2024 12:16:07 +0200 Subject: [PATCH] Temp commit with a beginning of a solution... --- site/content/docs/5.3/components/accordion.md | 2 +- site/layouts/shortcodes/example.html | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/site/content/docs/5.3/components/accordion.md b/site/content/docs/5.3/components/accordion.md index 8b22686ad5..8895341d14 100644 --- a/site/content/docs/5.3/components/accordion.md +++ b/site/content/docs/5.3/components/accordion.md @@ -70,7 +70,7 @@ To render an accordion that's expanded by default: Add `.accordion-flush` to remove some borders and rounded corners to render accordions edge-to-edge with their parent container. -{{< example class="bg-body-secondary" >}} +{{< example class="bg-body-secondary" buttons_labels="flush accordion example">}}

diff --git a/site/layouts/shortcodes/example.html b/site/layouts/shortcodes/example.html index 5b398e6814..a985e022fe 100644 --- a/site/layouts/shortcodes/example.html +++ b/site/layouts/shortcodes/example.html @@ -8,6 +8,7 @@ * show_markup: if the markup should be output in the HTML - default: `true` * show_preview: if the preview should be output in the HTML - default: `true` * stackblitz_add_js: if extra JS snippet should be added to StackBlitz - default: `false` + * buttons_labels: label to apply to complete 'Try it on Stackblitz' and 'Copy to clipboard' buttons - default: "" */ -}} {{- $id := .Get "id" -}} @@ -16,10 +17,14 @@ {{- $show_markup := .Get "show_markup" | default true -}} {{- $show_preview := .Get "show_preview" | default true -}} {{- $stackblitz_add_js := .Get "stackblitz_add_js" | default false -}} +{{- $buttons_labels := .Get "buttons_labels" | default "" -}} {{- $content := .Inner -}}
+ {{- if eq $buttons_labels "" }}toto{{ else }} {{ $buttons_labels }} {{- end }} + {{- if not (eq $buttons_labels "") }} {{ $buttons_labels }} {{- end }} + {{- if eq $show_preview true }} {{ $content }} @@ -31,10 +36,10 @@
{{ $lang }}
- -