clubstudio / craft-inline-svg

A twig helper function for inlining SVGs
MIT License
3 stars 0 forks source link

How to use in conjunction with Asset Rev #1

Closed wihodges closed 5 years ago

wihodges commented 5 years ago

So trying to use inlineSvg as well as Asset Rev plugin with gulp. For everything else on site, rev is working just fine, the problem is on production inlineSvg doesn't see the rev url. E.g. this is not working {{ inlineSvg( rev('gradient-swiggle') ) }}

Any suggestions? Thanks!

scottwakefield commented 5 years ago

Hi @wihodges

If you inline all of your SVGs then I don't think you'd need to run them through rev(). As the full SVG code is inlined in the template you don't need to force the browser to clear its cache of the asset. However, if you're using SVGs in <img> somewhere, using rev() would make sense in those cases.

A mixture of the two won't play nice at the moment as rev() requires that you pass the full filename of the file so that it can either find the file in the filesystem to append the timestamp, or match it up with a key in your manifest file (if you have one).

If you do have a manifest file, could you post the contents of it? I'll see if there are any changes we can make to support what you're trying to achieve.

I hope that helps!