macro_rules! Image {
($($key:ident = $val:expr),* $(,)?) => { ... };
}Expand description
Responsive, lazily loaded image.
use next_rust_view::*;
let html = render_static(Image!(src = "/cat.jpg", width = 640, height = 480, alt = "A cat"));
assert!(html.starts_with(r#"<img src="/_next-rust/image?url=%2Fcat.jpg&w=640&q=75""#));
assert!(html.contains(r#"loading="lazy""#));