diff options
author | Robert Kaussow <mail@geeklabor.de> | 2021-06-02 18:26:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-02 18:26:13 +0300 |
commit | 51742a40307c510d60231371917debe8658774b5 (patch) | |
tree | 8cd98bbbd98c0ab85541abffc1a9792626522d85 | |
parent | b3f6ad3ca0647cecc65c6b1fd9e70b27e6dcdcea (diff) |
fix: fix rendering of nested img shortcodes (#142)v0.13.5
* fix: fix rendering of nested img shortcodes
* fix whitespaces
-rw-r--r-- | layouts/shortcodes/img.html | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index a950e86..3d07356 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -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 }} |