diff --git a/CHANGELOG.md b/CHANGELOG.md index 73967a60..ad67e17a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. - :truck: Feat: migrate parameter `params.autoBookmark` to `params.page.autoBookmark` ([#55](https://github.com/hugo-fixit/FixIt/issues/55)) - :bug: Fix: remove the leading and trailing whitespace of the code string ([#205](https://github.com/hugo-fixit/FixIt/issues/205)) +- :bug: Fix: image shortcode/plugin lose the support for svg type files ([#210](https://github.com/hugo-fixit/FixIt/issues/210)) - **Full Changelog:** @Lruihao [`v0.2.16...v0.2.17`](https://github.com/hugo-fixit/FixIt/compare/v0.2.16...v0.2.17) ## v0.2.16 [2022.9.24] diff --git a/layouts/partials/plugin/image.html b/layouts/partials/plugin/image.html index 04ae79bb..c4ee4153 100644 --- a/layouts/partials/plugin/image.html +++ b/layouts/partials/plugin/image.html @@ -4,8 +4,11 @@ {{- $height := .Height -}} {{- with dict "Path" $src "Resources" .Resources | partial "function/resource.html" -}} {{- $src = .RelPermalink -}} - {{- $width = $width | default .Width -}} - {{- $height = $height | default .Height -}} + {{- /* Resources can not get width and height of image for svg type */ -}} + {{- if ne .MediaType.SubType "svg" -}} + {{- $width = $width | default .Width -}} + {{- $height = $height | default .Height -}} + {{- end -}} {{- end -}} {{- $style := "" -}}