#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
+2 -1
View File
@@ -7,13 +7,14 @@
<script defer src="{{ "asciinema/asciinema-auto.js" | relURL }}"></script>
{{- .Page.Store.Set "asciinema" true -}}
{{- end -}}
{{- $id := partial "docs/text/shortcode-id" . -}}
{{- $href := (partial "docs/links/portable-image" (dict "Page" .Page "Destination" (.Get "cast"))) -}}
{{- .Store.Set "asciinema" .Params -}}
{{- .Store.DeleteInMap "asciinema" "cast" -}}
{{- $attributes := partial "docs/text/mapper" (dict
"attributes" (dict)
"set" (dict
"id" (printf "asciinema-%d" .Ordinal)
"id" (printf "asciinema-%d" ($id))
"x-data-cast" $href
"x-data-opts" (.Store.Get "asciinema" | jsonify)
)