diff options
| author | XhmikosR <[email protected]> | 2021-01-16 21:51:12 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2021-08-31 17:24:38 +0300 |
| commit | 5cc633dfabf3687bbbae9344725435031b022e81 (patch) | |
| tree | 0214e560c65be3ffe261fb40baea3f25128126cd /site/layouts/shortcodes/example.html | |
| parent | 9050b2698a9df1be49e3fe8c4e2f33c0a227cbf9 (diff) | |
| download | bootstrap-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.html | 16 |
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 -}} |
