Typed Open Graph
The Open Graph Protocol Builder that generates the structured data that you can use with the template engine of your choice.
Example
use ;
use Url;
Installation
The Open Graph Protocol Builder that generates the structured data that you can use with the template engine of your choice.
use typed_open_graph::{Website, OpenGraphTypeMarker};
use url::Url;
fn main() {
let website = Website::builder(
"The Title",
Url::parse("https://example.com/image.jpg").unwrap(),
Url::parse("https://example.com/").unwrap()
)
.image_type("image/jpeg")
.build();
// should print generated structure ready to be used in template engine
dbg!(website);
}
cargo add typed-open-graph