I'm trying to render a media field as a responsive image in a custom twig template.
My naive approach looks like this:
{% include 'responsive-image.html.twig' with {
"sources": content.field_media,
} %}
which simply yields a series of errors like this:
"0" is an invalid render array key in Drupal\Core\Render\Element::children() (line 97 of core/lib/Drupal/Core/Render/Element.php).
Presumably one of the reasons this fails is that I'm not providing a view mode, but I'm also not sure how to do so.