mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 09:43:06 +00:00
24 lines
No EOL
970 B
HTML
24 lines
No EOL
970 B
HTML
{{- $context := .context }}
|
|
{{- $content := .content }}
|
|
{{- $title := .title | default (T "Expand-title") }}
|
|
{{- $title = trim $title " " }}
|
|
{{- $expanded := .open | default false }}
|
|
{{- if eq (printf "%T" $expanded) "string" }}
|
|
{{- $expanded = (eq $expanded "true") }}
|
|
{{- end }}
|
|
{{- $direction := T "Reading-direction" | default "ltr" }}
|
|
{{- with $context }}
|
|
{{- $id := partial "make-random-md5.hugo" }}
|
|
<div class="expand">
|
|
<input type="checkbox" id="expand-{{ $id }}" aria-controls="expandcontent-{{ $id }}" {{ if $expanded }} checked{{ end }}>
|
|
<label class="expand-label" for="expand-{{ $id }}" >
|
|
<i class="fas fa-chevron-down"></i>
|
|
<i class="fas fa-chevron-left expand-rtl direction-{{ $direction }}"></i>
|
|
<i class="fas fa-chevron-right expand-ltr direction-{{ $direction }}"></i>
|
|
{{ $title }}
|
|
</label>
|
|
<div id="expandcontent-{{ $id }}" class="expand-content">
|
|
{{ $content | safeHTML }}
|
|
</div>
|
|
</div>
|
|
{{- end }} |