Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

SVGs not in page.media

Started by Muut Archive 11 years ago · 4 replies · 376 views
11 years ago

In a page module folder I have a regular SVG. Its the only image file in the folder. The theme runs {% set image = page.media.images|first %} and then {{ image.html }} but nothing is output. If I add a JPEG to that folder, the JPEG loads.

It seems that page.media.images does not include SVG files. Am I missing a setting or is that not supported?

11 years ago

rhukster posted the right answer in the issue tracker:

Because SVG is actually a special kind of image and can't be manipulated with filters, it actually is listed in page.media.files.

Specifically it would be:

{{ page.media.files['firefox.svg'].html }}
or in markdown syntax simply:

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1334 9 years ago
Archive · by Muut Archive, 9 years ago
2 924 9 years ago
Archive · by Muut Archive, 9 years ago
2 4055 9 years ago
Archive · by Muut Archive, 9 years ago
1 2938 9 years ago
Archive · by Muut Archive, 9 years ago
3 1111 9 years ago