aboutsummaryrefslogtreecommitdiff
path: root/site/layouts/shortcodes/example.html
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2021-01-16 21:51:12 +0200
committerXhmikosR <[email protected]>2021-08-31 17:24:38 +0300
commit5cc633dfabf3687bbbae9344725435031b022e81 (patch)
tree0214e560c65be3ffe261fb40baea3f25128126cd /site/layouts/shortcodes/example.html
parent9050b2698a9df1be49e3fe8c4e2f33c0a227cbf9 (diff)
downloadbootstrap-5cc633dfabf3687bbbae9344725435031b022e81.tar.xz
bootstrap-5cc633dfabf3687bbbae9344725435031b022e81.zip
Minor shortcode tweaks and consistency changes
Diffstat (limited to 'site/layouts/shortcodes/example.html')
-rw-r--r--site/layouts/shortcodes/example.html16
1 files changed, 9 insertions, 7 deletions
diff --git a/site/layouts/shortcodes/example.html b/site/layouts/shortcodes/example.html
index fd20839cb..65cd5a9f3 100644
--- a/site/layouts/shortcodes/example.html
+++ b/site/layouts/shortcodes/example.html
@@ -1,20 +1,22 @@
{{- /*
- Usage: `example [args]`
+ Usage: `example args`
- `args` are optional and can be one of the following:
- id: the `div`'s id - default: ""
- class: any extra class(es) to be added to the `div` - default ""
- show_preview: if the preview should be output in the HTML - default: `true`
- show_markup: if the markup should be output in the HTML - default: `true`
+ `args` are all optional and can be one of the following:
+ * id: the `div`'s id - default: ""
+ * class: any extra class(es) to be added to the `div` - default: ""
+ * show_preview: if the preview should be output in the HTML - default: `true`
+ * show_markup: if the markup should be output in the HTML - default: `true`
*/ -}}
+{{- $id := .Get "id" -}}
+{{- $class := .Get "class" -}}
{{- $lang := .Get "lang" | default "html" -}}
{{- $show_preview := .Get "show_preview" | default true -}}
{{- $show_markup := .Get "show_markup" | default true -}}
{{- $input := .Inner -}}
{{- if eq $show_preview true -}}
-<div{{ with .Get "id" }} id="{{ . }}"{{ end }} class="bd-example{{ with .Get "class" }} {{ . }}{{ end }}">
+<div{{ with $id }} id="{{ . }}"{{ end }} class="bd-example{{ with $class }} {{ . }}{{ end }}">
{{- $input -}}
</div>
{{- end -}}