For extra points, you can even define a custom shortcode which could insert in other stuff as well.
For example, I almost always use svgs with captions, so my shortcode looks something like this:
{# Sample usage: {{ svgfigure(src="array-diagram.svg",
style="size-small center",
caption="An Array",
caption_style="font-weight: bold; font-style: italic;") }} #}
<figure class="{%- if class is defined -%}{{ class | safe }}{%- else -%} center {%- endif %}">
{%- set src = "content" ~ page.path ~ src -%}
{%- set svg = load_data(path=src, required=true) -%}
<!--Add proper accessibility to svgs: https://stackoverflow.com/a/4756461/10147642 - if you're reading this in DevTools, and have an idea of how to, feel free to write to me!-->
{{ svg | safe }}
{% if caption %}
<figcaption {% if caption_style %} style="{{ caption_style | safe }}"{% endif %}>{{ caption }}</figcaption>
{% endif %}
</figure>