Inline SVGs can be styled with CSS. Is there already a way to inline SVGs in templates (and maybe also with a shortcode)?
This could be done with a partial, but is that the best way?
Please use https://discourse.gohugo.io/ for questions/troubleshooting. Also see Hugo Documentation.
This could be done with a partial, but is that the best way?
An SVG can be inlined by using readfile (or a readfile shortcode). It may be necessary to change the width, height, id, and/or class attributes of the <svg> tag; or to wrap the element in a <div> with an id and/or class.
{{ readFile "/static/img/filename.svg" }}
Most helpful comment
An SVG can be inlined by using
readfile(or areadfileshortcode). It may be necessary to change the width, height, id, and/or class attributes of the<svg>tag; or to wrap the element in a<div>with an id and/or class.