Update quickstart mixin to make it more customisable
@@ -93,7 +93,7 @@ mixin permalink(id)
groups - [object] option groups, uses global variable QUICKSTART
headline - [string] optional text to be rendered as widget headline
-mixin quickstart(groups, headline, description)
+mixin quickstart(groups, headline, description, hide_results)
.c-quickstart.o-block-small#qs
.c-quickstart__content
if headline
@@ -102,18 +102,22 @@ mixin quickstart(groups, headline, description)
p=description
for group in groups
.c-quickstart__group.u-text-small(data-qs-group=group.id)
+ if group.title
.c-quickstart__legend=group.title
if group.help
| #[+help(group.help)]
.c-quickstart__fields
for option in group.options
- input.c-quickstart__input(class="c-quickstart__input--" + (group.multiple ? "check" : "radio") type=group.multiple ? "checkbox" : "radio" name=group.id id=option.id value=option.id checked=option.checked)
- label.c-quickstart__label(for=option.id)=option.title
+ input.c-quickstart__input(class="c-quickstart__input--" + (group.input_style ? group.input_style : group.multiple ? "check" : "radio") type=group.multiple ? "checkbox" : "radio" name=group.id id=option.id value=option.id checked=option.checked)
+ label.c-quickstart__label(for=option.id)!=option.title
if option.meta
| #[span.c-quickstart__label__meta (#{option.meta})]
if option.help
| #[+help(option.help)]
+ if hide_results
+ block
+ else
pre.c-code-block
code.c-code-block__content.c-quickstart__code(data-qs-results="")
block
