mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-13 21:13:21 +00:00
23 lines
731 B
HTML
23 lines
731 B
HTML
<!--
|
|
Displays a hidden panel that can be reveiled by a trigger. The shortcode supports the following arguments:
|
|
"id" Required unique id of the collapse element, e.g. "collapse-1".
|
|
"class" Optional class attribute of the inner panel element, e.g. “p-3”.
|
|
-->
|
|
|
|
{{ $id := .Get "id" | default "" -}}
|
|
{{ if not $id -}}
|
|
{{ errorf "Missing value for param 'id': %s" .Position -}}
|
|
{{ end -}}
|
|
|
|
{{ $class := .Get "class" | default "" }}
|
|
|
|
{{- $body := trim .Inner " \r\n" -}}
|
|
{{ if not $body -}}
|
|
{{ errorf "Missing inner element text: %s" .Position -}}
|
|
{{ end -}}
|
|
|
|
<p>
|
|
<div class="collapse" id="{{ $id }}">
|
|
<div class="{{ $class }}">{{ $body | .Page.RenderString }}</div>
|
|
</div>
|
|
</p> |