1 unstable release

0.0.0 Jan 18, 2019

#36 in #generate-html

MIT/Apache

13KB
114 lines

open-graph

crates.io version build status downloads docs.rs docs

Generate HTML for Open Graph integration.

Examples

Basic usage

use open_graph::{OpenGraph, ObjectType};

let card = OpenGraph::builder()
  .site("@flickr")
  .title("The Rock")
  .type(ObjectType::VideoMovie)
  .image("http://ia.media-imdb.com/images/rock.jpg")
  .build();
<--! Output -->
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />

Installation

$ cargo add open-graph

Safety

This crate uses #![deny(unsafe_code)] to ensure everything is implemented in 100% Safe Rust.

Contributing

Want to join us? Check out our "Contributing" guide and take a look at some of these issues:

References

License

MIT OR Apache-2.0

Dependencies

~2MB
~64K SLoC