// Adds some HTML attributes to images, // only loading=lazy for now import { selectAll } from 'unist-util-select' export default function rehypeImageAttr() { return (tree, file) => { const imgs = selectAll('element[tagName=img]', tree) for (let img of imgs) { img.properties.loading = 'lazy' } } }