🐛 Fix: image shortcode/plugin lose the support for svg type files (#210)

This commit is contained in:
Cell
2022-10-11 14:55:52 +08:00
parent 268bed75ad
commit 49866cbc49
2 changed files with 6 additions and 2 deletions
+1
View File
@@ -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]
+5 -2
View File
@@ -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 := "" -}}