polymech-astro/packages/imagetools_3/components/Picture.astro
2025-12-25 02:08:14 +01:00

20 lines
458 B
Plaintext

---
import renderPicture from "../api/renderPicture.js";
import type { PictureConfigOptions } from "../types.d";
declare interface Props extends PictureConfigOptions {
s?: string;
}
const { s, ...rest } = Astro.props as Props;
if (s) {
const separator = rest.src.includes("?") ? "&" : "?";
rest.src = `${rest.src}${separator}s=${s}`;
}
const { link, style, picture } = await renderPicture(rest);
---
<Fragment set:html={link + style + picture} />