Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

SVGs not in page.media

Started by Muut Archive 11 years ago · 4 replies · 499 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 2280 9 years ago
Archive · by Muut Archive, 9 years ago
2 1496 9 years ago
Archive · by Muut Archive, 9 years ago
2 4745 9 years ago
Archive · by Muut Archive, 9 years ago
1 3560 9 years ago
Archive · by Muut Archive, 9 years ago
3 1621 9 years ago