Review and update whitespaces in shortcodes to improve shortcode nesting

This commit is contained in:
Alex Shpak
2025-09-26 15:48:57 +02:00
parent 48157b18c7
commit 5ffdf5bfaf
18 changed files with 89 additions and 74 deletions
+12 -10
View File
@@ -1,15 +1,17 @@
{{- if not (.Page.Store.Get "asciinema") -}}
<!-- Include asciinema player only first time -->
<link rel="stylesheet" href="{{ "asciinema/asciinema-player.css" | relURL }}" />
<script defer src="{{ "asciinema/asciinema-player.min.js" | relURL }}"></script>
<script defer src="{{ "asciinema/asciinema-auto.js" | relURL }}"></script>
{{- .Page.Store.Set "asciinema" true -}}
<!-- Include asciinema player only first time -->
{{- /* remove whitespaces */ -}}
<link rel="stylesheet" href="{{ "asciinema/asciinema-player.css" | relURL }}" />
{{- /* remove whitespaces */ -}}
<script defer src="{{ "asciinema/asciinema-player.min.js" | relURL }}"></script>
{{- /* remove whitespaces */ -}}
<script defer src="{{ "asciinema/asciinema-auto.js" | relURL }}"></script>
{{- .Page.Store.Set "asciinema" true -}}
{{- end -}}
{{- with (partial "docs/links/portable-image" (dict "Page" .Page "Destination" (index .Params "cast"))) -}}
{{- $opts := newScratch -}}
{{- $opts.Set "asciinema" $.Params -}}
{{- $opts.DeleteInMap "asciinema" "cast" -}}
<div class="asciinema" id="asciinema-{{ $.Ordinal }}" x-data-cast="{{ . | safeHTMLAttr }}" x-data-opts="{{ $opts.Get "asciinema" | jsonify | safeHTMLAttr }}"></div>
{{- $opts := newScratch -}}
{{- $opts.Set "asciinema" $.Params -}}
{{- $opts.DeleteInMap "asciinema" "cast" -}}
<div class="asciinema" id="asciinema-{{ $.Ordinal }}" x-data-cast="{{ . | safeHTMLAttr }}" x-data-opts="{{ $opts.Get "asciinema" | jsonify | safeHTMLAttr }}"></div>
{{- end -}}