Adding lazy loading attribute to KirbyText (image: …)

This page has the following example:


<?php if ($image = $page->image()): ?>
    <img
        loading="lazy" alt="<?= $image->alt() ?>"
        src="<?= $image->url() ?>"
        height="<?= $image->height() ?>"
        width="<?= $image->width() ?>"
    >
<?php endif ?>

Which I think would work well for my use case as lazy loading would be automatically added, but I’m not clear on where this code should be added? Somewhere in the template I assume, but it’s not clear to me where this would live.