When passing an SVG to the Responsive tag, use the Statamic SVG tag instead of inlining an <img /> with src of SVG asset #159
schwartzmj
started this conversation in
Ideas
Replies: 1 comment
-
What is the use case here? I would not edit the Inlining SVG is a good idea and would indeed save a trip to the server, but there can be situations where the Personally if you are uploading |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, if you pass an SVG to the
{{ responsive }}
tag, it renders an<img />
element with thesrc
set to the path of the SVG.Is it accurate that all
{{ responsive }}
tags should be for assets hosted within the Statamic project? If so, I think we should consider calling the built in{{ svg }}
tag so that Statamic renders the SVG on the page instead of making the<img />
element make another request to the server.Below is an example of this working (first few lines within the
if
statement). I'm not sure if there's a better way to call the Statamic SVG tag with the$attributeString
we currently have.Beta Was this translation helpful? Give feedback.
All reactions