For me it worked:
{% include '/images/my.svg' %}
Just a quick update if you are using Drupal 8, because the code in the previous answer did not work for me. Here is how I did it:
function theme_preprocess_page(&$variables) { $svg = file_get_contents(drupal_get_path('theme', 'theme_name') . '/images/my.svg'); $variables['some_svg'] = $svg)); }
And in the twig file, I output it like this:
{{ some_svg|raw }}
AljoΕ‘a
source share