thegeeklab / hugo-geekdoc

Hugo theme made for documentation

Home Page:https://geekdocs.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shortcode img can't handle SVG

n-arakawa opened this issue · comments

This is just a edge case.

{{<img name="sample.svg">}}

=>

failed to render shortcode "img": failed to process shortcode: "/tmp/site/themes/hugo-geekdoc/layouts/shortcodes/img.html:10:19": execute of template failed at <.Fill>: error calling Fill: this method is only available for raster images. To determine if an image is SVG, you can do {{ if eq .MediaType.SubType "svg" }}{{ end }}

Basic support to render SVG via the img shortcode added with the linked PR. As handling the size of SVG images dynamically is quite difficult, the support is limited.