2022-06-22 18:32:18 +00:00
|
|
|
{{- $context := .context }}
|
|
|
|
{{- $content := .content }}
|
|
|
|
{{- $title := .title | default (T "Expand-title") }}
|
2022-12-01 00:37:09 +00:00
|
|
|
{{- $title = trim $title " " }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- $expanded := .open | default false }}
|
|
|
|
{{- if eq (printf "%T" $expanded) "string" }}
|
|
|
|
{{- $expanded = (eq $expanded "true") }}
|
|
|
|
{{- end }}
|
2023-05-18 12:01:50 +00:00
|
|
|
{{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $context) .id }}
|
2022-06-22 18:32:18 +00:00
|
|
|
{{- with $context }}
|
2023-02-03 07:57:55 +00:00
|
|
|
<div class="expand">
|
|
|
|
<input type="checkbox" id="expand-{{ $id }}" aria-controls="expandcontent-{{ $id }}" {{ if $expanded }} checked{{ end }}>
|
|
|
|
<label class="expand-label" for="expand-{{ $id }}" >
|
2022-06-22 18:32:18 +00:00
|
|
|
<i class="fas fa-chevron-down"></i>
|
2023-02-09 00:02:06 +00:00
|
|
|
<i class="fas fa-chevron-right"></i>
|
2023-03-14 20:48:18 +00:00
|
|
|
{{ $title | markdownify }}
|
2023-02-03 07:57:55 +00:00
|
|
|
</label>
|
|
|
|
<div id="expandcontent-{{ $id }}" class="expand-content">
|
2022-06-22 18:32:18 +00:00
|
|
|
{{ $content | safeHTML }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end }}
|