fix: fix rendering of nested img shortcodes (#142)

* fix: fix rendering of nested img shortcodes

* fix whitespaces
uci-hugo-doc
Robert Kaussow 2021-06-02 17:26:13 +02:00 committed by GitHub
parent b3f6ad3ca0
commit 51742a4030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 13 deletions

View File

@ -17,22 +17,13 @@
<figure class="gdoc-markdown__figure">
<a class="gdoc-markdown__link--raw" href="{{ .RelPermalink }}">
<picture>
<source
{{ with $customSize }}
srcset="{{ index $size $customSize }}"
{{ else }}
srcset="{{ $size.small }} 600w,
{{ $size.medium }} 1200w"
sizes="100vw"
{{ end }} />
<img
{{ if $lazyLoad }}loading="lazy"{{ end }}
src="{{ $size.large }}" alt="{{ $caption }}" />
<source {{ with $customSize }}srcset="{{ index $size $customSize }}"{{ else }}srcset="{{ $size.small }} 600w, {{ $size.medium }} 1200w" sizes="100vw"{{ end }} />
<img {{ if $lazyLoad }}loading="lazy" {{ end }}src="{{ $size.large }}" alt="{{ $caption }}" />
</picture>
</a>
{{ with $caption }}
{{ with $caption -}}
<figcaption>{{ . }}{{ with $source.Params.credits }} ({{ . | $.Page.RenderString }}){{ end }}</figcaption>
{{ end }}
{{- end }}
</figure>
</div>
{{ end }}