#803, use page-level IDs for shortcodes

This commit is contained in:
Alex Shpak
2026-05-16 23:47:34 +02:00
parent 54f9ceeeee
commit fe5f41f15d
7 changed files with 20 additions and 11 deletions
+5 -5
View File
@@ -3,8 +3,8 @@
"attributes" (cond .IsNamedParams .Params dict)
"keep" (slice "id" "class" "tabindex" "alt" "title" "loading")
) -}}
<label class="book-image" for="book-image-toggle-{{ .Ordinal }}">
<input class="hidden toggle" type="checkbox" id="book-image-toggle-{{ .Ordinal }}" />
<img src="{{ $destination | safeURL }}" {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }} />
</label>
{{- /* remove whitespaces */ -}}
{{- $id := partial "docs/text/shortcode-id" . -}}
<label class="book-image" for="book-image-toggle-{{ $id }}">{{- /* remove whitespaces */ -}}
<input class="hidden toggle" type="checkbox" id="book-image-toggle-{{ $id }}" />{{- /* remove whitespaces */ -}}
<img src="{{ $destination | safeURL }}" {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }} />{{- /* remove whitespaces */ -}}
</label>{{- /* remove whitespaces */ -}}