8000 Page bundle can't handle *.svg images · Issue #79 · tomfran/typo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Page bundle can't handle *.svg images #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
OleMussmann opened this issue Feb 2, 2025 · 0 comments
Open

Page bundle can't handle *.svg images #79

OleMussmann opened this issue Feb 2, 2025 · 0 comments

Comments

@OleMussmann
Copy link

In page bundles, the default template tries to resize all bundled images. This fails on *.svg .

{{ with $imgResource }}width="{{ .Width }}px" height="{{ .Height }}px"{{ end }}

Error message:

render: failed to render pages: render of "[...]/content/about/_index.md" failed:
"[...]/themes/typo/layouts/_default/list.html:8:7": execute of template failed at
<.Content>: error calling Content: "[...]/content/about/_index.md:1:1":
"[...]/themes/typo/layouts/_default/_markup/render-image.html:50:96": execute of
template failed at <.Width>: error calling Width: this method is only available
for raster images. To determine if an image is SVG, you can do
{{ if eq .MediaType.SubType "svg" }}{{ end }} 

Interestingly enough, this does not happen when loading images from the global /asset folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0