tenon media
Tenon stores resized copies of each image, called variants, next to the original. When you change how images are resized, the stored variants no longer match. tenon media regenerate brings them in line with your config.
tenon media regenerate
npx tenon media regenerate
Run it after you change media.images, for example the sizes, the presets, the format or the image provider. It does two things:
- It deletes stored variants that your options no longer produce.
- With
prerender, it renders the variants that are missing.
It prints how many variants it rendered and removed.
tenon.config.ts.Where it runs
tenon media regenerate works on the local project only. It renders with your image provider and writes to your media storage, so run it where tenon.config.ts reaches both.
--urlandTENON_URLare refused.- With
media: false, it stops: there is no media library. - A config for Cloudflare runs only there. Call
cms.media.regenerate()from code on Cloudflare instead.
Without an image provider
Without a provider, Tenon renders nothing on the server. The admin makes its own small previews in the browser instead. The command then says how many images have no preview yet. To create them, open Media in the admin and choose Create missing previews.
Related resources
- Media: sizes, presets and variants.
- Image providers: which provider renders the variants.