Assets

Assets can be bundled with the asset! macro, it will include the given file path (relative to the crates Cargo.toml), the macro expands to the runtime path of the asset (prefixed with /, or base_path if set)

extern crate natrix;
use natrix::prelude::*;
let _: e::HtmlElement<(), _> =
e::img()
    .src(natrix::asset!("./assets/my_img.png"))
;

This will include /path/to/crate/./assets/my_img.png in the dist folder, and expand to something like this in rust:

extern crate natrix;
use natrix::prelude::*;
let _: e::HtmlElement<(), _> =
e::img()
    .src("/SOME_HASH-my_img.png")
;