|
@@ -2,7 +2,12 @@
|
|
|
{{ if .Get "level" }}
|
|
|
<h{{ .Get "level" }}>
|
|
|
{{ end }}
|
|
|
- <button aria-expanded="{{ with .Get "open" }}true{{ else }}false{{ end }}" data-expands="js-expandable-{{ .Inner | md5 }}">
|
|
|
+ {{/* 1. Get the md5 hash of the expandable inner text */}}
|
|
|
+ {{/* 2. Split the hash string into an array */}}
|
|
|
+ {{/* 3. Shuffle the array */}}
|
|
|
+ {{/* 4. Convert the array back into a string */}}
|
|
|
+ {{ $random := delimit (shuffle (split (md5 .Inner) "" )) "" }}
|
|
|
+ <button aria-expanded="{{ with .Get "open" }}true{{ else }}false{{ end }}" data-expands="js-expandable-{{ $random }}">
|
|
|
<span class="expandable-label">{{ .Get "label" | default "More info" }}</span>
|
|
|
<svg aria-hidden="true" focusable="false" viewBox="0 0 70.866142 70.866141">
|
|
|
<g transform="translate(0 -981.5)">
|
|
@@ -14,7 +19,7 @@
|
|
|
{{ if .Get "level" }}
|
|
|
</h{{ .Get "level"}}>
|
|
|
{{ end }}
|
|
|
- <div id="js-expandable-{{ .Inner | md5 }}" {{ with .Get "open" | not }}hidden{{ end }}>
|
|
|
+ <div id="js-expandable-{{ $random }}" {{ with .Get "open" | not }}hidden{{ end }}>
|
|
|
{{ .Inner | markdownify }}
|
|
|
</div>
|
|
|
</div>
|