diff --git a/exampleSite/content/tests/images/_index.en.md b/exampleSite/content/tests/images/_index.en.md index de0d3ee1e2..db8287bcab 100644 --- a/exampleSite/content/tests/images/_index.en.md +++ b/exampleSite/content/tests/images/_index.en.md @@ -7,6 +7,10 @@ Some testing for different styles of image links. ## Markdown +### Resource SVG + +![Magic](test.svg?classes=shadow) + ### Relative to page ![Magic](magic.gif?classes=shadow) @@ -15,7 +19,7 @@ Some testing for different styles of image links. ![Magic](../images/magic.gif?classes=shadow&height=50px) -### Static +### Static SVG ![Logo](/images/logo.svg?classes=shadow&height=50px) @@ -33,6 +37,10 @@ Some testing for different styles of image links. ## HTML +### Resource SVG + +
+ ### Relative to page @@ -41,7 +49,7 @@ Some testing for different styles of image links. -### Static +### Static SVG diff --git a/exampleSite/content/tests/images/test.svg b/exampleSite/content/tests/images/test.svg new file mode 100644 index 0000000000..48b180dc69 --- /dev/null +++ b/exampleSite/content/tests/images/test.svg @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/layouts/partials/shortcodes/image.html b/layouts/partials/shortcodes/image.html index bfefc0bd7f..81fc264709 100644 --- a/layouts/partials/shortcodes/image.html +++ b/layouts/partials/shortcodes/image.html @@ -20,8 +20,10 @@ {{- if $dest_url.RawQuery }} {{- $url = printf "%s?%s" $url $dest_url.RawQuery }} {{- end }} - {{- $height = printf "%dpx" $image.Height }} - {{- $width = printf "%dpx" $image.Width }} + {{- if ne $image.MediaType.SubType "svg" }} + {{- $height = printf "%dpx" $image.Height }} + {{- $width = printf "%dpx" $image.Width }} + {{- end }} {{- end }} {{- if $dest_url.RawQuery }} {{- $classes = (replaceRE "\\s+" " " (replaceRE "," " " ($dest_url.Query.Get "classes") ) ) }}